Skip to content

Commit 948c04a

Browse files
committed
fix: upgrade legacy
1 parent e3da935 commit 948c04a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

crates/evm/evm/src/lib.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ extern crate alloc;
1919

2020
use crate::execute::BasicBlockBuilder;
2121
use alloc::vec::Vec;
22-
use alloy_eips::{eip2930::AccessList, eip4895::Withdrawals};
22+
use alloy_eips::{
23+
eip2718::{EIP2930_TX_TYPE_ID, LEGACY_TX_TYPE_ID},
24+
eip2930::AccessList,
25+
eip4895::Withdrawals,
26+
};
2327
use alloy_evm::{
2428
block::{BlockExecutorFactory, BlockExecutorFor},
2529
precompiles::PrecompilesMap,
@@ -358,6 +362,12 @@ impl TransactionEnv for TxEnv {
358362

359363
fn set_access_list(&mut self, access_list: AccessList) {
360364
self.access_list = access_list;
365+
366+
if self.tx_type == LEGACY_TX_TYPE_ID {
367+
// if this was previously marked as legacy tx, this must be upgraded to eip2930 with an
368+
// accesslist
369+
self.tx_type = EIP2930_TX_TYPE_ID;
370+
}
361371
}
362372
}
363373

0 commit comments

Comments
 (0)