difftreelog
fix remove preimage benchmark
in: master
6 files changed
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -614,7 +614,7 @@
para_id,
collator_key: collator_key.expect("cli args do not allow this"),
announce_block,
- }
+ },
)?;
}
pallets/app-promotion/src/weights.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/weights.rs
+++ b/pallets/app-promotion/src/weights.rs
@@ -3,10 +3,10 @@
//! Autogenerated weights for pallet_app_promotion
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2023-09-26, STEPS: `50`, REPEAT: `400`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! DATE: 2023-10-12, STEPS: `50`, REPEAT: `80`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
-//! HOSTNAME: `bench-host`, CPU: `Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz`
-//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
+//! HOSTNAME: `ubuntu-11`, CPU: `QEMU Virtual CPU version 2.5+`
+//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
// Executed Command:
// target/production/unique-collator
@@ -20,7 +20,7 @@
// *
// --template=.maintain/frame-weight-template.hbs
// --steps=50
-// --repeat=400
+// --repeat=80
// --heap-pages=4096
// --output=./pallets/app-promotion/src/weights.rs
@@ -48,185 +48,185 @@
/// Weights for pallet_app_promotion using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
- /// Storage: Maintenance Enabled (r:1 w:0)
- /// Proof: Maintenance Enabled (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
- /// Storage: AppPromotion PendingUnstake (r:1 w:1)
- /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen)
- /// Storage: Balances Freezes (r:3 w:3)
- /// Proof: Balances Freezes (max_values: None, max_size: Some(369), added: 2844, mode: MaxEncodedLen)
- /// Storage: System Account (r:3 w:3)
- /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
- /// Storage: Balances Locks (r:3 w:0)
- /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
+ /// Storage: `Maintenance::Enabled` (r:1 w:0)
+ /// Proof: `Maintenance::Enabled` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::PendingUnstake` (r:1 w:1)
+ /// Proof: `AppPromotion::PendingUnstake` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Freezes` (r:3 w:3)
+ /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(369), added: 2844, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:3 w:3)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Locks` (r:3 w:0)
+ /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// The range of component `b` is `[0, 3]`.
fn on_initialize(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `222 + b * (285 ±0)`
// Estimated: `3622 + b * (3774 ±0)`
- // Minimum execution time: 4_107_000 picoseconds.
- Weight::from_parts(4_751_973, 3622)
- // Standard Error: 4_668
- .saturating_add(Weight::from_parts(10_570_330, 0).saturating_mul(b.into()))
+ // Minimum execution time: 6_031_000 picoseconds.
+ Weight::from_parts(6_880_848, 3622)
+ // Standard Error: 18_753
+ .saturating_add(Weight::from_parts(22_907_186, 0).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into())))
.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(b.into())))
.saturating_add(Weight::from_parts(0, 3774).saturating_mul(b.into()))
}
- /// Storage: AppPromotion Admin (r:0 w:1)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:0 w:1)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
fn set_admin_address() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
- // Minimum execution time: 3_459_000 picoseconds.
- Weight::from_parts(3_627_000, 0)
+ // Minimum execution time: 7_565_000 picoseconds.
+ Weight::from_parts(7_795_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: ParachainSystem ValidationData (r:1 w:0)
- /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured)
- /// Storage: AppPromotion PreviousCalculatedRecord (r:1 w:1)
- /// Proof: AppPromotion PreviousCalculatedRecord (max_values: Some(1), max_size: Some(36), added: 531, mode: MaxEncodedLen)
- /// Storage: AppPromotion Staked (r:1001 w:1000)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: System Account (r:101 w:101)
- /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
- /// Storage: Balances Freezes (r:100 w:100)
- /// Proof: Balances Freezes (max_values: None, max_size: Some(369), added: 2844, mode: MaxEncodedLen)
- /// Storage: Balances Locks (r:100 w:0)
- /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
+ /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
+ /// Storage: `AppPromotion::PreviousCalculatedRecord` (r:1 w:1)
+ /// Proof: `AppPromotion::PreviousCalculatedRecord` (`max_values`: Some(1), `max_size`: Some(36), added: 531, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::Staked` (r:1001 w:1000)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:101 w:101)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Freezes` (r:100 w:100)
+ /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(369), added: 2844, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Locks` (r:100 w:0)
+ /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// The range of component `b` is `[1, 100]`.
fn payout_stakers(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `564 + b * (641 ±0)`
// Estimated: `3593 + b * (25550 ±0)`
- // Minimum execution time: 73_245_000 picoseconds.
- Weight::from_parts(74_196_000, 3593)
- // Standard Error: 8_231
- .saturating_add(Weight::from_parts(49_090_053, 0).saturating_mul(b.into()))
+ // Minimum execution time: 146_577_000 picoseconds.
+ Weight::from_parts(147_970_000, 3593)
+ // Standard Error: 59_065
+ .saturating_add(Weight::from_parts(115_527_092, 0).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().reads((13_u64).saturating_mul(b.into())))
.saturating_add(T::DbWeight::get().writes(3_u64))
.saturating_add(T::DbWeight::get().writes((12_u64).saturating_mul(b.into())))
.saturating_add(Weight::from_parts(0, 25550).saturating_mul(b.into()))
}
- /// Storage: AppPromotion StakesPerAccount (r:1 w:1)
- /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: System Account (r:1 w:1)
- /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
- /// Storage: Balances Freezes (r:1 w:1)
- /// Proof: Balances Freezes (max_values: None, max_size: Some(369), added: 2844, mode: MaxEncodedLen)
- /// Storage: Balances Locks (r:1 w:0)
- /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
- /// Storage: ParachainSystem ValidationData (r:1 w:0)
- /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured)
- /// Storage: AppPromotion Staked (r:1 w:1)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::StakesPerAccount` (r:1 w:1)
+ /// Proof: `AppPromotion::StakesPerAccount` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:1 w:1)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Freezes` (r:1 w:1)
+ /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(369), added: 2844, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Locks` (r:1 w:0)
+ /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
+ /// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
+ /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
+ /// Storage: `AppPromotion::Staked` (r:1 w:1)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn stake() -> Weight {
// Proof Size summary in bytes:
// Measured: `389`
// Estimated: `4764`
- // Minimum execution time: 21_088_000 picoseconds.
- Weight::from_parts(21_639_000, 4764)
+ // Minimum execution time: 46_889_000 picoseconds.
+ Weight::from_parts(47_549_000, 4764)
.saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: AppPromotion PendingUnstake (r:1 w:1)
- /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen)
- /// Storage: AppPromotion Staked (r:11 w:10)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
- /// Storage: AppPromotion StakesPerAccount (r:0 w:1)
- /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::PendingUnstake` (r:1 w:1)
+ /// Proof: `AppPromotion::PendingUnstake` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::Staked` (r:11 w:10)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::StakesPerAccount` (r:0 w:1)
+ /// Proof: `AppPromotion::StakesPerAccount` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn unstake_all() -> Weight {
// Proof Size summary in bytes:
// Measured: `829`
// Estimated: `29095`
- // Minimum execution time: 42_086_000 picoseconds.
- Weight::from_parts(43_149_000, 29095)
+ // Minimum execution time: 63_069_000 picoseconds.
+ Weight::from_parts(64_522_000, 29095)
.saturating_add(T::DbWeight::get().reads(14_u64))
.saturating_add(T::DbWeight::get().writes(13_u64))
}
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: AppPromotion PendingUnstake (r:1 w:1)
- /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen)
- /// Storage: AppPromotion Staked (r:11 w:10)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
- /// Storage: AppPromotion StakesPerAccount (r:1 w:1)
- /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::PendingUnstake` (r:1 w:1)
+ /// Proof: `AppPromotion::PendingUnstake` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::Staked` (r:11 w:10)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::StakesPerAccount` (r:1 w:1)
+ /// Proof: `AppPromotion::StakesPerAccount` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn unstake_partial() -> Weight {
// Proof Size summary in bytes:
// Measured: `829`
// Estimated: `29095`
- // Minimum execution time: 46_458_000 picoseconds.
- Weight::from_parts(47_333_000, 29095)
+ // Minimum execution time: 84_649_000 picoseconds.
+ Weight::from_parts(86_173_000, 29095)
.saturating_add(T::DbWeight::get().reads(15_u64))
.saturating_add(T::DbWeight::get().writes(13_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: Common CollectionById (r:1 w:1)
- /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `Common::CollectionById` (r:1 w:1)
+ /// Proof: `Common::CollectionById` (`max_values`: None, `max_size`: Some(860), added: 3335, mode: `MaxEncodedLen`)
fn sponsor_collection() -> Weight {
// Proof Size summary in bytes:
// Measured: `1060`
// Estimated: `4325`
- // Minimum execution time: 12_827_000 picoseconds.
- Weight::from_parts(13_610_000, 4325)
+ // Minimum execution time: 24_396_000 picoseconds.
+ Weight::from_parts(24_917_000, 4325)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: Common CollectionById (r:1 w:1)
- /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `Common::CollectionById` (r:1 w:1)
+ /// Proof: `Common::CollectionById` (`max_values`: None, `max_size`: Some(860), added: 3335, mode: `MaxEncodedLen`)
fn stop_sponsoring_collection() -> Weight {
// Proof Size summary in bytes:
// Measured: `1092`
// Estimated: `4325`
- // Minimum execution time: 11_899_000 picoseconds.
- Weight::from_parts(12_303_000, 4325)
+ // Minimum execution time: 22_412_000 picoseconds.
+ Weight::from_parts(23_033_000, 4325)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: EvmContractHelpers Sponsoring (r:0 w:1)
- /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `EvmContractHelpers::Sponsoring` (r:0 w:1)
+ /// Proof: `EvmContractHelpers::Sponsoring` (`max_values`: None, `max_size`: Some(62), added: 2537, mode: `MaxEncodedLen`)
fn sponsor_contract() -> Weight {
// Proof Size summary in bytes:
// Measured: `198`
// Estimated: `1517`
- // Minimum execution time: 10_226_000 picoseconds.
- Weight::from_parts(10_549_000, 1517)
+ // Minimum execution time: 21_621_000 picoseconds.
+ Weight::from_parts(22_041_000, 1517)
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: EvmContractHelpers Sponsoring (r:1 w:1)
- /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `EvmContractHelpers::Sponsoring` (r:1 w:1)
+ /// Proof: `EvmContractHelpers::Sponsoring` (`max_values`: None, `max_size`: Some(62), added: 2537, mode: `MaxEncodedLen`)
fn stop_sponsoring_contract() -> Weight {
// Proof Size summary in bytes:
// Measured: `396`
// Estimated: `3527`
- // Minimum execution time: 10_528_000 picoseconds.
- Weight::from_parts(10_842_000, 3527)
+ // Minimum execution time: 19_186_000 picoseconds.
+ Weight::from_parts(19_616_000, 3527)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
@@ -234,185 +234,185 @@
// For backwards compatibility and tests
impl WeightInfo for () {
- /// Storage: Maintenance Enabled (r:1 w:0)
- /// Proof: Maintenance Enabled (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
- /// Storage: AppPromotion PendingUnstake (r:1 w:1)
- /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen)
- /// Storage: Balances Freezes (r:3 w:3)
- /// Proof: Balances Freezes (max_values: None, max_size: Some(369), added: 2844, mode: MaxEncodedLen)
- /// Storage: System Account (r:3 w:3)
- /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
- /// Storage: Balances Locks (r:3 w:0)
- /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
+ /// Storage: `Maintenance::Enabled` (r:1 w:0)
+ /// Proof: `Maintenance::Enabled` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::PendingUnstake` (r:1 w:1)
+ /// Proof: `AppPromotion::PendingUnstake` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Freezes` (r:3 w:3)
+ /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(369), added: 2844, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:3 w:3)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Locks` (r:3 w:0)
+ /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// The range of component `b` is `[0, 3]`.
fn on_initialize(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `222 + b * (285 ±0)`
// Estimated: `3622 + b * (3774 ±0)`
- // Minimum execution time: 4_107_000 picoseconds.
- Weight::from_parts(4_751_973, 3622)
- // Standard Error: 4_668
- .saturating_add(Weight::from_parts(10_570_330, 0).saturating_mul(b.into()))
+ // Minimum execution time: 6_031_000 picoseconds.
+ Weight::from_parts(6_880_848, 3622)
+ // Standard Error: 18_753
+ .saturating_add(Weight::from_parts(22_907_186, 0).saturating_mul(b.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(b.into())))
.saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(b.into())))
.saturating_add(Weight::from_parts(0, 3774).saturating_mul(b.into()))
}
- /// Storage: AppPromotion Admin (r:0 w:1)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:0 w:1)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
fn set_admin_address() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
- // Minimum execution time: 3_459_000 picoseconds.
- Weight::from_parts(3_627_000, 0)
+ // Minimum execution time: 7_565_000 picoseconds.
+ Weight::from_parts(7_795_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: ParachainSystem ValidationData (r:1 w:0)
- /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured)
- /// Storage: AppPromotion PreviousCalculatedRecord (r:1 w:1)
- /// Proof: AppPromotion PreviousCalculatedRecord (max_values: Some(1), max_size: Some(36), added: 531, mode: MaxEncodedLen)
- /// Storage: AppPromotion Staked (r:1001 w:1000)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: System Account (r:101 w:101)
- /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
- /// Storage: Balances Freezes (r:100 w:100)
- /// Proof: Balances Freezes (max_values: None, max_size: Some(369), added: 2844, mode: MaxEncodedLen)
- /// Storage: Balances Locks (r:100 w:0)
- /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
+ /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
+ /// Storage: `AppPromotion::PreviousCalculatedRecord` (r:1 w:1)
+ /// Proof: `AppPromotion::PreviousCalculatedRecord` (`max_values`: Some(1), `max_size`: Some(36), added: 531, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::Staked` (r:1001 w:1000)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:101 w:101)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Freezes` (r:100 w:100)
+ /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(369), added: 2844, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Locks` (r:100 w:0)
+ /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// The range of component `b` is `[1, 100]`.
fn payout_stakers(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `564 + b * (641 ±0)`
// Estimated: `3593 + b * (25550 ±0)`
- // Minimum execution time: 73_245_000 picoseconds.
- Weight::from_parts(74_196_000, 3593)
- // Standard Error: 8_231
- .saturating_add(Weight::from_parts(49_090_053, 0).saturating_mul(b.into()))
+ // Minimum execution time: 146_577_000 picoseconds.
+ Weight::from_parts(147_970_000, 3593)
+ // Standard Error: 59_065
+ .saturating_add(Weight::from_parts(115_527_092, 0).saturating_mul(b.into()))
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().reads((13_u64).saturating_mul(b.into())))
.saturating_add(RocksDbWeight::get().writes(3_u64))
.saturating_add(RocksDbWeight::get().writes((12_u64).saturating_mul(b.into())))
.saturating_add(Weight::from_parts(0, 25550).saturating_mul(b.into()))
}
- /// Storage: AppPromotion StakesPerAccount (r:1 w:1)
- /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: System Account (r:1 w:1)
- /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen)
- /// Storage: Balances Freezes (r:1 w:1)
- /// Proof: Balances Freezes (max_values: None, max_size: Some(369), added: 2844, mode: MaxEncodedLen)
- /// Storage: Balances Locks (r:1 w:0)
- /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
- /// Storage: ParachainSystem ValidationData (r:1 w:0)
- /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured)
- /// Storage: AppPromotion Staked (r:1 w:1)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::StakesPerAccount` (r:1 w:1)
+ /// Proof: `AppPromotion::StakesPerAccount` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:1 w:1)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Freezes` (r:1 w:1)
+ /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(369), added: 2844, mode: `MaxEncodedLen`)
+ /// Storage: `Balances::Locks` (r:1 w:0)
+ /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
+ /// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
+ /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
+ /// Storage: `AppPromotion::Staked` (r:1 w:1)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn stake() -> Weight {
// Proof Size summary in bytes:
// Measured: `389`
// Estimated: `4764`
- // Minimum execution time: 21_088_000 picoseconds.
- Weight::from_parts(21_639_000, 4764)
+ // Minimum execution time: 46_889_000 picoseconds.
+ Weight::from_parts(47_549_000, 4764)
.saturating_add(RocksDbWeight::get().reads(8_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: AppPromotion PendingUnstake (r:1 w:1)
- /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen)
- /// Storage: AppPromotion Staked (r:11 w:10)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
- /// Storage: AppPromotion StakesPerAccount (r:0 w:1)
- /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::PendingUnstake` (r:1 w:1)
+ /// Proof: `AppPromotion::PendingUnstake` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::Staked` (r:11 w:10)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::StakesPerAccount` (r:0 w:1)
+ /// Proof: `AppPromotion::StakesPerAccount` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn unstake_all() -> Weight {
// Proof Size summary in bytes:
// Measured: `829`
// Estimated: `29095`
- // Minimum execution time: 42_086_000 picoseconds.
- Weight::from_parts(43_149_000, 29095)
+ // Minimum execution time: 63_069_000 picoseconds.
+ Weight::from_parts(64_522_000, 29095)
.saturating_add(RocksDbWeight::get().reads(14_u64))
.saturating_add(RocksDbWeight::get().writes(13_u64))
}
- /// Storage: Configuration AppPromomotionConfigurationOverride (r:1 w:0)
- /// Proof: Configuration AppPromomotionConfigurationOverride (max_values: Some(1), max_size: Some(17), added: 512, mode: MaxEncodedLen)
- /// Storage: AppPromotion PendingUnstake (r:1 w:1)
- /// Proof: AppPromotion PendingUnstake (max_values: None, max_size: Some(157), added: 2632, mode: MaxEncodedLen)
- /// Storage: AppPromotion Staked (r:11 w:10)
- /// Proof: AppPromotion Staked (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen)
- /// Storage: AppPromotion TotalStaked (r:1 w:1)
- /// Proof: AppPromotion TotalStaked (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen)
- /// Storage: AppPromotion StakesPerAccount (r:1 w:1)
- /// Proof: AppPromotion StakesPerAccount (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
+ /// Storage: `Configuration::AppPromomotionConfigurationOverride` (r:1 w:0)
+ /// Proof: `Configuration::AppPromomotionConfigurationOverride` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::PendingUnstake` (r:1 w:1)
+ /// Proof: `AppPromotion::PendingUnstake` (`max_values`: None, `max_size`: Some(157), added: 2632, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::Staked` (r:11 w:10)
+ /// Proof: `AppPromotion::Staked` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::TotalStaked` (r:1 w:1)
+ /// Proof: `AppPromotion::TotalStaked` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `AppPromotion::StakesPerAccount` (r:1 w:1)
+ /// Proof: `AppPromotion::StakesPerAccount` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn unstake_partial() -> Weight {
// Proof Size summary in bytes:
// Measured: `829`
// Estimated: `29095`
- // Minimum execution time: 46_458_000 picoseconds.
- Weight::from_parts(47_333_000, 29095)
+ // Minimum execution time: 84_649_000 picoseconds.
+ Weight::from_parts(86_173_000, 29095)
.saturating_add(RocksDbWeight::get().reads(15_u64))
.saturating_add(RocksDbWeight::get().writes(13_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: Common CollectionById (r:1 w:1)
- /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `Common::CollectionById` (r:1 w:1)
+ /// Proof: `Common::CollectionById` (`max_values`: None, `max_size`: Some(860), added: 3335, mode: `MaxEncodedLen`)
fn sponsor_collection() -> Weight {
// Proof Size summary in bytes:
// Measured: `1060`
// Estimated: `4325`
- // Minimum execution time: 12_827_000 picoseconds.
- Weight::from_parts(13_610_000, 4325)
+ // Minimum execution time: 24_396_000 picoseconds.
+ Weight::from_parts(24_917_000, 4325)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: Common CollectionById (r:1 w:1)
- /// Proof: Common CollectionById (max_values: None, max_size: Some(860), added: 3335, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `Common::CollectionById` (r:1 w:1)
+ /// Proof: `Common::CollectionById` (`max_values`: None, `max_size`: Some(860), added: 3335, mode: `MaxEncodedLen`)
fn stop_sponsoring_collection() -> Weight {
// Proof Size summary in bytes:
// Measured: `1092`
// Estimated: `4325`
- // Minimum execution time: 11_899_000 picoseconds.
- Weight::from_parts(12_303_000, 4325)
+ // Minimum execution time: 22_412_000 picoseconds.
+ Weight::from_parts(23_033_000, 4325)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: EvmContractHelpers Sponsoring (r:0 w:1)
- /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `EvmContractHelpers::Sponsoring` (r:0 w:1)
+ /// Proof: `EvmContractHelpers::Sponsoring` (`max_values`: None, `max_size`: Some(62), added: 2537, mode: `MaxEncodedLen`)
fn sponsor_contract() -> Weight {
// Proof Size summary in bytes:
// Measured: `198`
// Estimated: `1517`
- // Minimum execution time: 10_226_000 picoseconds.
- Weight::from_parts(10_549_000, 1517)
+ // Minimum execution time: 21_621_000 picoseconds.
+ Weight::from_parts(22_041_000, 1517)
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
- /// Storage: AppPromotion Admin (r:1 w:0)
- /// Proof: AppPromotion Admin (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
- /// Storage: EvmContractHelpers Sponsoring (r:1 w:1)
- /// Proof: EvmContractHelpers Sponsoring (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen)
+ /// Storage: `AppPromotion::Admin` (r:1 w:0)
+ /// Proof: `AppPromotion::Admin` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`)
+ /// Storage: `EvmContractHelpers::Sponsoring` (r:1 w:1)
+ /// Proof: `EvmContractHelpers::Sponsoring` (`max_values`: None, `max_size`: Some(62), added: 2537, mode: `MaxEncodedLen`)
fn stop_sponsoring_contract() -> Weight {
// Proof Size summary in bytes:
// Measured: `396`
// Estimated: `3527`
- // Minimum execution time: 10_528_000 picoseconds.
- Weight::from_parts(10_842_000, 3527)
+ // Minimum execution time: 19_186_000 picoseconds.
+ Weight::from_parts(19_616_000, 3527)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
pallets/maintenance/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/maintenance/src/benchmarking.rs
+++ b/pallets/maintenance/src/benchmarking.rs
@@ -15,9 +15,8 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use frame_benchmarking::v2::*;
-use frame_support::{ensure, pallet_prelude::Weight, traits::StorePreimage};
+use frame_support::ensure;
use frame_system::RawOrigin;
-use parity_scale_codec::Encode;
use sp_std::vec;
use super::*;
@@ -45,28 +44,6 @@
_(RawOrigin::Root);
ensure!(!<Enabled<T>>::get(), "didn't disable the MM");
-
- Ok(())
- }
-
- // TODO: fix
- // #[pov_mode = MaxEncodedLen {
- // // PoV size is deducted from weight_bound
- // Preimage::PreimageFor: Measured
- // }]
- #[benchmark]
- fn execute_preimage() -> Result<(), BenchmarkError> {
- let call = <T as Config>::RuntimeCall::from(frame_system::Call::<T>::remark {
- remark: 1u32.encode(),
- });
- let hash = T::Preimages::note(call.encode().into())?;
-
- #[extrinsic_call]
- _(
- RawOrigin::Root,
- hash,
- Weight::from_parts(100000000000, 100000000000),
- );
Ok(())
}
pallets/maintenance/src/lib.rsdiffbeforeafterboth--- a/pallets/maintenance/src/lib.rs
+++ b/pallets/maintenance/src/lib.rs
@@ -32,7 +32,6 @@
traits::{EnsureOrigin, QueryPreimage, StorePreimage},
};
use frame_system::pallet_prelude::*;
- use sp_core::H256;
use sp_runtime::traits::Dispatchable;
use crate::weights::WeightInfo;
@@ -102,50 +101,6 @@
Self::deposit_event(Event::MaintenanceDisabled);
Ok(())
- }
-
- /// Execute a runtime call stored as a preimage.
- ///
- /// `weight_bound` is the maximum weight that the caller is willing
- /// to allow the extrinsic to be executed with.
- #[pallet::call_index(2)]
- #[pallet::weight(<T as Config>::WeightInfo::execute_preimage() + *weight_bound)]
- pub fn execute_preimage(
- origin: OriginFor<T>,
- hash: H256,
- weight_bound: Weight,
- ) -> DispatchResultWithPostInfo {
- use parity_scale_codec::Decode;
-
- T::PreimageOrigin::ensure_origin(origin.clone())?;
-
- let data = T::Preimages::fetch(&hash, None)?;
- weight_bound.set_proof_size(
- weight_bound
- .proof_size()
- .checked_sub(
- data.len()
- .try_into()
- .map_err(|_| DispatchError::Corruption)?,
- )
- .ok_or(DispatchError::Exhausted)?,
- );
-
- let call = <T as Config>::RuntimeCall::decode(&mut &data[..])
- .map_err(|_| DispatchError::Corruption)?;
-
- ensure!(
- call.get_dispatch_info().weight.all_lte(weight_bound),
- DispatchError::Exhausted
- );
-
- match call.dispatch(origin) {
- Ok(_) => Ok(Pays::No.into()),
- Err(error_and_info) => Err(DispatchErrorWithPostInfo {
- post_info: Pays::No.into(),
- error: error_and_info.error,
- }),
- }
}
}
}
pallets/maintenance/src/weights.rsdiffbeforeafterboth--- a/pallets/maintenance/src/weights.rs
+++ b/pallets/maintenance/src/weights.rs
@@ -35,7 +35,6 @@
pub trait WeightInfo {
fn enable() -> Weight;
fn disable() -> Weight;
- fn execute_preimage() -> Weight;
}
/// Weights for pallet_maintenance using the Substrate node and recommended hardware.
@@ -60,18 +59,6 @@
// Minimum execution time: 2_976_000 picoseconds.
Weight::from_parts(3_111_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
- }
- /// Storage: Preimage StatusFor (r:1 w:0)
- /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
- /// Storage: Preimage PreimageFor (r:1 w:0)
- /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured)
- fn execute_preimage() -> Weight {
- // Proof Size summary in bytes:
- // Measured: `209`
- // Estimated: `3674`
- // Minimum execution time: 7_359_000 picoseconds.
- Weight::from_parts(7_613_000, 3674)
- .saturating_add(T::DbWeight::get().reads(2_u64))
}
}
@@ -96,18 +83,6 @@
// Minimum execution time: 2_976_000 picoseconds.
Weight::from_parts(3_111_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
- }
- /// Storage: Preimage StatusFor (r:1 w:0)
- /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
- /// Storage: Preimage PreimageFor (r:1 w:0)
- /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured)
- fn execute_preimage() -> Weight {
- // Proof Size summary in bytes:
- // Measured: `209`
- // Estimated: `3674`
- // Minimum execution time: 7_359_000 picoseconds.
- Weight::from_parts(7_613_000, 3674)
- .saturating_add(RocksDbWeight::get().reads(2_u64))
}
}
tests/src/maintenance.seqtest.tsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {IKeyringPair} from '@polkadot/types/types';18import {ApiPromise} from '@polkadot/api';19import {expect, itSched, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util';20import {itEth} from './eth/util';21import {main as correctState} from './migrations/correctStateAfterMaintenance';2223async function maintenanceEnabled(api: ApiPromise): Promise<boolean> {24 return (await api.query.maintenance.enabled()).toJSON() as boolean;25}2627describe('Integration Test: Maintenance Functionality', () => {28 let superuser: IKeyringPair;29 let donor: IKeyringPair;30 let bob: IKeyringPair;3132 before(async function() {33 await usingPlaygrounds(async (helper, privateKey) => {34 requirePalletsOrSkip(this, helper, [Pallets.Maintenance]);35 superuser = await privateKey('//Alice');36 donor = await privateKey({url: import.meta.url});37 [bob] = await helper.arrange.createAccounts([10000n], donor);3839 });40 });4142 describe('Maintenance Mode', () => {43 before(async function() {44 await usingPlaygrounds(async (helper) => {45 if(await maintenanceEnabled(helper.getApi())) {46 console.warn('\tMaintenance mode was left enabled BEFORE the test suite! Disabling it now.');47 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', [])).to.be.fulfilled;48 }49 });50 });5152 itSub('Allows superuser to enable and disable maintenance mode - and disallows anyone else', async ({helper}) => {53 // Make sure non-sudo can't enable maintenance mode54 await expect(helper.executeExtrinsic(superuser, 'api.tx.maintenance.enable', []), 'on commoner enabling MM')55 .to.be.rejectedWith(/BadOrigin/);5657 // Set maintenance mode58 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);59 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;6061 // Make sure non-sudo can't disable maintenance mode62 await expect(helper.executeExtrinsic(bob, 'api.tx.maintenance.disable', []), 'on commoner disabling MM')63 .to.be.rejectedWith(/BadOrigin/);6465 // Disable maintenance mode66 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);67 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;68 });6970 itSub('MM blocks unique pallet calls', async ({helper}) => {71 // Can create an NFT collection before enabling the MM72 const nftCollection = await helper.nft.mintCollection(bob, {73 tokenPropertyPermissions: [{74 key: 'test', permission: {75 collectionAdmin: true,76 tokenOwner: true,77 mutable: true,78 },79 }],80 });8182 // Can mint an NFT before enabling the MM83 const nft = await nftCollection.mintToken(bob);8485 // Can create an FT collection before enabling the MM86 const ftCollection = await helper.ft.mintCollection(superuser);8788 // Can mint an FT before enabling the MM89 await expect(ftCollection.mint(superuser)).to.be.fulfilled;9091 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);92 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;9394 // Unable to create a collection when the MM is enabled95 await expect(helper.nft.mintCollection(superuser), 'cudo forbidden stuff')96 .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);9798 // Unable to set token properties when the MM is enabled99 await expect(nft.setProperties(100 bob,101 [{key: 'test', value: 'test-val'}],102 )).to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);103104 // Unable to mint an NFT when the MM is enabled105 await expect(nftCollection.mintToken(superuser))106 .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);107108 // Unable to mint an FT when the MM is enabled109 await expect(ftCollection.mint(superuser))110 .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);111112 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);113 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;114115 // Can create a collection after disabling the MM116 await expect(helper.nft.mintCollection(bob), 'MM is disabled, the collection should be created').to.be.fulfilled;117118 // Can set token properties after disabling the MM119 await nft.setProperties(bob, [{key: 'test', value: 'test-val'}]);120121 // Can mint an NFT after disabling the MM122 await nftCollection.mintToken(bob);123124 // Can mint an FT after disabling the MM125 await ftCollection.mint(superuser);126 });127128 itSub.ifWithPallets('MM blocks unique pallet calls (Re-Fungible)', [Pallets.ReFungible], async ({helper}) => {129 // Can create an RFT collection before enabling the MM130 const rftCollection = await helper.rft.mintCollection(superuser);131132 // Can mint an RFT before enabling the MM133 await expect(rftCollection.mintToken(superuser)).to.be.fulfilled;134135 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);136 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;137138 // Unable to mint an RFT when the MM is enabled139 await expect(rftCollection.mintToken(superuser))140 .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);141142 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);143 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;144145 // Can mint an RFT after disabling the MM146 await rftCollection.mintToken(superuser);147 });148149 itSub('MM allows native token transfers and RPC calls', async ({helper}) => {150 // We can use RPC before the MM is enabled151 const totalCount = await helper.collection.getTotalCount();152153 // We can transfer funds before the MM is enabled154 await expect(helper.balance.transferToSubstrate(superuser, bob.address, 2n)).to.be.fulfilled;155156 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);157 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;158159 // RPCs work while in maintenance160 expect(await helper.collection.getTotalCount()).to.be.deep.equal(totalCount);161162 // We still able to transfer funds163 await expect(helper.balance.transferToSubstrate(bob, superuser.address, 1n)).to.be.fulfilled;164165 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);166 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;167168 // RPCs work after maintenance169 expect(await helper.collection.getTotalCount()).to.be.deep.equal(totalCount);170171 // Transfers work after maintenance172 await expect(helper.balance.transferToSubstrate(bob, superuser.address, 1n)).to.be.fulfilled;173 });174175 itSched.ifWithPallets('MM blocks scheduled calls and the scheduler itself', [Pallets.UniqueScheduler], async (scheduleKind, {helper}) => {176 const collection = await helper.nft.mintCollection(bob);177178 const nftBeforeMM = await collection.mintToken(bob);179 const nftDuringMM = await collection.mintToken(bob);180 const nftAfterMM = await collection.mintToken(bob);181182 const [183 scheduledIdBeforeMM,184 scheduledIdDuringMM,185 scheduledIdBunkerThroughMM,186 scheduledIdAttemptDuringMM,187 scheduledIdAfterMM,188 ] = scheduleKind == 'named'189 ? helper.arrange.makeScheduledIds(5)190 : new Array(5);191192 const blocksToWait = 6;193194 // Scheduling works before the maintenance195 await helper.scheduler.scheduleAfter(blocksToWait, {scheduledId: scheduledIdBeforeMM})196 .nft.transferToken(bob, collection.collectionId, nftBeforeMM.tokenId, {Substrate: superuser.address});197198199 await helper.wait.newBlocks(blocksToWait + 1);200 expect(await nftBeforeMM.getOwner()).to.be.deep.equal({Substrate: superuser.address});201202 // Schedule a transaction that should occur *during* the maintenance203 await helper.scheduler.scheduleAfter(blocksToWait, {scheduledId: scheduledIdDuringMM})204 .nft.transferToken(bob, collection.collectionId, nftDuringMM.tokenId, {Substrate: superuser.address});205206207 // Schedule a transaction that should occur *after* the maintenance208 await helper.scheduler.scheduleAfter(blocksToWait * 2, {scheduledId: scheduledIdBunkerThroughMM})209 .nft.transferToken(bob, collection.collectionId, nftDuringMM.tokenId, {Substrate: superuser.address});210211212 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);213 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;214215 await helper.wait.newBlocks(blocksToWait + 1);216 // The owner should NOT change since the scheduled transaction should be rejected217 expect(await nftDuringMM.getOwner()).to.be.deep.equal({Substrate: bob.address});218219 // Any attempts to schedule a tx during the MM should be rejected220 await expect(helper.scheduler.scheduleAfter(blocksToWait, {scheduledId: scheduledIdAttemptDuringMM})221 .nft.transferToken(bob, collection.collectionId, nftDuringMM.tokenId, {Substrate: superuser.address}))222 .to.be.rejectedWith(/Invalid Transaction: Transaction call is not expected/);223224 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);225 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;226227 // Scheduling works after the maintenance228 await helper.scheduler.scheduleAfter(blocksToWait, {scheduledId: scheduledIdAfterMM})229 .nft.transferToken(bob, collection.collectionId, nftAfterMM.tokenId, {Substrate: superuser.address});230231 await helper.wait.newBlocks(blocksToWait + 1);232233 expect(await nftAfterMM.getOwner()).to.be.deep.equal({Substrate: superuser.address});234 // The owner of the token scheduled for transaction *before* maintenance should now change *after* maintenance235 expect(await nftDuringMM.getOwner()).to.be.deep.equal({Substrate: superuser.address});236 });237238 itEth('Disallows Ethereum transactions to execute while in maintenance', async ({helper}) => {239 const owner = await helper.eth.createAccountWithBalance(donor);240 const receiver = helper.eth.createAccount();241242 const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'A', 'B', 'C', '');243244 // Set maintenance mode245 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);246 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;247248 const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);249 const tokenId = await contract.methods.nextTokenId().call();250 expect(tokenId).to.be.equal('1');251252 await expect(contract.methods.mintWithTokenURI(receiver, 'Test URI').send())253 .to.be.rejectedWith(/Returned error: unknown error/);254255 await expect(contract.methods.ownerOf(tokenId).call()).rejectedWith(/token not found/);256257 // Disable maintenance mode258 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);259 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;260 });261262 itSub('Allows to enable and disable MM repeatedly', async ({helper}) => {263 // Set maintenance mode264 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);265 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', []);266 expect(await maintenanceEnabled(helper.getApi()), 'MM is OFF when it should be ON').to.be.true;267268 // Disable maintenance mode269 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);270 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);271 expect(await maintenanceEnabled(helper.getApi()), 'MM is ON when it should be OFF').to.be.false;272 });273274 afterEach(async () => {275 await usingPlaygrounds(async helper => {276 if(helper.fetchMissingPalletNames([Pallets.Maintenance]).length != 0) return;277 if(await maintenanceEnabled(helper.getApi())) {278 console.warn('\tMaintenance mode was left enabled AFTER a test has finished! Be careful. Disabling it now.');279 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);280 }281 expect(await maintenanceEnabled(helper.getApi()), 'Disastrous! Exited the test suite with maintenance mode on.').to.be.false;282 });283 });284 });285286 describe('Preimage Execution', () => {287 const preimageHashes: string[] = [];288289 before(async function() {290 await usingPlaygrounds(async (helper) => {291 requirePalletsOrSkip(this, helper, [Pallets.Preimage, Pallets.Maintenance]);292293 // create a preimage to be operated with in the tests294 const randomAccounts = await helper.arrange.createCrowd(10, 0n, superuser);295 const randomIdentities = randomAccounts.map((acc, i) => [296 acc.address, {297 deposit: 0n,298 judgements: [],299 info: {300 display: {301 raw: `Random Account #${i}`,302 },303 },304 },305 ]);306 const preimage = helper.constructApiCall('api.tx.identity.forceInsertIdentities', [randomIdentities]).method.toHex();307 preimageHashes.push(await helper.preimage.notePreimage(bob, preimage, true));308 });309 });310311 itSub('Successfully executes call in a preimage', async ({helper}) => {312 const result = await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.executePreimage', [313 preimageHashes[0], {refTime: 10000000000, proofSize: 10000},314 ])).to.be.fulfilled;315316 // preimage is executed, and an appropriate event is present317 const events = result.result.events.filter((x: any) => x.event.method === 'IdentitiesInserted' && x.event.section === 'identity');318 expect(events.length).to.be.equal(1);319320 // the preimage goes back to being unrequested321 expect(await helper.preimage.getPreimageInfo(preimageHashes[0])).to.have.property('unrequested');322 });323324 itSub('Does not allow execution of a preimage that would fail', async ({helper}) => {325 const [zeroAccount] = await helper.arrange.createAccounts([0n], superuser);326327 const preimage = helper.constructApiCall('api.tx.balances.forceTransfer', [328 {Id: zeroAccount.address}, {Id: superuser.address}, 1000n,329 ]).method.toHex();330 const preimageHash = await helper.preimage.notePreimage(bob, preimage, true);331 preimageHashes.push(preimageHash);332333 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.executePreimage', [334 preimageHash, {refTime: 10000000000, proofSize: 10000},335 ])).to.be.rejectedWith(/^Token: FundsUnavailable$/);336 });337338 itSub('Does not allow preimage execution with non-root', async ({helper}) => {339 await expect(helper.executeExtrinsic(bob, 'api.tx.maintenance.executePreimage', [340 preimageHashes[0], {refTime: 10000000000, proofSize: 10000},341 ])).to.be.rejectedWith(/^Misc: BadOrigin$/);342 });343344 itSub('Does not allow execution of non-existent preimages', async ({helper}) => {345 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.executePreimage', [346 '0x1010101010101010101010101010101010101010101010101010101010101010', {refTime: 10000000000, proofSize: 10000},347 ])).to.be.rejectedWith(/^Misc: Unavailable$/);348 });349350 itSub('Does not allow preimage execution with less than minimum weights', async ({helper}) => {351 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.executePreimage', [352 preimageHashes[0], {refTime: 1000, proofSize: 100},353 ])).to.be.rejectedWith(/^Misc: Exhausted$/);354 });355356 after(async function() {357 await usingPlaygrounds(async (helper) => {358 if(helper.fetchMissingPalletNames([Pallets.Preimage, Pallets.Maintenance]).length != 0) return;359360 for(const hash of preimageHashes) {361 await helper.preimage.unnotePreimage(bob, hash);362 }363 });364 });365 });366367 describe('Integration Test: Maintenance mode & App Promo', () => {368 let superuser: IKeyringPair;369370 before(async function() {371 await usingPlaygrounds(async (helper, privateKey) => {372 requirePalletsOrSkip(this, helper, [Pallets.Maintenance]);373 superuser = await privateKey('//Alice');374 });375 });376377 describe('Test AppPromo script for check state after Maintenance mode', () => {378 before(async function () {379 await usingPlaygrounds(async (helper) => {380 if(await maintenanceEnabled(helper.getApi())) {381 console.warn('\tMaintenance mode was left enabled BEFORE the test suite! Disabling it now.');382 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', [])).to.be.fulfilled;383 }384 });385 });386 itSub('Can find and fix inconsistent state', async ({helper}) => {387 const api = helper.getApi();388389 await helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [api.tx.system.setStorage([390 // pendingUnstake(1 -> [superuser.address, 100UNQ])391 ['0x42b67acb8bd223c60d0c8f621ffefc0ae280fa2db99bd3827aac976de75af95f5153cb1f00942ff401000000',392 '0x04d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d000010632d5ec76b0500000000000000'],393 // pendingUnstake(2 -> [superuser.address, 100UNQ])394 ['0x42b67acb8bd223c60d0c8f621ffefc0ae280fa2db99bd3827aac976de75af95f9eb2dcce60f37a2702000000',395 '0x04d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d000010632d5ec76b0500000000000000'],396 // Balances.freezes(superuser.address -> freeze with app promo id and 200 UNQ )397 ['0xc2261276cc9d1f8598ea4b6a74b15c2fb1c0eb12e038e5c7f91e120ed4b7ebf1de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d',398 '0x046170707374616b656170707374616b65000020c65abc8ed70a00000000000000'],399 ])]);400401 expect((await api.query.appPromotion.pendingUnstake(1)).toJSON()).to.be.deep.equal([[superuser.address, '0x00000000000000056bc75e2d63100000']]);402 expect((await api.query.appPromotion.pendingUnstake(2)).toJSON()).to.be.deep.equal([[superuser.address, '0x00000000000000056bc75e2d63100000']]);403 expect((await api.query.balances.freezes(superuser.address))404 .map(lock => ({id: lock.id.toUtf8(), amount: lock.amount.toBigInt()})))405 .to.be.deep.equal([{id: 'appstakeappstake', amount: 200000000000000000000n}]);406 await correctState();407408 expect((await api.query.appPromotion.pendingUnstake(1)).toJSON()).to.be.deep.equal([]);409 expect((await api.query.appPromotion.pendingUnstake(2)).toJSON()).to.be.deep.equal([]);410 expect((await api.query.balances.freezes(superuser.address)).toJSON()).to.be.deep.equal([]);411412 });413414 itSub('(!negative test!) Only works when Maintenance mode is disabled', async({helper}) => {415 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.enable', [])).to.be.fulfilled;416 await expect(correctState()).to.be.rejectedWith('The network is still in maintenance mode');417 await expect(helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', [])).to.be.fulfilled;418 });419 });420 });421422 after(async () => {423 await usingPlaygrounds(async(helper) => {424 await helper.getSudo().executeExtrinsic(superuser, 'api.tx.maintenance.disable', []);425 });426 });427});