mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-31 16:09:52 +00:00
Fix sp-api handling of multiple arguments (#6484)
With the switch to `decode_all_with_depth_limit` we silently broken support for functions with multiple arguments. The old generated code tried to decode each parameter separately, which does not play well with `decode_all`. This pr adds a test to ensure that this does not happen again and fixes the bug by decoding everything at once by wrapping it into tuples.
This commit is contained in:
1 parent
63793c8b97
commit
6647a42a67
3 files changed
+35
-11
No files matched your search
@@ -207,3 +207,14 @@ fn record_proof_works() {
|
||||
&runtime_code,
|
||||
).expect("Executes block while using the proof backend");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn call_runtime_api_with_multiple_arguments() {
|
||||
let client = TestClientBuilder::new().set_execution_strategy(ExecutionStrategy::Both).build();
|
||||
|
||||
let data = vec![1, 2, 4, 5, 6, 7, 8, 8, 10, 12];
|
||||
let block_id = BlockId::Number(client.chain_info().best_number);
|
||||
client.runtime_api()
|
||||
.test_multiple_arguments(&block_id, data.clone(), data.clone(), data.len() as u32)
|
||||
.unwrap();
|
||||
}
|
||||
Reference in new issue
Block a user