diff --git a/crates/papyrus_rpc/resources/V0_4/starknet_trace_api_openrpc.json b/crates/papyrus_rpc/resources/V0_4/starknet_trace_api_openrpc.json index a0d59800f6..3a2d47cfae 100644 --- a/crates/papyrus_rpc/resources/V0_4/starknet_trace_api_openrpc.json +++ b/crates/papyrus_rpc/resources/V0_4/starknet_trace_api_openrpc.json @@ -126,11 +126,11 @@ "description": "Returns the execution traces of all transactions included in the given block", "params": [ { - "name": "block_hash", - "summary": "The hash of the requested block", + "name": "block_id", + "description": "The hash of the requested block, or number (height) of the requested block, or a block tag", "required": true, "schema": { - "$ref": "#/components/schemas/BLOCK_HASH" + "$ref": "#/components/schemas/BLOCK_ID" } } ], diff --git a/crates/papyrus_rpc/resources/V0_5/starknet_trace_api_openrpc.json b/crates/papyrus_rpc/resources/V0_5/starknet_trace_api_openrpc.json index 6f1c41fd92..8443d4407c 100644 --- a/crates/papyrus_rpc/resources/V0_5/starknet_trace_api_openrpc.json +++ b/crates/papyrus_rpc/resources/V0_5/starknet_trace_api_openrpc.json @@ -455,10 +455,10 @@ "$ref": "./starknet_api_openrpc.json#/components/schemas/FEE_ESTIMATE" }, "BROADCASTED_TXN": { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN" + "$ref": "./starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN" }, "STATE_DIFF": { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/STATE_DIFF" + "$ref": "./starknet_api_openrpc.json#/components/schemas/STATE_DIFF" } }, "errors": { diff --git a/crates/papyrus_rpc/resources/V0_6/starknet_trace_api_openrpc.json b/crates/papyrus_rpc/resources/V0_6/starknet_trace_api_openrpc.json index 5125dd46cc..f08efd0472 100644 --- a/crates/papyrus_rpc/resources/V0_6/starknet_trace_api_openrpc.json +++ b/crates/papyrus_rpc/resources/V0_6/starknet_trace_api_openrpc.json @@ -453,13 +453,13 @@ "$ref": "./starknet_api_openrpc.json#/components/schemas/FEE_ESTIMATE" }, "BROADCASTED_TXN": { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN" + "$ref": "./starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN" }, "STATE_DIFF": { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/STATE_DIFF" + "$ref": "./starknet_api_openrpc.json#/components/schemas/STATE_DIFF" }, "EXECUTION_RESOURCES": { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/EXECUTION_RESOURCES" + "$ref": "./starknet_api_openrpc.json#/components/schemas/EXECUTION_RESOURCES" } }, "errors": { diff --git a/crates/papyrus_rpc/src/test_utils.rs b/crates/papyrus_rpc/src/test_utils.rs index 4f73e95822..0c1de41dbc 100644 --- a/crates/papyrus_rpc/src/test_utils.rs +++ b/crates/papyrus_rpc/src/test_utils.rs @@ -341,13 +341,11 @@ fn fix_errors(spec: &mut serde_json::Value) { } } -#[allow(dead_code)] pub fn method_name_to_spec_method_name(method_name: &str) -> String { let re = Regex::new((VERSION_PATTERN.to_string() + "_").as_str()).unwrap(); re.replace_all(method_name, "").to_string() } -#[allow(dead_code)] pub async fn call_api_then_assert_and_validate_schema_for_err< R: JsonRpcServerImpl, T: for<'a> Deserialize<'a> + std::fmt::Debug, @@ -383,7 +381,6 @@ pub async fn call_api_then_assert_and_validate_schema_for_err< ); } -#[allow(dead_code)] pub async fn call_api_then_assert_and_validate_schema_for_result< R: JsonRpcServerImpl, T: for<'a> Deserialize<'a> + std::fmt::Debug + std::cmp::PartialEq, @@ -395,10 +392,26 @@ pub async fn call_api_then_assert_and_validate_schema_for_result< spec_file: SpecFile, expected_res: &T, ) { + assert_eq!( + call_and_validate_schema_for_result::<_, T>(module, method, params, version_id, spec_file) + .await, + *expected_res + ); +} + +pub async fn call_and_validate_schema_for_result< + R: JsonRpcServerImpl, + T: for<'a> Deserialize<'a> + std::fmt::Debug, +>( + module: &RpcModule, + method: &str, + params: Vec>, + version_id: &VersionId, + spec_file: SpecFile, +) -> T { validate_schema_for_method_params(method, ¶ms, version_id, spec_file); let params = params_vec_to_named_params(method, params, version_id, spec_file); let (json_response, res) = raw_call::<_, _, T>(module, method, ¶ms).await; - assert_eq!(res.unwrap(), *expected_res); assert!( validate_schema( &get_starknet_spec_api_schema_for_method_results( @@ -417,6 +430,7 @@ pub async fn call_api_then_assert_and_validate_schema_for_result< ) .unwrap(), ); + res.unwrap() } pub fn get_method_names_from_spec(version_id: &VersionId) -> Vec { diff --git a/crates/papyrus_rpc/src/v0_4/api/mod.rs b/crates/papyrus_rpc/src/v0_4/api/mod.rs index 5935463feb..431096b6b7 100644 --- a/crates/papyrus_rpc/src/v0_4/api/mod.rs +++ b/crates/papyrus_rpc/src/v0_4/api/mod.rs @@ -194,7 +194,7 @@ pub trait JsonRpc { #[method(name = "estimateFee")] async fn estimate_fee( &self, - transactions: Vec, + request: Vec, block_id: BlockId, ) -> RpcResult>; diff --git a/crates/papyrus_rpc/src/v0_4/execution_test.rs b/crates/papyrus_rpc/src/v0_4/execution_test.rs index c49e3866cf..0103c2d915 100644 --- a/crates/papyrus_rpc/src/v0_4/execution_test.rs +++ b/crates/papyrus_rpc/src/v0_4/execution_test.rs @@ -104,6 +104,7 @@ use super::transaction::{ }; use crate::api::{BlockHashOrNumber, BlockId, CallRequest, Tag}; use crate::test_utils::{ + call_and_validate_schema_for_result, call_api_then_assert_and_validate_schema_for_result, get_starknet_spec_api_schema_for_components, get_starknet_spec_api_schema_for_method_results, @@ -340,18 +341,18 @@ async fn call_estimate_fee() { ..Default::default() })); - let res = module - .call::<_, Vec>( - "starknet_V0_4_estimateFee", - ( - vec![invoke.clone()], - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - ), - ) - .await - .unwrap(); - - assert_eq!(res, vec![EXPECTED_FEE_ESTIMATE.clone()]); + call_api_then_assert_and_validate_schema_for_result( + &module, + "starknet_V0_4_estimateFee", + vec![ + Box::new(vec![invoke.clone()]), + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + ], + &VERSION_0_4, + SpecFile::StarknetApiOpenrpc, + &vec![EXPECTED_FEE_ESTIMATE.clone()], + ) + .await; // Test that calling the same transaction with a different block context with a different gas // price produces a different fee. @@ -461,13 +462,14 @@ async fn test_call_simulate( }; let invoke = BroadcastedTransaction::Invoke(InvokeTransaction::Version1(invoke_v1.clone())); - let mut res = module - .call::<_, Vec>( - "starknet_V0_4_simulateTransactions", - (block_id, vec![invoke], Vec::::new()), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + module, + "starknet_V0_4_simulateTransactions", + vec![Box::new(block_id), Box::new(vec![invoke]), Box::>::default()], + &VERSION_0_4, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -542,17 +544,18 @@ async fn call_simulate_skip_validate() { ..Default::default() })); - let mut res = module - .call::<_, Vec>( - "starknet_V0_4_simulateTransactions", - ( - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - vec![invoke], - vec![SimulationFlag::SkipValidate], - ), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_4_simulateTransactions", + vec![ + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + Box::new(vec![invoke]), + Box::new(vec![SimulationFlag::SkipValidate]), + ], + &VERSION_0_4, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -591,17 +594,18 @@ async fn call_simulate_skip_fee_charge() { ..Default::default() })); - let mut res = module - .call::<_, Vec>( - "starknet_V0_4_simulateTransactions", - ( - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - vec![invoke], - vec![SimulationFlag::SkipFeeCharge], - ), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_4_simulateTransactions", + vec![ + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + Box::new(vec![invoke]), + Box::new(vec![SimulationFlag::SkipFeeCharge]), + ], + &VERSION_0_4, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -698,10 +702,14 @@ async fn trace_block_transactions_regular_and_pending() { .commit() .unwrap(); - let tx_1_trace = module - .call::<_, TransactionTrace>("starknet_V0_4_traceTransaction", [tx_hash1]) - .await - .unwrap(); + let tx_1_trace = call_and_validate_schema_for_result::<_, TransactionTrace>( + &module, + "starknet_V0_4_traceTransaction", + vec![Box::new(tx_hash1)], + &VERSION_0_4, + SpecFile::TraceApi, + ) + .await; assert_matches!(tx_1_trace, TransactionTrace::Invoke(_)); @@ -712,13 +720,14 @@ async fn trace_block_transactions_regular_and_pending() { assert_matches!(tx_2_trace, TransactionTrace::Invoke(_)); - let res = module - .call::<_, Vec>( - "starknet_V0_4_traceBlockTransactions", - [BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(2)))], - ) - .await - .unwrap(); + let res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_4_traceBlockTransactions", + vec![Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(2))))], + &VERSION_0_4, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 2); assert_eq!(res[0].trace_root, tx_1_trace); diff --git a/crates/papyrus_rpc/src/v0_5/api/mod.rs b/crates/papyrus_rpc/src/v0_5/api/mod.rs index b8ecfdbab5..db3cee7acc 100644 --- a/crates/papyrus_rpc/src/v0_5/api/mod.rs +++ b/crates/papyrus_rpc/src/v0_5/api/mod.rs @@ -200,7 +200,7 @@ pub trait JsonRpc { #[method(name = "estimateFee")] async fn estimate_fee( &self, - transactions: Vec, + request: Vec, block_id: BlockId, ) -> RpcResult>; diff --git a/crates/papyrus_rpc/src/v0_5/execution_test.rs b/crates/papyrus_rpc/src/v0_5/execution_test.rs index 0a503411d1..e639ce8131 100644 --- a/crates/papyrus_rpc/src/v0_5/execution_test.rs +++ b/crates/papyrus_rpc/src/v0_5/execution_test.rs @@ -92,6 +92,7 @@ use super::transaction::{ }; use crate::api::{BlockHashOrNumber, BlockId, CallRequest, Tag}; use crate::test_utils::{ + call_and_validate_schema_for_result, call_api_then_assert_and_validate_schema_for_result, get_starknet_spec_api_schema_for_components, get_starknet_spec_api_schema_for_method_results, @@ -327,18 +328,18 @@ async fn call_estimate_fee() { ..Default::default() })); - let res = module - .call::<_, Vec>( - "starknet_V0_5_estimateFee", - ( - vec![invoke.clone()], - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - ), - ) - .await - .unwrap(); - - assert_eq!(res, vec![EXPECTED_FEE_ESTIMATE.clone()]); + call_api_then_assert_and_validate_schema_for_result( + &module, + "starknet_V0_5_estimateFee", + vec![ + Box::new(vec![invoke.clone()]), + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + ], + &VERSION_0_5, + SpecFile::StarknetApiOpenrpc, + &vec![EXPECTED_FEE_ESTIMATE.clone()], + ) + .await; // Test that calling the same transaction with a different block context with a different gas // price produces a different fee. @@ -447,13 +448,14 @@ async fn test_call_simulate( }; let invoke = BroadcastedTransaction::Invoke(InvokeTransaction::Version1(invoke_v1.clone())); - let mut res = module - .call::<_, Vec>( - "starknet_V0_5_simulateTransactions", - (block_id, vec![invoke], Vec::::new()), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + module, + "starknet_V0_5_simulateTransactions", + vec![Box::new(block_id), Box::new(vec![invoke]), Box::>::default()], + &VERSION_0_5, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -527,17 +529,18 @@ async fn call_simulate_skip_validate() { ..Default::default() })); - let mut res = module - .call::<_, Vec>( - "starknet_V0_5_simulateTransactions", - ( - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - vec![invoke], - vec![SimulationFlag::SkipValidate], - ), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_5_simulateTransactions", + vec![ + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + Box::new(vec![invoke]), + Box::new(vec![SimulationFlag::SkipValidate]), + ], + &VERSION_0_5, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -575,17 +578,18 @@ async fn call_simulate_skip_fee_charge() { ..Default::default() })); - let mut res = module - .call::<_, Vec>( - "starknet_V0_5_simulateTransactions", - ( - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - vec![invoke], - vec![SimulationFlag::SkipFeeCharge], - ), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_5_simulateTransactions", + vec![ + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + Box::new(vec![invoke]), + Box::new(vec![SimulationFlag::SkipFeeCharge]), + ], + &VERSION_0_5, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -681,10 +685,14 @@ async fn trace_block_transactions_regular_and_pending() { .commit() .unwrap(); - let tx_1_trace = module - .call::<_, TransactionTrace>("starknet_V0_5_traceTransaction", [tx_hash1]) - .await - .unwrap(); + let tx_1_trace = call_and_validate_schema_for_result::<_, TransactionTrace>( + &module, + "starknet_V0_5_traceTransaction", + vec![Box::new(tx_hash1)], + &VERSION_0_5, + SpecFile::TraceApi, + ) + .await; assert_matches!(tx_1_trace, TransactionTrace::Invoke(_)); @@ -695,13 +703,14 @@ async fn trace_block_transactions_regular_and_pending() { assert_matches!(tx_2_trace, TransactionTrace::Invoke(_)); - let res = module - .call::<_, Vec>( - "starknet_V0_5_traceBlockTransactions", - [BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(2)))], - ) - .await - .unwrap(); + let res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_5_traceBlockTransactions", + vec![Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(2))))], + &VERSION_0_5, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 2); assert_eq!(res[0].trace_root, tx_1_trace); diff --git a/crates/papyrus_rpc/src/v0_6/api/api_impl.rs b/crates/papyrus_rpc/src/v0_6/api/api_impl.rs index 79bfc2f73e..83b38a2626 100644 --- a/crates/papyrus_rpc/src/v0_6/api/api_impl.rs +++ b/crates/papyrus_rpc/src/v0_6/api/api_impl.rs @@ -978,8 +978,8 @@ impl JsonRpcServer for JsonRpcServerV0_6Impl { async fn estimate_fee( &self, transactions: Vec, - block_id: BlockId, simulation_flags: Vec, + block_id: BlockId, ) -> RpcResult> { trace!("Estimating fee of transactions: {:#?}", transactions); let validate = !simulation_flags.contains(&SimulationFlag::SkipValidate); diff --git a/crates/papyrus_rpc/src/v0_6/api/mod.rs b/crates/papyrus_rpc/src/v0_6/api/mod.rs index 6f70ed4987..ebcd20627e 100644 --- a/crates/papyrus_rpc/src/v0_6/api/mod.rs +++ b/crates/papyrus_rpc/src/v0_6/api/mod.rs @@ -208,9 +208,9 @@ pub trait JsonRpc { #[method(name = "estimateFee")] async fn estimate_fee( &self, - transactions: Vec, - block_id: BlockId, + request: Vec, simulation_flags: Vec, + block_id: BlockId, ) -> RpcResult>; /// Estimates the fee of a message from L1. diff --git a/crates/papyrus_rpc/src/v0_6/execution_test.rs b/crates/papyrus_rpc/src/v0_6/execution_test.rs index 14419f83b1..6f46491efb 100644 --- a/crates/papyrus_rpc/src/v0_6/execution_test.rs +++ b/crates/papyrus_rpc/src/v0_6/execution_test.rs @@ -93,6 +93,7 @@ use super::transaction::{ }; use crate::api::{BlockHashOrNumber, BlockId, CallRequest, Tag}; use crate::test_utils::{ + call_and_validate_schema_for_result, call_api_then_assert_and_validate_schema_for_result, get_starknet_spec_api_schema_for_components, get_starknet_spec_api_schema_for_method_results, @@ -329,19 +330,19 @@ async fn call_estimate_fee() { ..Default::default() })); - let res = module - .call::<_, Vec>( - "starknet_V0_6_estimateFee", - ( - vec![invoke.clone()], - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - Vec::::new(), - ), - ) - .await - .unwrap(); - - assert_eq!(res, vec![EXPECTED_FEE_ESTIMATE.clone()]); + call_api_then_assert_and_validate_schema_for_result( + &module, + "starknet_V0_6_estimateFee", + vec![ + Box::new(vec![invoke.clone()]), + Box::>::default(), + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + ], + &VERSION, + SpecFile::StarknetApiOpenrpc, + &vec![EXPECTED_FEE_ESTIMATE.clone()], + ) + .await; // Test that calling the same transaction with a different block context with a different gas // price produces a different fee. @@ -350,8 +351,8 @@ async fn call_estimate_fee() { "starknet_V0_6_estimateFee", ( vec![invoke.clone()], - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(1))), Vec::::new(), + BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(1))), ), ) .await @@ -365,8 +366,8 @@ async fn call_estimate_fee() { "starknet_V0_6_estimateFee", ( vec![invoke], - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), Vec::::from([SimulationFlag::SkipValidate]), + BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), ), ) .await @@ -392,8 +393,8 @@ async fn call_estimate_fee() { "starknet_V0_6_estimateFee", ( vec![non_existent_entry_point], - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), Vec::::new(), + BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), ), ) .await @@ -443,7 +444,7 @@ async fn pending_call_estimate_fee() { let res = module .call::<_, Vec>( "starknet_V0_6_estimateFee", - (vec![invoke.clone()], BlockId::Tag(Tag::Pending), Vec::::new()), + (vec![invoke.clone()], Vec::::new(), BlockId::Tag(Tag::Pending)), ) .await .unwrap(); @@ -504,13 +505,14 @@ async fn test_call_simulate( }; let invoke = BroadcastedTransaction::Invoke(InvokeTransaction::Version1(invoke_v1.clone())); - let mut res = module - .call::<_, Vec>( - "starknet_V0_6_simulateTransactions", - (block_id, vec![invoke], Vec::::new()), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + module, + "starknet_V0_6_simulateTransactions", + vec![Box::new(block_id), Box::new(vec![invoke]), Box::>::default()], + &VERSION, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -584,17 +586,18 @@ async fn call_simulate_skip_validate() { ..Default::default() })); - let mut res = module - .call::<_, Vec>( - "starknet_V0_6_simulateTransactions", - ( - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - vec![invoke], - vec![SimulationFlag::SkipValidate], - ), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_6_simulateTransactions", + vec![ + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + Box::new(vec![invoke]), + Box::new(vec![SimulationFlag::SkipValidate]), + ], + &VERSION, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -632,17 +635,18 @@ async fn call_simulate_skip_fee_charge() { ..Default::default() })); - let mut res = module - .call::<_, Vec>( - "starknet_V0_6_simulateTransactions", - ( - BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0))), - vec![invoke], - vec![SimulationFlag::SkipFeeCharge], - ), - ) - .await - .unwrap(); + let mut res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_6_simulateTransactions", + vec![ + Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(0)))), + Box::new(vec![invoke]), + Box::new(vec![SimulationFlag::SkipFeeCharge]), + ], + &VERSION, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 1); @@ -738,10 +742,14 @@ async fn trace_block_transactions_regular_and_pending() { .commit() .unwrap(); - let tx_1_trace = module - .call::<_, TransactionTrace>("starknet_V0_6_traceTransaction", [tx_hash1]) - .await - .unwrap(); + let tx_1_trace = call_and_validate_schema_for_result::<_, TransactionTrace>( + &module, + "starknet_V0_6_traceTransaction", + vec![Box::new(tx_hash1)], + &VERSION, + SpecFile::TraceApi, + ) + .await; assert_matches!(tx_1_trace, TransactionTrace::Invoke(_)); @@ -752,13 +760,14 @@ async fn trace_block_transactions_regular_and_pending() { assert_matches!(tx_2_trace, TransactionTrace::Invoke(_)); - let res = module - .call::<_, Vec>( - "starknet_V0_6_traceBlockTransactions", - [BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(2)))], - ) - .await - .unwrap(); + let res = call_and_validate_schema_for_result::<_, Vec>( + &module, + "starknet_V0_6_traceBlockTransactions", + vec![Box::new(BlockId::HashOrNumber(BlockHashOrNumber::Number(BlockNumber(2))))], + &VERSION, + SpecFile::TraceApi, + ) + .await; assert_eq!(res.len(), 2); assert_eq!(res[0].trace_root, tx_1_trace);