Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 5fe2b3a

Browse files
authored
fix: lost tx_type when doing type conversion (#710)
1 parent f12d26c commit 5fe2b3a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

bus-mapping/src/circuit_input_builder/transaction.rs

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ impl From<&Transaction> for geth_types::Transaction {
253253
gas_tip_cap: tx.gas_tip_cap,
254254
rlp_unsigned_bytes: tx.rlp_unsigned_bytes.clone(),
255255
rlp_bytes: tx.rlp_bytes.clone(),
256+
tx_type: tx.tx_type,
256257
..Default::default()
257258
}
258259
}

eth-types/src/geth_types.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,16 @@ impl TxType {
5858
Some(x) if x == U64::from(1) => Self::Eip2930,
5959
Some(x) if x == U64::from(2) => Self::Eip2930,
6060
Some(x) if x == U64::from(0x7e) => Self::L1Msg,
61-
_ => match tx.v.as_u64() {
62-
0 | 1 | 27 | 28 => Self::PreEip155,
63-
_ => Self::Eip155,
64-
},
61+
_ => {
62+
if tx.v.is_zero() && tx.r.is_zero() && tx.s.is_zero() {
63+
Self::L1Msg
64+
} else {
65+
match tx.v.as_u64() {
66+
0 | 1 | 27 | 28 => Self::PreEip155,
67+
_ => Self::Eip155,
68+
}
69+
}
70+
}
6571
}
6672
}
6773

0 commit comments

Comments
 (0)