@@ -390,6 +390,11 @@ fn test_get_gas_price() {
390
390
889897 , // real block 889898
391
391
RpcChain :: TestNet
392
392
) ]
393
+ #[ test_case(
394
+ "0x037e199c9560666d810862bc0cf62a67aae33af6b65823068143640cdeecd8ab" ,
395
+ 895707 , // real block 895708
396
+ RpcChain :: TestNet
397
+ ) ]
393
398
fn starknet_in_rust_test_case_tx ( hash : & str , block_number : u64 , chain : RpcChain ) {
394
399
let ( tx_info, trace, receipt) = execute_tx ( hash, chain, BlockNumber ( block_number) ) ;
395
400
@@ -401,6 +406,7 @@ fn starknet_in_rust_test_case_tx(hash: &str, block_number: u64, chain: RpcChain)
401
406
let CallInfo {
402
407
execution_resources,
403
408
internal_calls,
409
+ retdata,
404
410
..
405
411
} = call_info. unwrap ( ) ;
406
412
@@ -440,6 +446,17 @@ fn starknet_in_rust_test_case_tx(hash: &str, block_number: u64, chain: RpcChain)
440
446
) ;
441
447
}
442
448
}
449
+
450
+ let rpc_retdata: Vec < Felt252 > = trace
451
+ . function_invocation
452
+ . unwrap ( )
453
+ . retdata
454
+ . unwrap ( )
455
+ . into_iter ( )
456
+ . map ( |sf| Felt252 :: from_bytes_be ( sf. bytes ( ) ) )
457
+ . collect ( ) ;
458
+
459
+ assert_eq ! ( retdata, rpc_retdata) ;
443
460
}
444
461
445
462
#[ test_case(
@@ -559,72 +576,3 @@ fn starknet_in_rust_test_case_declare_tx(hash: &str, block_number: u64, chain: R
559
576
}
560
577
}
561
578
}
562
-
563
- #[ test_case(
564
- "0x037e199c9560666d810862bc0cf62a67aae33af6b65823068143640cdeecd8ab" ,
565
- 895707 , // real block 895708
566
- RpcChain :: TestNet
567
- ) ]
568
- fn test_get_block_hash_syscall ( hash : & str , block_number : u64 , chain : RpcChain ) {
569
- let ( tx_info, trace, receipt) = execute_tx ( hash, chain, BlockNumber ( block_number) ) ;
570
-
571
- let TransactionExecutionInfo {
572
- call_info,
573
- actual_fee,
574
- ..
575
- } = tx_info;
576
- let CallInfo {
577
- execution_resources,
578
- internal_calls,
579
- retdata,
580
- ..
581
- } = call_info. unwrap ( ) ;
582
-
583
- // check Cairo VM execution resources
584
- assert_eq_sorted ! (
585
- execution_resources. as_ref( ) ,
586
- Some (
587
- & trace
588
- . function_invocation
589
- . as_ref( )
590
- . unwrap( )
591
- . execution_resources
592
- ) ,
593
- "execution resources mismatch"
594
- ) ;
595
-
596
- // check amount of internal calls
597
- assert_eq ! (
598
- internal_calls. len( ) ,
599
- trace
600
- . function_invocation
601
- . as_ref( )
602
- . unwrap( )
603
- . internal_calls
604
- . len( ) ,
605
- "internal calls length mismatch"
606
- ) ;
607
-
608
- // check actual fee calculation
609
- if receipt. actual_fee != actual_fee {
610
- let diff = 100 * receipt. actual_fee . abs_diff ( actual_fee) / receipt. actual_fee ;
611
-
612
- if diff >= 5 {
613
- assert_eq ! (
614
- actual_fee, receipt. actual_fee,
615
- "actual_fee mismatch differs from the baseline by more than 5% ({diff}%)" ,
616
- ) ;
617
- }
618
- }
619
-
620
- let rpc_retdata: Vec < Felt252 > = trace
621
- . function_invocation
622
- . unwrap ( )
623
- . retdata
624
- . unwrap ( )
625
- . into_iter ( )
626
- . map ( |sf| Felt252 :: from_bytes_be ( sf. bytes ( ) ) )
627
- . collect ( ) ;
628
-
629
- assert_eq ! ( retdata, rpc_retdata) ;
630
- }
0 commit comments