mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
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:
@@ -31,7 +31,6 @@ use sc_executor::{Externalities, NativeElseWasmExecutor, RuntimeVersionOf, WasmE
|
||||
use sp_core::{
|
||||
storage::well_known_keys,
|
||||
traits::{CodeExecutor, RuntimeCode},
|
||||
NativeOrEncoded, NeverNativeValue,
|
||||
};
|
||||
use sp_runtime::traits::BlakeTwo256;
|
||||
use sp_state_machine::TestExternalities as CoreTestExternalities;
|
||||
@@ -112,46 +111,24 @@ fn construct_block<E: Externalities>(
|
||||
|
||||
// execute the block to get the real header.
|
||||
executor
|
||||
.call::<NeverNativeValue, fn() -> _>(
|
||||
ext,
|
||||
&runtime_code,
|
||||
"Core_initialize_block",
|
||||
&header.encode(),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.call(ext, &runtime_code, "Core_initialize_block", &header.encode(), true)
|
||||
.0
|
||||
.unwrap();
|
||||
|
||||
for i in extrinsics.iter() {
|
||||
executor
|
||||
.call::<NeverNativeValue, fn() -> _>(
|
||||
ext,
|
||||
&runtime_code,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&i.encode(),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.call(ext, &runtime_code, "BlockBuilder_apply_extrinsic", &i.encode(), true)
|
||||
.0
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
let header = match executor
|
||||
.call::<NeverNativeValue, fn() -> _>(
|
||||
ext,
|
||||
&runtime_code,
|
||||
"BlockBuilder_finalize_block",
|
||||
&[0u8; 0],
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap()
|
||||
{
|
||||
NativeOrEncoded::Native(_) => unreachable!(),
|
||||
NativeOrEncoded::Encoded(h) => Header::decode(&mut &h[..]).unwrap(),
|
||||
};
|
||||
let header = Header::decode(
|
||||
&mut &executor
|
||||
.call(ext, &runtime_code, "BlockBuilder_finalize_block", &[0u8; 0], true)
|
||||
.0
|
||||
.unwrap()[..],
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let hash = header.blake2_256();
|
||||
(Block { header, extrinsics }.encode(), hash.into())
|
||||
@@ -218,13 +195,12 @@ fn bench_execute_block(c: &mut Criterion) {
|
||||
|test_ext| {
|
||||
for block in blocks.iter() {
|
||||
executor
|
||||
.call::<NeverNativeValue, fn() -> _>(
|
||||
.call(
|
||||
&mut test_ext.ext(),
|
||||
&runtime_code,
|
||||
"Core_execute_block",
|
||||
&block.0,
|
||||
use_native,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
|
||||
@@ -21,7 +21,7 @@ use frame_support::{
|
||||
weights::{DispatchClass, DispatchInfo, GetDispatchInfo, Weight},
|
||||
};
|
||||
use frame_system::{self, AccountInfo, EventRecord, Phase};
|
||||
use sp_core::{storage::well_known_keys, traits::Externalities, NeverNativeValue};
|
||||
use sp_core::{storage::well_known_keys, traits::Externalities};
|
||||
use sp_runtime::{
|
||||
traits::Hash as HashT, transaction_validity::InvalidTransaction, ApplyExtrinsicResult,
|
||||
};
|
||||
@@ -187,25 +187,14 @@ fn panic_execution_with_foreign_code_gives_error() {
|
||||
t.insert(<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec(), 69_u128.encode());
|
||||
t.insert(<frame_system::BlockHash<Runtime>>::hashed_key_for(0), vec![0u8; 32]);
|
||||
|
||||
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 v = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&vec![].and(&xt()),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
let r = ApplyExtrinsicResult::decode(&mut &v.as_encoded()[..]).unwrap();
|
||||
let v = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt()), true)
|
||||
.0
|
||||
.unwrap();
|
||||
let r = ApplyExtrinsicResult::decode(&mut &v[..]).unwrap();
|
||||
assert_eq!(r, Err(InvalidTransaction::Payment.into()));
|
||||
}
|
||||
|
||||
@@ -219,25 +208,14 @@ fn bad_extrinsic_with_native_equivalent_code_gives_error() {
|
||||
t.insert(<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec(), 69_u128.encode());
|
||||
t.insert(<frame_system::BlockHash<Runtime>>::hashed_key_for(0), vec![0u8; 32]);
|
||||
|
||||
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 v = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&vec![].and(&xt()),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
let r = ApplyExtrinsicResult::decode(&mut &v.as_encoded()[..]).unwrap();
|
||||
let v = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt()), true)
|
||||
.0
|
||||
.unwrap();
|
||||
let r = ApplyExtrinsicResult::decode(&mut &v[..]).unwrap();
|
||||
assert_eq!(r, Err(InvalidTransaction::Payment.into()));
|
||||
}
|
||||
|
||||
@@ -266,26 +244,14 @@ fn successful_execution_with_native_equivalent_code_gives_ok() {
|
||||
);
|
||||
t.insert(<frame_system::BlockHash<Runtime>>::hashed_key_for(0), vec![0u8; 32]);
|
||||
|
||||
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 fees = t.execute_with(|| transfer_fee(&xt()));
|
||||
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&vec![].and(&xt()),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0;
|
||||
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt()), true).0;
|
||||
assert!(r.is_ok());
|
||||
|
||||
t.execute_with(|| {
|
||||
@@ -319,26 +285,14 @@ fn successful_execution_with_foreign_code_gives_ok() {
|
||||
);
|
||||
t.insert(<frame_system::BlockHash<Runtime>>::hashed_key_for(0), vec![0u8; 32]);
|
||||
|
||||
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 fees = t.execute_with(|| transfer_fee(&xt()));
|
||||
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&vec![].and(&xt()),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0;
|
||||
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt()), true).0;
|
||||
assert!(r.is_ok());
|
||||
|
||||
t.execute_with(|| {
|
||||
@@ -361,15 +315,7 @@ fn full_native_block_import_works() {
|
||||
.get_dispatch_info()
|
||||
.weight;
|
||||
|
||||
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();
|
||||
|
||||
t.execute_with(|| {
|
||||
assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
|
||||
@@ -441,15 +387,7 @@ fn full_native_block_import_works() {
|
||||
|
||||
fees = t.execute_with(|| transfer_fee(&xt()));
|
||||
|
||||
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();
|
||||
|
||||
t.execute_with(|| {
|
||||
assert_eq!(
|
||||
@@ -579,15 +517,7 @@ fn full_wasm_block_import_works() {
|
||||
let mut alice_last_known_balance: Balance = Default::default();
|
||||
let mut fees = t.execute_with(|| transfer_fee(&xt()));
|
||||
|
||||
executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"Core_execute_block",
|
||||
&block1.0,
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
executor_call(&mut t, "Core_execute_block", &block1.0, false).0.unwrap();
|
||||
|
||||
t.execute_with(|| {
|
||||
assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
|
||||
@@ -597,15 +527,7 @@ fn full_wasm_block_import_works() {
|
||||
|
||||
fees = t.execute_with(|| transfer_fee(&xt()));
|
||||
|
||||
executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"Core_execute_block",
|
||||
&block2.0,
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
executor_call(&mut t, "Core_execute_block", &block2.0, false).0.unwrap();
|
||||
|
||||
t.execute_with(|| {
|
||||
assert_eq!(
|
||||
@@ -757,9 +679,7 @@ fn deploying_wasm_contract_should_work() {
|
||||
|
||||
let mut t = new_test_ext(compact_code_unwrap());
|
||||
|
||||
executor_call::<NeverNativeValue, fn() -> _>(&mut t, "Core_execute_block", &b.0, false, None)
|
||||
.0
|
||||
.unwrap();
|
||||
executor_call(&mut t, "Core_execute_block", &b.0, false).0.unwrap();
|
||||
|
||||
t.execute_with(|| {
|
||||
// Verify that the contract does exist by querying some of its storage items
|
||||
@@ -778,14 +698,8 @@ fn wasm_big_block_import_fails() {
|
||||
|
||||
set_heap_pages(&mut t.ext(), 4);
|
||||
|
||||
let result = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"Core_execute_block",
|
||||
&block_with_size(42, 0, 120_000).0,
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0;
|
||||
let result =
|
||||
executor_call(&mut t, "Core_execute_block", &block_with_size(42, 0, 120_000).0, false).0;
|
||||
assert!(result.is_err()); // Err(Wasmi(Trap(Trap { kind: Host(AllocatorOutOfSpace) })))
|
||||
}
|
||||
|
||||
@@ -793,15 +707,9 @@ fn wasm_big_block_import_fails() {
|
||||
fn native_big_block_import_succeeds() {
|
||||
let mut t = new_test_ext(compact_code_unwrap());
|
||||
|
||||
executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"Core_execute_block",
|
||||
&block_with_size(42, 0, 120_000).0,
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
executor_call(&mut t, "Core_execute_block", &block_with_size(42, 0, 120_000).0, true)
|
||||
.0
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -812,15 +720,11 @@ fn native_big_block_import_fails_on_fallback() {
|
||||
// block.
|
||||
set_heap_pages(&mut t.ext(), 8);
|
||||
|
||||
assert!(executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"Core_execute_block",
|
||||
&block_with_size(42, 0, 120_000).0,
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.is_err());
|
||||
assert!(
|
||||
executor_call(&mut t, "Core_execute_block", &block_with_size(42, 0, 120_000).0, false,)
|
||||
.0
|
||||
.is_err()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -837,25 +741,17 @@ fn panic_execution_gives_error() {
|
||||
t.insert(<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec(), 0_u128.encode());
|
||||
t.insert(<frame_system::BlockHash<Runtime>>::hashed_key_for(0), vec![0u8; 32]);
|
||||
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
let r = executor_call(
|
||||
&mut t,
|
||||
"Core_initialize_block",
|
||||
&vec![].and(&from_block_number(1u32)),
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0;
|
||||
assert!(r.is_ok());
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&vec![].and(&xt()),
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap()
|
||||
.into_encoded();
|
||||
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt()), false)
|
||||
.0
|
||||
.unwrap();
|
||||
let r = ApplyExtrinsicResult::decode(&mut &r[..]).unwrap();
|
||||
assert_eq!(r, Err(InvalidTransaction::Payment.into()));
|
||||
}
|
||||
@@ -885,12 +781,11 @@ fn successful_execution_gives_ok() {
|
||||
);
|
||||
t.insert(<frame_system::BlockHash<Runtime>>::hashed_key_for(0), vec![0u8; 32]);
|
||||
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
let r = executor_call(
|
||||
&mut t,
|
||||
"Core_initialize_block",
|
||||
&vec![].and(&from_block_number(1u32)),
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0;
|
||||
assert!(r.is_ok());
|
||||
@@ -900,16 +795,9 @@ fn successful_execution_gives_ok() {
|
||||
|
||||
let fees = t.execute_with(|| transfer_fee(&xt()));
|
||||
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
&mut t,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&vec![].and(&xt()),
|
||||
false,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap()
|
||||
.into_encoded();
|
||||
let r = executor_call(&mut t, "BlockBuilder_apply_extrinsic", &vec![].and(&xt()), false)
|
||||
.0
|
||||
.unwrap();
|
||||
ApplyExtrinsicResult::decode(&mut &r[..])
|
||||
.unwrap()
|
||||
.expect("Extrinsic could not be applied")
|
||||
|
||||
@@ -27,7 +27,6 @@ use sp_core::{
|
||||
crypto::KeyTypeId,
|
||||
sr25519::Signature,
|
||||
traits::{CodeExecutor, RuntimeCode},
|
||||
NativeOrEncoded, NeverNativeValue,
|
||||
};
|
||||
use sp_runtime::{
|
||||
traits::{BlakeTwo256, Header as HeaderT},
|
||||
@@ -99,17 +98,12 @@ pub fn executor() -> NativeElseWasmExecutor<ExecutorDispatch> {
|
||||
NativeElseWasmExecutor::new(WasmExecutionMethod::Interpreted, None, 8, 2)
|
||||
}
|
||||
|
||||
pub fn executor_call<
|
||||
R: Decode + Encode + PartialEq,
|
||||
NC: FnOnce() -> std::result::Result<R, Box<dyn std::error::Error + Send + Sync>>
|
||||
+ std::panic::UnwindSafe,
|
||||
>(
|
||||
pub fn executor_call(
|
||||
t: &mut TestExternalities<BlakeTwo256>,
|
||||
method: &str,
|
||||
data: &[u8],
|
||||
use_native: bool,
|
||||
native_call: Option<NC>,
|
||||
) -> (Result<NativeOrEncoded<R>>, bool) {
|
||||
) -> (Result<Vec<u8>>, bool) {
|
||||
let mut t = t.ext();
|
||||
|
||||
let code = t.storage(sp_core::storage::well_known_keys::CODE).unwrap();
|
||||
@@ -120,7 +114,7 @@ pub fn executor_call<
|
||||
heap_pages: heap_pages.and_then(|hp| Decode::decode(&mut &hp[..]).ok()),
|
||||
};
|
||||
sp_tracing::try_init_simple();
|
||||
executor().call::<R, NC>(&mut t, &runtime_code, method, data, use_native, native_call)
|
||||
executor().call(&mut t, &runtime_code, method, data, use_native)
|
||||
}
|
||||
|
||||
pub fn new_test_ext(code: &[u8]) -> TestExternalities<BlakeTwo256> {
|
||||
@@ -171,29 +165,15 @@ pub fn construct_block(
|
||||
};
|
||||
|
||||
// execute the block to get the real header.
|
||||
executor_call::<NeverNativeValue, fn() -> _>(
|
||||
env,
|
||||
"Core_initialize_block",
|
||||
&header.encode(),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.unwrap();
|
||||
executor_call(env, "Core_initialize_block", &header.encode(), true).0.unwrap();
|
||||
|
||||
for extrinsic in extrinsics.iter() {
|
||||
// Try to apply the `extrinsic`. It should be valid, in the sense that it passes
|
||||
// all pre-inclusion checks.
|
||||
let r = executor_call::<NeverNativeValue, fn() -> _>(
|
||||
env,
|
||||
"BlockBuilder_apply_extrinsic",
|
||||
&extrinsic.encode(),
|
||||
true,
|
||||
None,
|
||||
)
|
||||
.0
|
||||
.expect("application of an extrinsic failed")
|
||||
.into_encoded();
|
||||
let r = executor_call(env, "BlockBuilder_apply_extrinsic", &extrinsic.encode(), true)
|
||||
.0
|
||||
.expect("application of an extrinsic failed");
|
||||
|
||||
match ApplyExtrinsicResult::decode(&mut &r[..])
|
||||
.expect("apply result deserialization failed")
|
||||
{
|
||||
@@ -202,19 +182,10 @@ pub fn construct_block(
|
||||
}
|
||||
}
|
||||
|
||||
let header = match executor_call::<NeverNativeValue, fn() -> _>(
|
||||
env,
|
||||
"BlockBuilder_finalize_block",
|
||||
&[0u8; 0],
|
||||
true,
|
||||
None,
|
||||
let header = Header::decode(
|
||||
&mut &executor_call(env, "BlockBuilder_finalize_block", &[0u8; 0], true).0.unwrap()[..],
|
||||
)
|
||||
.0
|
||||
.unwrap()
|
||||
{
|
||||
NativeOrEncoded::Native(_) => unreachable!(),
|
||||
NativeOrEncoded::Encoded(h) => Header::decode(&mut &h[..]).unwrap(),
|
||||
};
|
||||
.unwrap();
|
||||
|
||||
let hash = header.blake2_256();
|
||||
(Block { header, extrinsics }.encode(), hash.into())
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user