Remove native call (#12201)

* Remove native call

With the recent introduction of staging runtime apis the native call wasn't supported anymore. This
removes the entire support for this as it is not used anymore.

* FMT

* Fix benchmarks

* FIX ui tests
This commit is contained in:
Bastian Köcher
2022-09-12 11:25:56 +01:00
committed by GitHub
parent 5647e71947
commit b356a5589a
17 changed files with 211 additions and 705 deletions
+8 -51
View File
@@ -26,7 +26,6 @@ use kitchensink_runtime::{
};
use node_primitives::Balance;
use node_testing::keyring::*;
use sp_core::NeverNativeValue;
use sp_runtime::{traits::One, Perbill};
pub mod common;
@@ -94,15 +93,7 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
);
// execute a big block.
executor_call::<NeverNativeValue, fn() -> _>(
&mut t,
"Core_execute_block",
&block1.0,
true,
None,
)
.0
.unwrap();
executor_call(&mut t, "Core_execute_block", &block1.0, true).0.unwrap();
// weight multiplier is increased for next block.
t.execute_with(|| {
@@ -113,15 +104,7 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
});
// execute a big block.
executor_call::<NeverNativeValue, fn() -> _>(
&mut t,
"Core_execute_block",
&block2.0,
true,
None,
)
.0
.unwrap();
executor_call(&mut t, "Core_execute_block", &block2.0, true).0.unwrap();
// weight multiplier is increased for next block.
t.execute_with(|| {
@@ -166,24 +149,12 @@ fn transaction_fee_is_correct() {
function: Call::Balances(default_transfer_call()),
});
let r = executor_call::<NeverNativeValue, fn() -> _>(
&mut t,
"Core_initialize_block",
&vec![].and(&from_block_number(1u32)),
true,
None,
)
.0;
let r =
executor_call(&mut t, "Core_initialize_block", &vec![].and(&from_block_number(1u32)), true)
.0;
assert!(r.is_ok());
let r = executor_call::<NeverNativeValue, fn() -> _>(
&mut t,
"BlockBuilder_apply_extrinsic",
&vec![].and(&xt.clone()),
true,
None,
)
.0;
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt.clone()), true).0;
assert!(r.is_ok());
t.execute_with(|| {
@@ -274,14 +245,7 @@ fn block_weight_capacity_report() {
len / 1024 / 1024,
);
let r = executor_call::<NeverNativeValue, fn() -> _>(
&mut t,
"Core_execute_block",
&block.0,
true,
None,
)
.0;
let r = executor_call(&mut t, "Core_execute_block", &block.0, true).0;
println!(" || Result = {:?}", r);
assert!(r.is_ok());
@@ -342,14 +306,7 @@ fn block_length_capacity_report() {
len / 1024 / 1024,
);
let r = executor_call::<NeverNativeValue, fn() -> _>(
&mut t,
"Core_execute_block",
&block.0,
true,
None,
)
.0;
let r = executor_call(&mut t, "Core_execute_block", &block.0, true).0;
println!(" || Result = {:?}", r);
assert!(r.is_ok());