Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix try-runtime
  • Loading branch information
mclyk committed Nov 25, 2022
commit 1ffd69f6ff6635b3eb79075a0a3225f939d44fee
2 changes: 1 addition & 1 deletion pallets/amm/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const INITIAL_AMOUNT: u128 = 1_000_000_000_000_000;
const ASSET_ID: u32 = 10;
const MINIMUM_LIQUIDITY: u128 = 1_000u128;

fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::Event) {
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/bridge/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn dollar(d: u128) -> u128 {
d.saturating_mul(10_u128.pow(12))
}

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/crowdloans/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use sp_std::prelude::*;
use xcm::latest::prelude::*;

const XCM_WEIGHT_FEE: XcmWeightFeeMisc<Weight, Balance> = XcmWeightFeeMisc {
weight: 3_000_000_000,
weight: Weight::from_ref_time(3_000_000_000),
fee: 50000000000u128,
};
const CONTRIBUTE_AMOUNT: u128 = 20000000000000u128;
Expand All @@ -28,7 +28,7 @@ const LEASE_END: u32 = 7;
const END_BLOCK: u32 = 1_000_000_000u32;
const START_TRIE_INDEX: u32 = 0;

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down Expand Up @@ -87,7 +87,7 @@ benchmarks! {
where_clause {
where
T: pallet_assets::Config<AssetId = CurrencyId, Balance = Balance> + pallet_xcm_helper::Config,
<T as frame_system::Config>::Origin: From<pallet_xcm::Origin>
<T as frame_system::Config>::RuntimeOrigin: From<pallet_xcm::Origin>
}

create_vault {
Expand Down
2 changes: 1 addition & 1 deletion pallets/farming/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const REWARD_AMOUNT: u128 = 2_000_000_000_000_000;
const SHOULD_REWARD_AMOUNT: u128 = 200_000_000_000_000;
const WITHDRAW_AMOUNT: u128 = 1_000_000_000_000_000;

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down
4 changes: 2 additions & 2 deletions pallets/liquid-staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ fn initial_set_up<
ExchangeRate::<T>::mutate(|b| *b = Rate::one());
}

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

benchmarks! {
where_clause {
where
T: Config + pallet_assets::Config<AssetId = CurrencyId, Balance = Balance> + pallet_xcm_helper::Config,
<T as frame_system::Config>::Origin: From<pallet_xcm::Origin>
<T as frame_system::Config>::RuntimeOrigin: From<pallet_xcm::Origin>
}

stake {
Expand Down
2 changes: 1 addition & 1 deletion pallets/loans/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn set_account_borrows<T: Config>(
T::Assets::burn_from(asset_id, &who, borrow_balance).unwrap();
}

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down
1 change: 1 addition & 0 deletions pallets/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ std = [
'scale-info/std',
'pallet-traits/std',
]
try-runtime = ['frame-support/try-runtime']

[lib]
doctest = false
2 changes: 1 addition & 1 deletion pallets/router/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SDOT: CurrencyId = tokens::SDOT;
const INITIAL_AMOUNT: u128 = 1_000_000_000_000_000;
const ASSET_ID: u32 = 11;

fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::Event) {
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/streaming/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn dollar(d: u128) -> u128 {
d.saturating_mul(10_u128.pow(12))
}

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

Expand Down
6 changes: 3 additions & 3 deletions pallets/xcm-helper/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
use frame_system::{self, RawOrigin as SystemOrigin};

const XCM_WEIGHT_FEE: XcmWeightFeeMisc<Weight, Balance> = XcmWeightFeeMisc {
weight: 3_000_000_000,
weight: Weight::from_ref_time(3_000_000_000),
fee: 50000000000u128,
};

fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
}

benchmarks! {
where_clause {
where
<T as frame_system::Config>::Origin: From<pallet_xcm::Origin>
<T as frame_system::Config>::RuntimeOrigin: From<pallet_xcm::Origin>
}

update_xcm_weight_fee {
Expand Down
21 changes: 15 additions & 6 deletions runtime/heiko/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ std = [
'orml-xtokens/std',
'orml-xcm/std',
'orml-vesting/std',
'frame-try-runtime/std',
'pallet-amm/std',
'pallet-router/std',
'pallet-emergency-shutdown/std',
Expand Down Expand Up @@ -247,6 +246,21 @@ try-runtime = [
'pallet-scheduler/try-runtime',
'pallet-preimage/try-runtime',
'polkadot-runtime-common/try-runtime',
'pallet-proxy/try-runtime',
'pallet-xcm/try-runtime',
'parachain-info/try-runtime',
'pallet-collator-selection/try-runtime',
'cumulus-pallet-xcmp-queue/try-runtime',
'cumulus-pallet-dmp-queue/try-runtime',
'cumulus-pallet-xcm/try-runtime',
'cumulus-pallet-aura-ext/try-runtime',
'cumulus-pallet-parachain-system/try-runtime',
'pallet-crowdloans/try-runtime',
'pallet-amm/try-runtime',
'pallet-router/try-runtime',
'pallet-currency-adapter/try-runtime',
'pallet-emergency-shutdown/try-runtime',
'pallet-farming/try-runtime',
'pallet-session/try-runtime',
'pallet-assets/try-runtime',
'pallet-authorship/try-runtime',
Expand All @@ -262,8 +276,3 @@ try-runtime = [
'pallet-xcm-helper/try-runtime',
'pallet-asset-registry/try-runtime',
]

[package.metadata.cargo-udeps.ignore]
normal = [
'frame-try-runtime',
]
15 changes: 13 additions & 2 deletions runtime/heiko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2104,8 +2104,19 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(
block: Block,
state_root_check: bool,
select: frame_try_runtime::TryStateSelect
) -> Weight {
log::info!(
target: "runtime::heiko", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}
}
Expand Down
24 changes: 19 additions & 5 deletions runtime/kerria/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ std = [
'orml-vesting/std',
'pallet-amm/std',
'pallet-router/std',
'frame-try-runtime/std',
'pallet-currency-adapter/std',
'pallet-crowdloans/std',
'pallet-emergency-shutdown/std',
Expand Down Expand Up @@ -271,6 +270,21 @@ try-runtime = [
'pallet-scheduler/try-runtime',
'pallet-preimage/try-runtime',
'polkadot-runtime-common/try-runtime',
'pallet-proxy/try-runtime',
'pallet-xcm/try-runtime',
'parachain-info/try-runtime',
'pallet-collator-selection/try-runtime',
'cumulus-pallet-xcmp-queue/try-runtime',
'cumulus-pallet-dmp-queue/try-runtime',
'cumulus-pallet-xcm/try-runtime',
'cumulus-pallet-aura-ext/try-runtime',
'cumulus-pallet-parachain-system/try-runtime',
'pallet-crowdloans/try-runtime',
'pallet-amm/try-runtime',
'pallet-router/try-runtime',
'pallet-currency-adapter/try-runtime',
'pallet-emergency-shutdown/try-runtime',
'pallet-farming/try-runtime',
'pallet-session/try-runtime',
'pallet-assets/try-runtime',
'pallet-authorship/try-runtime',
Expand All @@ -287,7 +301,7 @@ try-runtime = [
'pallet-xcm-helper/try-runtime',
'pallet-asset-registry/try-runtime',
'pallet-ethereum/try-runtime',
]

[package.metadata.cargo-udeps.ignore]
normal = ['frame-try-runtime']
'pallet-evm/try-runtime',
'pallet-base-fee/try-runtime',
'pallet-evm-signatures/try-runtime',
]
15 changes: 13 additions & 2 deletions runtime/kerria/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2490,8 +2490,19 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(
block: Block,
state_root_check: bool,
select: frame_try_runtime::TryStateSelect
) -> Weight {
log::info!(
target: "runtime::kerria", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}
}
Expand Down
21 changes: 15 additions & 6 deletions runtime/parallel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ std = [
'orml-vesting/std',
'pallet-amm/std',
'pallet-router/std',
'frame-try-runtime/std',
'pallet-currency-adapter/std',
'pallet-crowdloans/std',
'pallet-emergency-shutdown/std',
Expand All @@ -248,6 +247,21 @@ try-runtime = [
'pallet-scheduler/try-runtime',
'pallet-preimage/try-runtime',
'polkadot-runtime-common/try-runtime',
'pallet-proxy/try-runtime',
'pallet-xcm/try-runtime',
'parachain-info/try-runtime',
'pallet-collator-selection/try-runtime',
'cumulus-pallet-xcmp-queue/try-runtime',
'cumulus-pallet-dmp-queue/try-runtime',
'cumulus-pallet-xcm/try-runtime',
'cumulus-pallet-aura-ext/try-runtime',
'cumulus-pallet-parachain-system/try-runtime',
'pallet-crowdloans/try-runtime',
'pallet-amm/try-runtime',
'pallet-router/try-runtime',
'pallet-currency-adapter/try-runtime',
'pallet-emergency-shutdown/try-runtime',
'pallet-farming/try-runtime',
'pallet-session/try-runtime',
'pallet-assets/try-runtime',
'pallet-authorship/try-runtime',
Expand All @@ -264,8 +278,3 @@ try-runtime = [
'pallet-xcm-helper/try-runtime',
'pallet-asset-registry/try-runtime',
]

[package.metadata.cargo-udeps.ignore]
normal = [
'frame-try-runtime',
]
15 changes: 13 additions & 2 deletions runtime/parallel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2107,8 +2107,19 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(
block: Block,
state_root_check: bool,
select: frame_try_runtime::TryStateSelect
) -> Weight {
log::info!(
target: "runtime::parallel", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}
}
Expand Down
22 changes: 18 additions & 4 deletions runtime/vanilla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ std = [
'pallet-amm/std',
'pallet-crowdloans/std',
'pallet-router/std',
'frame-try-runtime/std',
'pallet-currency-adapter/std',
'pallet-farming/std',
'pallet-crowdloans/std',
Expand Down Expand Up @@ -277,6 +276,21 @@ try-runtime = [
'pallet-scheduler/try-runtime',
'pallet-preimage/try-runtime',
'polkadot-runtime-common/try-runtime',
'pallet-proxy/try-runtime',
'pallet-xcm/try-runtime',
'parachain-info/try-runtime',
'pallet-collator-selection/try-runtime',
'cumulus-pallet-xcmp-queue/try-runtime',
'cumulus-pallet-dmp-queue/try-runtime',
'cumulus-pallet-xcm/try-runtime',
'cumulus-pallet-aura-ext/try-runtime',
'cumulus-pallet-parachain-system/try-runtime',
'pallet-crowdloans/try-runtime',
'pallet-amm/try-runtime',
'pallet-router/try-runtime',
'pallet-currency-adapter/try-runtime',
'pallet-emergency-shutdown/try-runtime',
'pallet-farming/try-runtime',
'pallet-session/try-runtime',
'pallet-assets/try-runtime',
'pallet-authorship/try-runtime',
Expand All @@ -293,7 +307,7 @@ try-runtime = [
'pallet-xcm-helper/try-runtime',
'pallet-asset-registry/try-runtime',
'pallet-ethereum/try-runtime',
'pallet-evm/try-runtime',
'pallet-base-fee/try-runtime',
'pallet-evm-signatures/try-runtime',
]

[package.metadata.cargo-udeps.ignore]
normal = ['frame-try-runtime']
15 changes: 13 additions & 2 deletions runtime/vanilla/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2520,8 +2520,19 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(
block: Block,
state_root_check: bool,
select: frame_try_runtime::TryStateSelect
) -> Weight {
log::info!(
target: "runtime::vanilla", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}
}
Expand Down