@@ -42,15 +42,13 @@ pub fn run_state_transition_test(
4242 let mut state = LeanState :: try_from ( test. pre . clone ( ) )
4343 . map_err ( |err| anyhow ! ( "Failed to convert pre-state: {err}" ) ) ?;
4444
45- // Track whether we expect an exception
46- let expect_exception = test. expect_exception . is_some ( ) ;
45+ // Track whether we expect an exception (devnet4: expectException, devnet5: rejectionReason)
46+ let expect_exception = test. expects_failure ( ) ;
4747 if expect_exception {
48- info ! (
49- "Expected result: Exception: {}" ,
50- test. expect_exception
51- . as_ref( )
52- . expect( "Failed to fetch expected exception" )
53- ) ;
48+ let reason = test. expect_exception . as_deref ( )
49+ . or ( test. rejection_reason . as_deref ( ) )
50+ . unwrap_or ( "unknown" ) ;
51+ info ! ( "Expected result: Exception: {reason}" ) ;
5452 } else {
5553 info ! ( "Expected result: Success" ) ;
5654 }
@@ -95,12 +93,10 @@ pub fn run_state_transition_test(
9593 // Check if the result matches expectations
9694 match ( result, expect_exception) {
9795 ( Ok ( _) , true ) => {
98- bail ! (
99- "Expected exception '{}' but state transition succeeded" ,
100- test. expect_exception
101- . as_ref( )
102- . expect( "Failed to fetch expected exception" )
103- ) ;
96+ let reason = test. expect_exception . as_deref ( )
97+ . or ( test. rejection_reason . as_deref ( ) )
98+ . unwrap_or ( "unknown" ) ;
99+ bail ! ( "Expected exception '{reason}' but state transition succeeded" ) ;
104100 }
105101 ( Err ( err) , false ) => {
106102 bail ! ( "State transition should succeed but failed: {err}" ) ;
0 commit comments