mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Improve CodeExecutor (#2358)
Since `sp-state-machine` and `GenesisConfigBuilderRuntimeCaller` always set `use_native` to be false. We should remove this param and make `NativeElseWasmExecutor` behave like its name. It could make the above components use the correct execution strategy. Maybe polkadot do not need about `NativeElseWasmExecutor` anymore. But it is still needed by other chains and it's useful for debugging. --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <> Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
This commit is contained in:
@@ -95,7 +95,7 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
|
||||
);
|
||||
|
||||
// execute a big block.
|
||||
executor_call(&mut t, "Core_execute_block", &block1.0, true).0.unwrap();
|
||||
executor_call(&mut t, "Core_execute_block", &block1.0).0.unwrap();
|
||||
|
||||
// weight multiplier is increased for next block.
|
||||
t.execute_with(|| {
|
||||
@@ -106,7 +106,7 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
|
||||
});
|
||||
|
||||
// execute a big block.
|
||||
executor_call(&mut t, "Core_execute_block", &block2.0, true).0.unwrap();
|
||||
executor_call(&mut t, "Core_execute_block", &block2.0).0.unwrap();
|
||||
|
||||
// weight multiplier is increased for next block.
|
||||
t.execute_with(|| {
|
||||
@@ -151,12 +151,10 @@ fn transaction_fee_is_correct() {
|
||||
function: RuntimeCall::Balances(default_transfer_call()),
|
||||
});
|
||||
|
||||
let r =
|
||||
executor_call(&mut t, "Core_initialize_block", &vec![].and(&from_block_number(1u32)), true)
|
||||
.0;
|
||||
let r = executor_call(&mut t, "Core_initialize_block", &vec![].and(&from_block_number(1u32))).0;
|
||||
|
||||
assert!(r.is_ok());
|
||||
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt.clone()), true).0;
|
||||
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt.clone())).0;
|
||||
assert!(r.is_ok());
|
||||
|
||||
t.execute_with(|| {
|
||||
@@ -247,7 +245,7 @@ fn block_weight_capacity_report() {
|
||||
len / 1024 / 1024,
|
||||
);
|
||||
|
||||
let r = executor_call(&mut t, "Core_execute_block", &block.0, true).0;
|
||||
let r = executor_call(&mut t, "Core_execute_block", &block.0).0;
|
||||
|
||||
println!(" || Result = {:?}", r);
|
||||
assert!(r.is_ok());
|
||||
@@ -310,7 +308,7 @@ fn block_length_capacity_report() {
|
||||
len / 1024 / 1024,
|
||||
);
|
||||
|
||||
let r = executor_call(&mut t, "Core_execute_block", &block.0, true).0;
|
||||
let r = executor_call(&mut t, "Core_execute_block", &block.0).0;
|
||||
|
||||
println!(" || Result = {:?}", r);
|
||||
assert!(r.is_ok());
|
||||
|
||||
Reference in New Issue
Block a user