@@ -188,6 +188,8 @@ pub fn run_test(
188188 Fork :: Istanbul => Config :: istanbul ( ) ,
189189 Fork :: Berlin => Config :: berlin ( ) ,
190190 Fork :: London => Config :: london ( ) ,
191+ Fork :: Shanghai => Config :: shanghai ( ) ,
192+ Fork :: Cancun => Config :: cancun ( ) ,
191193 _ => return Err ( Error :: UnsupportedFork ) ,
192194 } ;
193195 config_change ( & mut config) ;
@@ -206,10 +208,21 @@ pub fn run_test(
206208 Some ( TestExpectException :: TR_NoFunds ) => return Ok ( ( ) ) ,
207209 Some ( TestExpectException :: TR_GasLimitReached ) => return Ok ( ( ) ) ,
208210 Some ( TestExpectException :: TR_TipGtFeeCap ) => return Ok ( ( ) ) ,
211+ Some ( TestExpectException :: TE_TYPE_3_TX_PRE_FORK ) => return Ok ( ( ) ) ,
212+ Some ( TestExpectException :: TE_TYPE_3_TX_PRE_FORK_OR_TX_ZERO_BLOBS ) => return Ok ( ( ) ) ,
213+ Some ( TestExpectException :: TE_TYPE_3_TX_BLOB_COUNT_EXCEEDED ) => return Ok ( ( ) ) ,
214+ Some ( TestExpectException :: TE_INSUFFICIENT_ACCOUNT_FUNDS ) => return Ok ( ( ) ) ,
209215
210216 _ => ( ) ,
211217 }
212218
219+ if test. transaction . blob_versioned_hashes . is_some ( ) {
220+ // Rust EVM doesn't deal directly with transactions. Currently we expect
221+ // users of Rust EVM to deduct blob costs themselves for TYPE 3
222+ // transactions, but this may change in the future.
223+ return Ok ( ( ) ) ;
224+ }
225+
213226 let env = InMemoryEnvironment {
214227 block_hashes : {
215228 let mut block_hashes = BTreeMap :: new ( ) ;
@@ -229,6 +242,12 @@ pub fn run_test(
229242 block_randomness : test. env . current_random ,
230243 block_gas_limit : test. env . current_gas_limit ,
231244 block_base_fee_per_gas : test. env . current_base_fee . unwrap_or_default ( ) ,
245+ blob_base_fee_per_gas : U256 :: zero ( ) ,
246+ blob_versioned_hashes : test
247+ . transaction
248+ . blob_versioned_hashes
249+ . clone ( )
250+ . unwrap_or_default ( ) ,
232251 chain_id : U256 :: one ( ) ,
233252 } ;
234253
@@ -366,11 +385,11 @@ pub fn run_test(
366385
367386 let state_root = crate :: hash:: state_root ( & run_backend) ;
368387
369- if test. post . expect_exception . is_some ( ) {
388+ if let Some ( expect_exception ) = test. post . expect_exception {
370389 if run_result. is_err ( ) {
371390 return Ok ( ( ) ) ;
372391 } else {
373- return Err ( TestError :: ExpectException . into ( ) ) ;
392+ return Err ( TestError :: ExpectException ( expect_exception ) . into ( ) ) ;
374393 }
375394 }
376395
@@ -421,6 +440,7 @@ pub fn run_test(
421440 to : test. transaction . to ,
422441 value : vec ! [ test. transaction. value] ,
423442 access_lists : Some ( vec ! [ Some ( test. transaction. access_list) ] ) ,
443+ blob_versioned_hashes : test. transaction . blob_versioned_hashes ,
424444 } ,
425445 } ,
426446 ) ;
0 commit comments