diff --git a/Cargo.lock b/Cargo.lock index 10ca24905d..31a8fd0965 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4328,6 +4328,7 @@ dependencies = [ "pallet-multisig", "pallet-preimage", "pallet-proxy", + "pallet-recovery", "pallet-scheduler", "pallet-session", "pallet-society", @@ -4724,6 +4725,7 @@ dependencies = [ "pallet-multisig", "pallet-preimage", "pallet-proxy", + "pallet-recovery", "pallet-scheduler", "pallet-session", "pallet-society", diff --git a/parachain/runtime/interlay/Cargo.toml b/parachain/runtime/interlay/Cargo.toml index aca1146bfe..12f53059ad 100644 --- a/parachain/runtime/interlay/Cargo.toml +++ b/parachain/runtime/interlay/Cargo.toml @@ -43,6 +43,7 @@ pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "p pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false, optional = true } frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } @@ -177,6 +178,7 @@ std = [ "pallet-preimage/std", "pallet-identity/std", "pallet-proxy/std", + "pallet-recovery/std", "frame-system-rpc-runtime-api/std", "pallet-transaction-payment-rpc-runtime-api/std", @@ -270,6 +272,7 @@ runtime-benchmarks = [ "pallet-multisig/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", + "pallet-recovery/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", @@ -318,6 +321,7 @@ try-runtime = [ "pallet-multisig/try-runtime", "pallet-identity/try-runtime", "pallet-proxy/try-runtime", + "pallet-recovery/try-runtime", "pallet-sudo/try-runtime", "currency/try-runtime", diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index f4e90448f1..9403cb7ff0 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -1078,6 +1078,24 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +parameter_types! { + pub const ConfigDepositBase: Balance = 100 * DOLLARS; + pub const FriendDepositFactor: Balance = 31 * DOLLARS; + pub const MaxFriends: u16 = 9; + pub const RecoveryDeposit: Balance = 6300 * DOLLARS; +} + +impl pallet_recovery::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_recovery::WeightInfo; + type RuntimeCall = RuntimeCall; + type Currency = NativeCurrency; + type ConfigDepositBase = ConfigDepositBase; + type FriendDepositFactor = FriendDepositFactor; + type MaxFriends = MaxFriends; + type RecoveryDeposit = RecoveryDeposit; +} + impl vault_registry::Config for Runtime { type PalletId = VaultRegistryPalletId; type RuntimeEvent = RuntimeEvent; @@ -1201,14 +1219,14 @@ construct_runtime! { Identity: pallet_identity::{Pallet, Call, Storage, Event} = 8, Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 9, TxPause: tx_pause::{Pallet, Call, Storage, Event} = 10, + Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 11, - // # Tokens & Balances Currency: currency::{Pallet} = 20, Tokens: orml_tokens::{Pallet, Call, Storage, Config, Event} = 21, Supply: supply::{Pallet, Storage, Call, Event, Config} = 22, Vesting: orml_vesting::{Pallet, Storage, Call, Event, Config} = 23, AssetRegistry: orml_asset_registry::{Pallet, Storage, Call, Event, Config} = 24, - MultiTransactionPayment: multi_transaction_payment::{Pallet, Call, Storage} = 25, + MultiTransactionPayment: multi_transaction_payment::{Pallet, Call, Storage} = 25, Escrow: escrow::{Pallet, Call, Storage, Event} = 30, EscrowAnnuity: annuity::::{Pallet, Call, Storage, Event} = 31, @@ -1222,11 +1240,8 @@ construct_runtime! { Farming: farming::{Pallet, Call, Storage, Event} = 44, FarmingRewards: reward::::{Pallet, Storage, Event} = 45, - // # Bitcoin SPV BTCRelay: btc_relay::{Pallet, Call, Config, Storage, Event} = 50, - // Relay: 51 - // # Operational Security: security::{Pallet, Call, Config, Storage, Event} = 60, VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event, ValidateUnsigned} = 61, Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 62, @@ -1234,15 +1249,12 @@ construct_runtime! { Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 64, Replace: replace::{Pallet, Call, Config, Storage, Event} = 65, Fee: fee::{Pallet, Call, Config, Storage} = 66, - // Refund: 67 Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 68, ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 69, - // # Governance Democracy: democracy::{Pallet, Call, Storage, Config, Event} = 70, TechnicalCommittee: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 71, TechnicalMembership: pallet_membership::{Pallet, Call, Storage, Event, Config} = 72, - // Treasury: 73 Authorship: pallet_authorship::{Pallet, Storage} = 80, CollatorSelection: collator_selection::{Pallet, Call, Storage, Event, Config} = 81, @@ -1252,7 +1264,6 @@ construct_runtime! { ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event} = 85, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 86, - // # XCM Helpers XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 90, PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 91, CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 92, @@ -1261,7 +1272,6 @@ construct_runtime! { XTokens: orml_xtokens::{Pallet, Storage, Call, Event} = 94, UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 95, - // # Lending & AMM Loans: loans::{Pallet, Call, Storage, Event, Config} = 100, DexGeneral: dex_general::{Pallet, Call, Storage, Event} = 101, DexStable: dex_stable::{Pallet, Call, Storage, Event} = 102, @@ -1351,6 +1361,7 @@ mod benches { [pallet_multisig, Multisig] [pallet_preimage, Preimage] [pallet_proxy, Proxy] + [pallet_recovery,Recovery] [pallet_scheduler, Scheduler] [pallet_timestamp, Timestamp] [pallet_utility, Utility] diff --git a/parachain/runtime/interlay/src/weights/mod.rs b/parachain/runtime/interlay/src/weights/mod.rs index 9c557d49d7..8ab3eb3432 100644 --- a/parachain/runtime/interlay/src/weights/mod.rs +++ b/parachain/runtime/interlay/src/weights/mod.rs @@ -27,6 +27,7 @@ pub mod pallet_membership; pub mod pallet_multisig; pub mod pallet_preimage; pub mod pallet_proxy; +pub mod pallet_recovery; pub mod pallet_scheduler; pub mod pallet_timestamp; pub mod pallet_utility; diff --git a/parachain/runtime/interlay/src/weights/pallet_recovery.rs b/parachain/runtime/interlay/src/weights/pallet_recovery.rs new file mode 100644 index 0000000000..270bde3efd --- /dev/null +++ b/parachain/runtime/interlay/src/weights/pallet_recovery.rs @@ -0,0 +1,178 @@ + +//! Autogenerated weights for `pallet_recovery` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-06-26, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Nakul`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// pallet_recovery +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 50 +// --repeat +// 10 +// --output +// weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_recovery`. +pub struct WeightInfo(PhantomData); +impl pallet_recovery::WeightInfo for WeightInfo { + /// Storage: Recovery Proxy (r:1 w:0) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn as_recovered() -> Weight { + // Proof Size summary in bytes: + // Measured: `111` + // Estimated: `3545` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 3545)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: Recovery Proxy (r:0 w:1) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn set_recovered() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Recovery Recoverable (r:1 w:1) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn create_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `334 + n * (27 ±0)` + // Estimated: `7396` + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(25_772_388, 0) + .saturating_add(Weight::from_parts(0, 7396)) + // Standard Error: 9_460 + .saturating_add(Weight::from_parts(112_594, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Recovery Recoverable (r:1 w:0) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Recovery ActiveRecoveries (r:1 w:1) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + fn initiate_recovery() -> Weight { + // Proof Size summary in bytes: + // Measured: `689` + // Estimated: `11250` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) + .saturating_add(Weight::from_parts(0, 11250)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Recovery Recoverable (r:1 w:0) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Recovery ActiveRecoveries (r:1 w:1) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn vouch_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `190 + n * (64 ±0)` + // Estimated: `7670` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(17_310_945, 0) + .saturating_add(Weight::from_parts(0, 7670)) + // Standard Error: 12_247 + .saturating_add(Weight::from_parts(76_001, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Recovery Recoverable (r:1 w:0) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Recovery ActiveRecoveries (r:1 w:0) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Recovery Proxy (r:1 w:1) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn claim_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `222 + n * (64 ±0)` + // Estimated: `11215` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(20_687_810, 0) + .saturating_add(Weight::from_parts(0, 11215)) + // Standard Error: 8_550 + .saturating_add(Weight::from_parts(75_150, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Recovery ActiveRecoveries (r:1 w:1) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn close_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `612 + n * (59 ±0)` + // Estimated: `10024` + // Minimum execution time: 40_000_000 picoseconds. + Weight::from_parts(40_937_810, 0) + .saturating_add(Weight::from_parts(0, 10024)) + // Standard Error: 13_523 + .saturating_add(Weight::from_parts(215_501, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: Recovery ActiveRecoveries (r:1 w:0) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Recovery Recoverable (r:1 w:1) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn remove_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `465 + n * (59 ±0)` + // Estimated: `11250` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(27_750_621, 0) + .saturating_add(Weight::from_parts(0, 11250)) + // Standard Error: 7_853 + .saturating_add(Weight::from_parts(56_002, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Recovery Proxy (r:1 w:1) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn cancel_recovered() -> Weight { + // Proof Size summary in bytes: + // Measured: `111` + // Estimated: `3545` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 3545)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/parachain/runtime/kintsugi/Cargo.toml b/parachain/runtime/kintsugi/Cargo.toml index 013243d10a..08847227f0 100644 --- a/parachain/runtime/kintsugi/Cargo.toml +++ b/parachain/runtime/kintsugi/Cargo.toml @@ -43,6 +43,7 @@ pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "p pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false, optional = true } @@ -182,7 +183,8 @@ std = [ "pallet-preimage/std", "pallet-identity/std", "pallet-proxy/std", - "pallet-sudo/std", + "pallet-recovery/std", + "pallet-sudo/std", "frame-system-rpc-runtime-api/std", "pallet-transaction-payment-rpc-runtime-api/std", @@ -277,6 +279,7 @@ runtime-benchmarks = [ "pallet-multisig/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", + "pallet-recovery/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", @@ -324,7 +327,8 @@ try-runtime = [ "pallet-multisig/try-runtime", "pallet-identity/try-runtime", "pallet-proxy/try-runtime", - "pallet-sudo/try-runtime", + "pallet-recovery/try-runtime", + "pallet-sudo/try-runtime", "currency/try-runtime", "orml-tokens/try-runtime", "supply/try-runtime", diff --git a/parachain/runtime/kintsugi/src/constants.rs b/parachain/runtime/kintsugi/src/constants.rs index ef4643473e..1240d154d8 100644 --- a/parachain/runtime/kintsugi/src/constants.rs +++ b/parachain/runtime/kintsugi/src/constants.rs @@ -12,6 +12,7 @@ pub mod currency { // https://github.com/paritytech/polkadot/blob/c4ee9d463adccfa3bf436433e3e26d0de5a4abbc/runtime/kusama/src/constants.rs#L18 pub const UNITS: Balance = NATIVE_TOKEN_ID.one(); + pub const DOLLARS: Balance = UNITS; // 1_000_000_000_000 pub const CENTS: Balance = UNITS / 30_000; pub const GRAND: Balance = CENTS * 100_000; pub const MILLICENTS: Balance = CENTS / 1_000; diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index b128107c2d..1156a2df48 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -1076,6 +1076,24 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +parameter_types! { + pub const ConfigDepositBase: Balance = 8 * DOLLARS; + pub const FriendDepositFactor: Balance = 1 * DOLLARS; + pub const MaxFriends: u16 = 9; + pub const RecoveryDeposit: Balance = 5 * DOLLARS; +} + +impl pallet_recovery::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = weights::pallet_recovery::WeightInfo; + type RuntimeCall = RuntimeCall; + type Currency = NativeCurrency; + type ConfigDepositBase = ConfigDepositBase; + type FriendDepositFactor = FriendDepositFactor; + type MaxFriends = MaxFriends; + type RecoveryDeposit = RecoveryDeposit; +} + impl vault_registry::Config for Runtime { type PalletId = VaultRegistryPalletId; type RuntimeEvent = RuntimeEvent; @@ -1199,6 +1217,7 @@ construct_runtime! { Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 8, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 9, TxPause: tx_pause::{Pallet, Call, Storage, Event} = 10, + Recovery: pallet_recovery::{Pallet, Call, Storage, Event} = 11, // # Tokens & Balances Currency: currency::{Pallet} = 20, @@ -1349,6 +1368,7 @@ mod benches { [pallet_multisig, Multisig] [pallet_preimage, Preimage] [pallet_proxy, Proxy] + [pallet_recovery,Recovery] [pallet_scheduler, Scheduler] [pallet_timestamp, Timestamp] [pallet_utility, Utility] diff --git a/parachain/runtime/kintsugi/src/weights/mod.rs b/parachain/runtime/kintsugi/src/weights/mod.rs index 9c557d49d7..8ab3eb3432 100644 --- a/parachain/runtime/kintsugi/src/weights/mod.rs +++ b/parachain/runtime/kintsugi/src/weights/mod.rs @@ -27,6 +27,7 @@ pub mod pallet_membership; pub mod pallet_multisig; pub mod pallet_preimage; pub mod pallet_proxy; +pub mod pallet_recovery; pub mod pallet_scheduler; pub mod pallet_timestamp; pub mod pallet_utility; diff --git a/parachain/runtime/kintsugi/src/weights/pallet_recovery.rs b/parachain/runtime/kintsugi/src/weights/pallet_recovery.rs new file mode 100644 index 0000000000..ade259d7dc --- /dev/null +++ b/parachain/runtime/kintsugi/src/weights/pallet_recovery.rs @@ -0,0 +1,178 @@ + +//! Autogenerated weights for `pallet_recovery` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-06-26, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Nakul`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// pallet_recovery +// --extrinsic +// * +// --chain +// kintsugi-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 50 +// --repeat +// 10 +// --output +// weight.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_recovery`. +pub struct WeightInfo(PhantomData); +impl pallet_recovery::WeightInfo for WeightInfo { + /// Storage: Recovery Proxy (r:1 w:0) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn as_recovered() -> Weight { + // Proof Size summary in bytes: + // Measured: `111` + // Estimated: `3545` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(Weight::from_parts(0, 3545)) + .saturating_add(T::DbWeight::get().reads(1)) + } + /// Storage: Recovery Proxy (r:0 w:1) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn set_recovered() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(8_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Recovery Recoverable (r:1 w:1) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn create_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `334 + n * (27 ±0)` + // Estimated: `7396` + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(26_652_363, 0) + .saturating_add(Weight::from_parts(0, 7396)) + // Standard Error: 15_481 + .saturating_add(Weight::from_parts(32_109, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Recovery Recoverable (r:1 w:0) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Recovery ActiveRecoveries (r:1 w:1) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + fn initiate_recovery() -> Weight { + // Proof Size summary in bytes: + // Measured: `689` + // Estimated: `11250` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(32_000_000, 0) + .saturating_add(Weight::from_parts(0, 11250)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Recovery Recoverable (r:1 w:0) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Recovery ActiveRecoveries (r:1 w:1) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn vouch_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `190 + n * (64 ±0)` + // Estimated: `7670` + // Minimum execution time: 16_000_000 picoseconds. + Weight::from_parts(16_669_776, 0) + .saturating_add(Weight::from_parts(0, 7670)) + // Standard Error: 15_399 + .saturating_add(Weight::from_parts(249_312, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Recovery Recoverable (r:1 w:0) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Recovery ActiveRecoveries (r:1 w:0) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Recovery Proxy (r:1 w:1) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn claim_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `222 + n * (64 ±0)` + // Estimated: `11215` + // Minimum execution time: 20_000_000 picoseconds. + Weight::from_parts(20_809_079, 0) + .saturating_add(Weight::from_parts(0, 11215)) + // Standard Error: 8_087 + .saturating_add(Weight::from_parts(65_887, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: Recovery ActiveRecoveries (r:1 w:1) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn close_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `612 + n * (59 ±0)` + // Estimated: `10024` + // Minimum execution time: 41_000_000 picoseconds. + Weight::from_parts(41_976_368, 0) + .saturating_add(Weight::from_parts(0, 10024)) + // Standard Error: 15_597 + .saturating_add(Weight::from_parts(104_346, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: Recovery ActiveRecoveries (r:1 w:0) + /// Proof: Recovery ActiveRecoveries (max_values: None, max_size: Some(389), added: 2864, mode: MaxEncodedLen) + /// Storage: Recovery Recoverable (r:1 w:1) + /// Proof: Recovery Recoverable (max_values: None, max_size: Some(351), added: 2826, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// The range of component `n` is `[1, 9]`. + fn remove_recovery(n: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `465 + n * (59 ±0)` + // Estimated: `11250` + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(27_846_393, 0) + .saturating_add(Weight::from_parts(0, 11250)) + // Standard Error: 10_488 + .saturating_add(Weight::from_parts(75_183, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: Recovery Proxy (r:1 w:1) + /// Proof: Recovery Proxy (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn cancel_recovered() -> Weight { + // Proof Size summary in bytes: + // Measured: `111` + // Estimated: `3545` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 3545)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +}