Skip to content

Commit

Permalink
fix: lost tx_type when doing type conversion (scroll-tech#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunxian-xia authored Aug 2, 2023
1 parent f12d26c commit 5fe2b3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions bus-mapping/src/circuit_input_builder/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ impl From<&Transaction> for geth_types::Transaction {
gas_tip_cap: tx.gas_tip_cap,
rlp_unsigned_bytes: tx.rlp_unsigned_bytes.clone(),
rlp_bytes: tx.rlp_bytes.clone(),
tx_type: tx.tx_type,
..Default::default()
}
}
Expand Down
14 changes: 10 additions & 4 deletions eth-types/src/geth_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ impl TxType {
Some(x) if x == U64::from(1) => Self::Eip2930,
Some(x) if x == U64::from(2) => Self::Eip2930,
Some(x) if x == U64::from(0x7e) => Self::L1Msg,
_ => match tx.v.as_u64() {
0 | 1 | 27 | 28 => Self::PreEip155,
_ => Self::Eip155,
},
_ => {
if tx.v.is_zero() && tx.r.is_zero() && tx.s.is_zero() {
Self::L1Msg
} else {
match tx.v.as_u64() {
0 | 1 | 27 | 28 => Self::PreEip155,
_ => Self::Eip155,
}
}
}
}
}

Expand Down

0 comments on commit 5fe2b3a

Please sign in to comment.