diff --git a/Cargo.lock b/Cargo.lock index 6d62e1fb33..ce67515317 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11607,6 +11607,7 @@ name = "redeem-rpc" version = "1.2.0" dependencies = [ "jsonrpsee", + "oracle-rpc-runtime-api", "parity-scale-codec", "redeem-rpc-runtime-api", "sp-api", @@ -11619,6 +11620,7 @@ name = "redeem-rpc-runtime-api" version = "1.2.0" dependencies = [ "frame-support", + "oracle-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-std", diff --git a/crates/fee/src/lib.rs b/crates/fee/src/lib.rs index 321efd28d4..0153065ad4 100644 --- a/crates/fee/src/lib.rs +++ b/crates/fee/src/lib.rs @@ -424,9 +424,24 @@ impl Pallet { /// /// * `amount` - amount in collateral (at current exchange rate) pub fn get_premium_redeem_fee(amount: &Amount) -> Result, DispatchError> { - amount.checked_rounded_mul(&>::get(), Rounding::NearestPrefUp) + amount.checked_rounded_mul(&>::get(), Rounding::Down) } + /// Get the premium redeem reward rate. + /// + /// # Returns + /// Returns the premium redeem reward rate. + pub fn premium_redeem_reward_rate() -> UnsignedFixedPoint { + >::get() + } + + /// Get the fee share that users need to pay to redeem tokens. + /// + /// # Returns + /// Returns the redeem fee. + pub fn get_redeem_fee_value() -> UnsignedFixedPoint { + >::get() + } /// Calculate punishment fee for a Vault that fails to execute a redeem /// request before the expiry. /// diff --git a/crates/fee/src/types.rs b/crates/fee/src/types.rs index f7bdfccd87..e9e71ce3fb 100644 --- a/crates/fee/src/types.rs +++ b/crates/fee/src/types.rs @@ -5,7 +5,7 @@ use scale_info::TypeInfo; pub(crate) type BalanceOf = ::Balance; -pub(crate) type UnsignedFixedPoint = ::UnsignedFixedPoint; +pub type UnsignedFixedPoint = ::UnsignedFixedPoint; pub(crate) type DefaultVaultId = VaultId<::AccountId, CurrencyId>; diff --git a/crates/issue/src/ext.rs b/crates/issue/src/ext.rs index d548bb6b9f..9a149a236a 100644 --- a/crates/issue/src/ext.rs +++ b/crates/issue/src/ext.rs @@ -95,7 +95,7 @@ pub(crate) mod vault_registry { } pub fn ensure_not_banned(vault_id: &DefaultVaultId) -> DispatchResult { - >::_ensure_not_banned(vault_id) + >::ensure_not_banned(vault_id) } pub fn decrease_to_be_issued_tokens( diff --git a/crates/redeem/rpc/Cargo.toml b/crates/redeem/rpc/Cargo.toml index fa03559d88..523683e9ea 100644 --- a/crates/redeem/rpc/Cargo.toml +++ b/crates/redeem/rpc/Cargo.toml @@ -11,3 +11,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkad sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } redeem-rpc-runtime-api = { path = "runtime-api" } + +[dependencies.oracle-rpc-runtime-api] +path = '../../oracle/rpc/runtime-api' diff --git a/crates/redeem/rpc/runtime-api/Cargo.toml b/crates/redeem/rpc/runtime-api/Cargo.toml index be10d50822..a3ba7f6253 100644 --- a/crates/redeem/rpc/runtime-api/Cargo.toml +++ b/crates/redeem/rpc/runtime-api/Cargo.toml @@ -10,6 +10,10 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "pol sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } +[dependencies.oracle-rpc-runtime-api] +default-features = false +path = '../../../oracle/rpc/runtime-api' + [features] default = ["std"] std = [ diff --git a/crates/redeem/rpc/runtime-api/src/lib.rs b/crates/redeem/rpc/runtime-api/src/lib.rs index cdcc70a605..0b3dd1c080 100644 --- a/crates/redeem/rpc/runtime-api/src/lib.rs +++ b/crates/redeem/rpc/runtime-api/src/lib.rs @@ -3,10 +3,14 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::Codec; +use frame_support::dispatch::DispatchError; +use oracle_rpc_runtime_api::BalanceWrapper; use sp_std::vec::Vec; sp_api::decl_runtime_apis! { - pub trait RedeemApi where + pub trait RedeemApi where + VaultId: Codec, + Balance: Codec, AccountId: Codec, H256: Codec, RedeemRequest: Codec, @@ -16,5 +20,8 @@ sp_api::decl_runtime_apis! { /// Get all redeem requests for a particular vault fn get_vault_redeem_requests(vault_id: AccountId) -> Vec; + + /// Get all vaults below the premium redeem threshold, ordered in descending order of this amount + fn get_premium_redeem_vaults() -> Result)>, DispatchError>; } } diff --git a/crates/redeem/rpc/src/lib.rs b/crates/redeem/rpc/src/lib.rs index 6e0e2c1146..3a65641a9e 100644 --- a/crates/redeem/rpc/src/lib.rs +++ b/crates/redeem/rpc/src/lib.rs @@ -6,20 +6,36 @@ use jsonrpsee::{ proc_macros::rpc, types::error::{CallError, ErrorCode, ErrorObject}, }; +use oracle_rpc_runtime_api::BalanceWrapper; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; -use sp_runtime::traits::Block as BlockT; +use sp_runtime::{ + traits::{Block as BlockT, MaybeDisplay, MaybeFromStr}, + DispatchError, +}; use std::sync::Arc; pub use redeem_rpc_runtime_api::RedeemApi as RedeemRuntimeApi; +fn handle_response(result: Result, E>, msg: String) -> RpcResult { + result + .map_err(|err| internal_err(format!("Runtime error: {:?}: {:?}", msg, err)))? + .map_err(|err| internal_err(format!("Execution error: {:?}: {:?}", msg, err))) +} + #[rpc(client, server)] -pub trait RedeemApi { +pub trait RedeemApi +where + Balance: Codec + MaybeDisplay + MaybeFromStr, +{ #[method(name = "redeem_getRedeemRequests")] fn get_redeem_requests(&self, account_id: AccountId, at: Option) -> RpcResult>; #[method(name = "redeem_getVaultRedeemRequests")] fn get_vault_redeem_requests(&self, vault_id: AccountId, at: Option) -> RpcResult>; + + #[method(name = "redeem_getPremiumRedeemVaults", aliases = ["vaultRegistry_getPremiumRedeemVaults"])] + fn get_premium_redeem_vaults(&self, at: Option) -> RpcResult)>>; } fn internal_err(message: T) -> JsonRpseeError { @@ -47,12 +63,14 @@ impl Redeem { } #[async_trait] -impl RedeemApiServer<::Hash, AccountId, H256, RedeemRequest> - for Redeem +impl + RedeemApiServer<::Hash, VaultId, Balance, AccountId, H256, RedeemRequest> for Redeem where Block: BlockT, C: Send + Sync + 'static + ProvideRuntimeApi + HeaderBackend, - C::Api: RedeemRuntimeApi, + C::Api: RedeemRuntimeApi, + VaultId: Codec, + Balance: Codec + MaybeDisplay + MaybeFromStr, AccountId: Codec, H256: Codec, RedeemRequest: Codec, @@ -76,4 +94,17 @@ where api.get_vault_redeem_requests(at, vault_id) .map_err(|e| internal_err(format!("Unable to fetch redeem requests: {:?}", e))) } + + fn get_premium_redeem_vaults( + &self, + at: Option<::Hash>, + ) -> RpcResult)>> { + let api = self.client.runtime_api(); + let at = at.unwrap_or_else(|| self.client.info().best_hash); + + handle_response( + api.get_premium_redeem_vaults(at), + "Unable to find a vault below the premium redeem threshold".into(), + ) + } } diff --git a/crates/redeem/src/benchmarking.rs b/crates/redeem/src/benchmarking.rs index afcc7ae50a..c6a58c2453 100644 --- a/crates/redeem/src/benchmarking.rs +++ b/crates/redeem/src/benchmarking.rs @@ -18,10 +18,10 @@ use vault_registry::{ // Pallets use crate::Pallet as Redeem; use btc_relay::Pallet as BtcRelay; -use oracle::Pallet as Oracle; +use oracle::{OracleKey, Pallet as Oracle}; use security::Pallet as Security; +use sp_runtime::FixedPointNumber; use vault_registry::Pallet as VaultRegistry; - type UnsignedFixedPoint = ::UnsignedFixedPoint; fn collateral(amount: u32) -> Amount { @@ -158,6 +158,13 @@ pub mod benchmarks { #[extrinsic_call] _(RawOrigin::Signed(caller), amount, btc_address, vault_id.clone()); + let redeem_vault_request = Redeem::::get_redeem_requests_for_vault(vault_id.account_id.clone()); + let redeem_request_hash = redeem_vault_request + .first() + .cloned() + .unwrap_or_else(|| panic!("No redeem request found")); + let redeem_struct = RedeemRequests::::get(redeem_request_hash).unwrap(); + assert!(redeem_struct.premium > 0); } #[benchmark] diff --git a/crates/redeem/src/default_weights.rs b/crates/redeem/src/default_weights.rs index 71ac5e8290..a9a344b47d 100644 --- a/crates/redeem/src/default_weights.rs +++ b/crates/redeem/src/default_weights.rs @@ -49,365 +49,362 @@ pub trait WeightInfo { /// Weights for redeem using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Fee RedeemFee (r:1 w:0) - /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:2 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) - /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) - /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PremiumRedeemFee (r:1 w:0) - /// Proof: Fee PremiumRedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - fn request_redeem() -> Weight { + + /// Storage: `Tokens::Accounts` (r:2 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Fee::RedeemFee` (r:1 w:0) + /// Proof: `Fee::RedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemTransactionSize` (r:1 w:0) + /// Proof: `Redeem::RedeemTransactionSize` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:2 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemBtcDustValue` (r:1 w:0) + /// Proof: `Redeem::RedeemBtcDustValue` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PremiumRedeemThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::PremiumRedeemThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Fee::PremiumRedeemFee` (r:1 w:0) + /// Proof: `Fee::PremiumRedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Security::Nonce` (r:1 w:1) + /// Proof: `Security::Nonce` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `System::ParentHash` (r:1 w:0) + /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemRequests` (r:0 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `4672` - // Estimated: `47658` - // Minimum execution time: 311_664_000 picoseconds. - Weight::from_parts(315_792_000, 47658) + // Measured: `3219` + // Estimated: `6260` + // Minimum execution time: 226_000_000 picoseconds. + Weight::from_parts(230_000_000, 6260) .saturating_add(T::DbWeight::get().reads(29_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry LiquidationVault (r:1 w:1) - /// Proof: VaultRegistry LiquidationVault (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:1 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - fn liquidation_redeem() -> Weight { + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::LiquidationVault` (r:1 w:1) + /// Proof: `VaultRegistry::LiquidationVault` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:1 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3861` - // Estimated: `40975` - // Minimum execution time: 279_078_000 picoseconds. - Weight::from_parts(282_886_000, 40975) + // Measured: `2173` + // Estimated: `8760` + // Minimum execution time: 139_000_000 picoseconds. + Weight::from_parts(141_000_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableInclusionCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableInclusionCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:1 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableParachainConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableParachainConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3463` - // Estimated: `18221` - // Minimum execution time: 180_491_000 picoseconds. - Weight::from_parts(156_971_337, 18221) - // Standard Error: 18_912 - .saturating_add(Weight::from_parts(1_667_781, 0).saturating_mul(h.into())) - // Standard Error: 17_010 - .saturating_add(Weight::from_parts(730_184, 0).saturating_mul(i.into())) - // Standard Error: 102_447 - .saturating_add(Weight::from_parts(810_488, 0).saturating_mul(o.into())) - // Standard Error: 103 - .saturating_add(Weight::from_parts(5_905, 0).saturating_mul(b.into())) + // Measured: `2295 + o * (1 ±0)` + // Estimated: `3725` + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(55_152_275, 3725) + // Standard Error: 149_738 + .saturating_add(Weight::from_parts(2_508_576, 0).saturating_mul(h.into())) + // Standard Error: 134_990 + .saturating_add(Weight::from_parts(994_344, 0).saturating_mul(i.into())) + // Standard Error: 818_328 + .saturating_add(Weight::from_parts(3_299_475, 0).saturating_mul(o.into())) + // Standard Error: 824 + .saturating_add(Weight::from_parts(5_210, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_reimburse() -> Weight { + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:2 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `135176` - // Minimum execution time: 798_478_000 picoseconds. - Weight::from_parts(808_188_000, 135176) - .saturating_add(T::DbWeight::get().reads(60_u64)) + // Measured: `5396` + // Estimated: `11350` + // Minimum execution time: 495_000_000 picoseconds. + Weight::from_parts(510_000_000, 11350) + .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_retry() -> Weight { + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `132666` - // Minimum execution time: 729_751_000 picoseconds. - Weight::from_parts(738_648_000, 132666) - .saturating_add(T::DbWeight::get().reads(59_u64)) + // Measured: `5396` + // Estimated: `11350` + // Minimum execution time: 406_000_000 picoseconds. + Weight::from_parts(412_000_000, 11350) + .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } - /// Storage: Redeem RedeemPeriod (r:0 w:1) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_redeem_period() -> Weight { + /// Storage: `Redeem::RedeemPeriod` (r:0 w:1) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn set_redeem_period () -> Weight { // Proof Size summary in bytes: - // Measured: `1025` + // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_527_000 picoseconds. - Weight::from_parts(29_970_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - fn self_redeem() -> Weight { + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2449` - // Estimated: `7835` - // Minimum execution time: 147_756_000 picoseconds. - Weight::from_parts(149_109_000, 7835) + // Measured: `1427` + // Estimated: `3725` + // Minimum execution time: 71_000_000 picoseconds. + Weight::from_parts(72_000_000, 3725) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -415,365 +412,361 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Fee RedeemFee (r:1 w:0) - /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:2 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) - /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) - /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PremiumRedeemFee (r:1 w:0) - /// Proof: Fee PremiumRedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - fn request_redeem() -> Weight { + /// Storage: `Tokens::Accounts` (r:2 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Fee::RedeemFee` (r:1 w:0) + /// Proof: `Fee::RedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemTransactionSize` (r:1 w:0) + /// Proof: `Redeem::RedeemTransactionSize` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:2 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemBtcDustValue` (r:1 w:0) + /// Proof: `Redeem::RedeemBtcDustValue` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PremiumRedeemThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::PremiumRedeemThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Fee::PremiumRedeemFee` (r:1 w:0) + /// Proof: `Fee::PremiumRedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Security::Nonce` (r:1 w:1) + /// Proof: `Security::Nonce` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `System::ParentHash` (r:1 w:0) + /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemRequests` (r:0 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `4672` - // Estimated: `47658` - // Minimum execution time: 311_664_000 picoseconds. - Weight::from_parts(315_792_000, 47658) + // Measured: `3219` + // Estimated: `6260` + // Minimum execution time: 226_000_000 picoseconds. + Weight::from_parts(230_000_000, 6260) .saturating_add(RocksDbWeight::get().reads(29_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry LiquidationVault (r:1 w:1) - /// Proof: VaultRegistry LiquidationVault (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:1 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - fn liquidation_redeem() -> Weight { + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::LiquidationVault` (r:1 w:1) + /// Proof: `VaultRegistry::LiquidationVault` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:1 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3861` - // Estimated: `40975` - // Minimum execution time: 279_078_000 picoseconds. - Weight::from_parts(282_886_000, 40975) + // Measured: `2173` + // Estimated: `8760` + // Minimum execution time: 139_000_000 picoseconds. + Weight::from_parts(141_000_000, 8760) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableInclusionCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableInclusionCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:1 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableParachainConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableParachainConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3463` - // Estimated: `18221` - // Minimum execution time: 180_491_000 picoseconds. - Weight::from_parts(156_971_337, 18221) - // Standard Error: 18_912 - .saturating_add(Weight::from_parts(1_667_781, 0).saturating_mul(h.into())) - // Standard Error: 17_010 - .saturating_add(Weight::from_parts(730_184, 0).saturating_mul(i.into())) - // Standard Error: 102_447 - .saturating_add(Weight::from_parts(810_488, 0).saturating_mul(o.into())) - // Standard Error: 103 - .saturating_add(Weight::from_parts(5_905, 0).saturating_mul(b.into())) + // Measured: `2295 + o * (1 ±0)` + // Estimated: `3725` + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(55_152_275, 3725) + // Standard Error: 149_738 + .saturating_add(Weight::from_parts(2_508_576, 0).saturating_mul(h.into())) + // Standard Error: 134_990 + .saturating_add(Weight::from_parts(994_344, 0).saturating_mul(i.into())) + // Standard Error: 818_328 + .saturating_add(Weight::from_parts(3_299_475, 0).saturating_mul(o.into())) + // Standard Error: 824 + .saturating_add(Weight::from_parts(5_210, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_reimburse() -> Weight { + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:2 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `135176` - // Minimum execution time: 798_478_000 picoseconds. - Weight::from_parts(808_188_000, 135176) - .saturating_add(RocksDbWeight::get().reads(60_u64)) + // Measured: `5396` + // Estimated: `11350` + // Minimum execution time: 495_000_000 picoseconds. + Weight::from_parts(510_000_000, 11350) + .saturating_add(RocksDbWeight::get().reads(59_u64)) .saturating_add(RocksDbWeight::get().writes(29_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_retry() -> Weight { + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `132666` - // Minimum execution time: 729_751_000 picoseconds. - Weight::from_parts(738_648_000, 132666) - .saturating_add(RocksDbWeight::get().reads(59_u64)) + // Measured: `5396` + // Estimated: `11350` + // Minimum execution time: 406_000_000 picoseconds. + Weight::from_parts(412_000_000, 11350) + .saturating_add(RocksDbWeight::get().reads(58_u64)) .saturating_add(RocksDbWeight::get().writes(28_u64)) } - /// Storage: Redeem RedeemPeriod (r:0 w:1) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_redeem_period() -> Weight { + /// Storage: `Redeem::RedeemPeriod` (r:0 w:1) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn set_redeem_period () -> Weight { // Proof Size summary in bytes: - // Measured: `1025` + // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_527_000 picoseconds. - Weight::from_parts(29_970_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - fn self_redeem() -> Weight { + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2449` - // Estimated: `7835` - // Minimum execution time: 147_756_000 picoseconds. - Weight::from_parts(149_109_000, 7835) + // Measured: `1427` + // Estimated: `3725` + // Minimum execution time: 71_000_000 picoseconds. + Weight::from_parts(72_000_000, 3725) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } diff --git a/crates/redeem/src/ext.rs b/crates/redeem/src/ext.rs index eb82f90acf..bb4e42f09a 100644 --- a/crates/redeem/src/ext.rs +++ b/crates/redeem/src/ext.rs @@ -42,8 +42,28 @@ pub(crate) mod vault_registry { use crate::DefaultVaultId; use currency::Amount; use frame_support::dispatch::{DispatchError, DispatchResult}; + use sp_std::vec::Vec; use vault_registry::types::{CurrencyId, CurrencySource, DefaultVault}; + pub fn calculate_inclusion_fee( + wrapped_currency: CurrencyId, + redeem_transaction_size: u32, + ) -> Result, DispatchError> { + >::calculate_inclusion_fee(wrapped_currency, redeem_transaction_size) + } + + pub fn get_premium_redeem_vaults( + redeem_transaction_size: u32, + ) -> Result, Amount)>, DispatchError> { + >::get_premium_redeem_vaults(redeem_transaction_size) + } + + pub fn get_vault_max_premium_redeem( + vault_id: &DefaultVaultId, + ) -> Result, DispatchError> { + >::get_vault_max_premium_redeem(vault_id) + } + pub fn get_liquidated_collateral( vault_id: &DefaultVaultId, ) -> Result, DispatchError> { @@ -120,13 +140,7 @@ pub(crate) mod vault_registry { } pub fn ensure_not_banned(vault_id: &DefaultVaultId) -> DispatchResult { - >::_ensure_not_banned(vault_id) - } - - pub fn is_vault_below_premium_threshold( - vault_id: &DefaultVaultId, - ) -> Result { - >::is_vault_below_premium_threshold(vault_id) + >::ensure_not_banned(vault_id) } pub fn is_vault_below_secure_threshold( @@ -193,20 +207,10 @@ pub(crate) mod security { } } -#[cfg_attr(test, mockable)] -pub(crate) mod oracle { - use crate::OracleKey; - use frame_support::dispatch::DispatchError; - use oracle::types::UnsignedFixedPoint; - - pub fn get_price(key: OracleKey) -> Result, DispatchError> { - >::get_price(key) - } -} - #[cfg_attr(test, mockable)] pub(crate) mod fee { use currency::Amount; + use fee::types::UnsignedFixedPoint; use frame_support::dispatch::{DispatchError, DispatchResult}; pub fn fee_pool_account_id() -> T::AccountId { @@ -225,7 +229,7 @@ pub(crate) mod fee { >::get_punishment_fee(amount) } - pub fn get_premium_redeem_fee(amount: &Amount) -> Result, DispatchError> { - >::get_premium_redeem_fee(amount) + pub fn premium_redeem_reward_rate() -> UnsignedFixedPoint { + >::premium_redeem_reward_rate() } } diff --git a/crates/redeem/src/lib.rs b/crates/redeem/src/lib.rs index 45943d7eb8..7d60e1c85f 100644 --- a/crates/redeem/src/lib.rs +++ b/crates/redeem/src/lib.rs @@ -32,7 +32,7 @@ pub use crate::types::{DefaultRedeemRequest, RedeemRequest, RedeemRequestStatus} use crate::types::{BalanceOf, RedeemRequestExt, Version}; use bitcoin::types::FullTransactionProof; use btc_relay::BtcAddress; -use currency::Amount; +use currency::{Amount, Rounding}; use frame_support::{ dispatch::{DispatchError, DispatchResult}, ensure, @@ -40,9 +40,7 @@ use frame_support::{ transactional, }; use frame_system::{ensure_root, ensure_signed}; -use oracle::OracleKey; use sp_core::H256; -use sp_runtime::{ArithmeticError, FixedPointNumber}; use sp_std::{convert::TryInto, vec::Vec}; use types::DefaultVaultId; use vault_registry::{ @@ -501,6 +499,21 @@ impl Pallet { Error::::AmountBelowDustAmount ); + let currency_id = vault_id.collateral_currency(); + + // Calculate the premium collateral amount based on whether the redemption is below the premium redeem + // threshold. This should come before increasing the `to_be_redeemed` tokens and locking the amount to + // ensure accurate premium redeem calculations. + let premium_collateral = { + let redeem_amount_wrapped_in_collateral = user_to_be_received_btc.convert_to(currency_id)?; + let premium_redeem_rate = ext::fee::premium_redeem_reward_rate::(); + let premium_for_redeem_amount = + redeem_amount_wrapped_in_collateral.checked_rounded_mul(&premium_redeem_rate, Rounding::Down)?; + + let max_premium = ext::vault_registry::get_vault_max_premium_redeem(&vault_id)?; + max_premium.min(&premium_for_redeem_amount)? + }; + // vault will get rid of the btc + btc_inclusion_fee ext::vault_registry::try_increase_to_be_redeemed_tokens::(&vault_id, &vault_to_be_burned_tokens)?; @@ -508,16 +521,6 @@ impl Pallet { amount_wrapped.lock_on(&redeemer)?; let redeem_id = ext::security::get_secure_id::(&redeemer); - let below_premium_redeem = ext::vault_registry::is_vault_below_premium_threshold::(&vault_id)?; - let currency_id = vault_id.collateral_currency(); - - let premium_collateral = if below_premium_redeem { - let redeem_amount_wrapped_in_collateral = user_to_be_received_btc.convert_to(currency_id)?; - ext::fee::get_premium_redeem_fee::(&redeem_amount_wrapped_in_collateral)? - } else { - Amount::zero(currency_id) - }; - Self::release_replace_collateral(&vault_id, &vault_to_be_burned_tokens)?; Self::insert_redeem_request( @@ -798,13 +801,7 @@ impl Pallet { /// the inclusion fee rate reported by the oracle pub fn get_current_inclusion_fee(wrapped_currency: CurrencyId) -> Result, DispatchError> { let size: u32 = Self::redeem_transaction_size(); - let satoshi_per_bytes = ext::oracle::get_price::(OracleKey::FeeEstimation)?; - - let fee = satoshi_per_bytes - .checked_mul_int(size) - .ok_or(ArithmeticError::Overflow)?; - let amount = fee.try_into().map_err(|_| Error::::TryIntoIntError)?; - Ok(Amount::new(amount, wrapped_currency)) + ext::vault_registry::calculate_inclusion_fee::(wrapped_currency, size) } pub fn get_dust_value(currency_id: CurrencyId) -> Amount { @@ -822,6 +819,11 @@ impl Pallet { .collect::>() } + pub fn get_premium_redeem_vaults() -> Result, Amount)>, DispatchError> { + let size: u32 = Self::redeem_transaction_size(); + ext::vault_registry::get_premium_redeem_vaults::(size) + } + /// Fetch all redeem requests for the specified vault. /// /// # Arguments diff --git a/crates/redeem/src/tests.rs b/crates/redeem/src/tests.rs index c31a0afd15..22ad2b24bb 100644 --- a/crates/redeem/src/tests.rs +++ b/crates/redeem/src/tests.rs @@ -182,7 +182,6 @@ fn test_request_redeem_succeeds_with_normal_redeem() { }); ext::security::get_secure_id::.mock_safe(move |_| MockResult::Return(H256([0; 32]))); - ext::vault_registry::is_vault_below_premium_threshold::.mock_safe(move |_| MockResult::Return(Ok(false))); ext::fee::get_redeem_fee::.mock_safe(move |_| MockResult::Return(Ok(wrapped(redeem_fee)))); let btc_fee = Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY).unwrap(); @@ -286,7 +285,6 @@ fn test_request_redeem_succeeds_with_self_redeem() { }); ext::security::get_secure_id::.mock_safe(move |_| MockResult::Return(H256::zero())); - ext::vault_registry::is_vault_below_premium_threshold::.mock_safe(move |_| MockResult::Return(Ok(false))); let btc_fee = Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY).unwrap(); assert_ok!(Redeem::request_redeem( @@ -760,8 +758,6 @@ mod spec_based_tests { ext::vault_registry::ensure_not_banned::.mock_safe(move |_vault_id| MockResult::Return(Ok(()))); ext::vault_registry::try_increase_to_be_redeemed_tokens:: .mock_safe(move |_vault_id, _amount| MockResult::Return(Ok(()))); - ext::vault_registry::is_vault_below_premium_threshold:: - .mock_safe(move |_vault_id| MockResult::Return(Ok(false))); let redeem_fee = Fee::get_redeem_fee(&wrapped(amount_to_redeem)).unwrap(); let burned_tokens = wrapped(amount_to_redeem) - redeem_fee; @@ -770,6 +766,8 @@ mod spec_based_tests { assert_eq!(tokens, &burned_tokens); MockResult::Return(Ok((wrapped(0), griefing(0)))) }); + ext::vault_registry::get_vault_max_premium_redeem:: + .mock_safe(|_| MockResult::Return(Ok(collateral(0)))); // The returned `replaceCollateral` MUST be released currency::Amount::unlock_on.mock_safe(move |collateral_amount, vault_id| { @@ -919,11 +917,11 @@ mod spec_based_tests { inject_redeem_request(H256([0u8; 32]), redeem_request.clone()); ext::btc_relay::has_request_expired::.mock_safe(|_, _, _| MockResult::Return(Ok(true))); - ext::vault_registry::is_vault_below_secure_threshold::.mock_safe(|_| MockResult::Return(Ok(false))); ext::vault_registry::ban_vault::.mock_safe(move |vault| { assert_eq!(vault, &VAULT); MockResult::Return(Ok(())) }); + ext::vault_registry::is_vault_below_secure_threshold::.mock_safe(|_| MockResult::Return(Ok(false))); Amount::::unlock_on.mock_safe(|_, _| MockResult::Return(Ok(()))); Amount::::transfer.mock_safe(|_, _, _| MockResult::Return(Ok(()))); ext::vault_registry::transfer_funds_saturated:: diff --git a/crates/replace/src/ext.rs b/crates/replace/src/ext.rs index 730d59c8cb..62457cfeba 100644 --- a/crates/replace/src/ext.rs +++ b/crates/replace/src/ext.rs @@ -81,7 +81,7 @@ pub(crate) mod vault_registry { } pub fn ensure_not_banned(vault_id: &DefaultVaultId) -> DispatchResult { - >::_ensure_not_banned(vault_id) + >::ensure_not_banned(vault_id) } pub fn try_increase_to_be_issued_tokens( diff --git a/crates/vault-registry/rpc/runtime-api/src/lib.rs b/crates/vault-registry/rpc/runtime-api/src/lib.rs index 838142f72d..b752770357 100644 --- a/crates/vault-registry/rpc/runtime-api/src/lib.rs +++ b/crates/vault-registry/rpc/runtime-api/src/lib.rs @@ -24,9 +24,6 @@ sp_api::decl_runtime_apis! { /// Get the vault's collateral (including nomination) fn get_vault_total_collateral(vault_id: VaultId) -> Result, DispatchError>; - /// Get all vaults below the premium redeem threshold, ordered in descending order of this amount - fn get_premium_redeem_vaults() -> Result)>, DispatchError>; - /// Get all vaults with non-zero issuable tokens, ordered in descending order of this amount fn get_vaults_with_issuable_tokens() -> Result)>, DispatchError>; diff --git a/crates/vault-registry/rpc/src/lib.rs b/crates/vault-registry/rpc/src/lib.rs index c538d9284c..b3e479c5ac 100644 --- a/crates/vault-registry/rpc/src/lib.rs +++ b/crates/vault-registry/rpc/src/lib.rs @@ -38,9 +38,6 @@ where at: Option, ) -> RpcResult>; - #[method(name = "vaultRegistry_getPremiumRedeemVaults")] - fn get_premium_redeem_vaults(&self, at: Option) -> RpcResult)>>; - #[method(name = "vaultRegistry_getVaultsWithIssuableTokens")] fn get_vaults_with_issuable_tokens( &self, @@ -179,19 +176,6 @@ where ) } - fn get_premium_redeem_vaults( - &self, - at: Option<::Hash>, - ) -> RpcResult)>> { - let api = self.client.runtime_api(); - let at = at.unwrap_or_else(|| self.client.info().best_hash); - - handle_response( - api.get_premium_redeem_vaults(at), - "Unable to find a vault below the premium redeem threshold".into(), - ) - } - fn get_vaults_with_issuable_tokens( &self, at: Option<::Hash>, diff --git a/crates/vault-registry/src/ext.rs b/crates/vault-registry/src/ext.rs index 72a3571cf4..0bf4f5de5b 100644 --- a/crates/vault-registry/src/ext.rs +++ b/crates/vault-registry/src/ext.rs @@ -110,12 +110,31 @@ pub(crate) mod capacity { } } +#[cfg_attr(test, mockable)] +pub(crate) mod oracle { + use frame_support::dispatch::DispatchError; + use oracle::{types::UnsignedFixedPoint, OracleKey}; + + pub fn get_price(key: OracleKey) -> Result, DispatchError> { + >::get_price(key) + } +} + #[cfg_attr(test, mockable)] pub(crate) mod fee { use crate::DefaultVaultId; + use fee::types::UnsignedFixedPoint; use frame_support::dispatch::DispatchResult; pub fn distribute_all_vault_rewards(vault_id: &DefaultVaultId) -> DispatchResult { >::distribute_all_vault_rewards(vault_id) } + + pub fn premium_redeem_reward_rate() -> UnsignedFixedPoint { + >::premium_redeem_reward_rate() + } + + pub fn get_redeem_fee_value() -> UnsignedFixedPoint { + >::get_redeem_fee_value() + } } diff --git a/crates/vault-registry/src/lib.rs b/crates/vault-registry/src/lib.rs index e6359400da..c89e03ad51 100644 --- a/crates/vault-registry/src/lib.rs +++ b/crates/vault-registry/src/lib.rs @@ -52,11 +52,12 @@ use frame_system::{ ensure_signed, offchain::{SendTransactionTypes, SubmitTransaction}, }; +use oracle::OracleKey; use sp_core::{H256, U256}; use sp_runtime::{ traits::*, transaction_validity::{InvalidTransaction, TransactionSource, TransactionValidity, ValidTransaction}, - ArithmeticError, + ArithmeticError, FixedPointNumber, }; use sp_std::{convert::TryInto, vec::Vec}; use traits::NominationApi; @@ -774,6 +775,51 @@ impl Pallet { ext::staking::total_current_stake::(vault_id) } + /// Calculate the maximum premium that can be given by a vault. + /// + /// # Arguments + /// * `vault_id` - The identifier of the vault for which the maximum premium is being calculated. + /// + /// # Returns + /// Returns a `Result` containing the calculated maximum premium as an `Amount`. + pub fn get_vault_max_premium_redeem(vault_id: &DefaultVaultId) -> Result, DispatchError> { + // The goal of premium redeems is to get the vault back the a healthy collateralization ratio. As such, + // we only award a premium for the amount of tokens required to get the vault back to secure threshold. + // The CollateralizationRate is defined as `totalCollateral / convertToCollateral(totalTokens)` + // When paying a premium, the collateralization rate gets updated according to the following formula: + // `NewCollateralization = (oldCol - awardedPremium) / ( oldTokens*EXCH - awardedPremium/FEE)` + // To calculate the maximum premium we are willing to pay, we set the newCollateralization to + // the secure threshold, which gives: + // `SECURE = (oldCol - awardedPremium) / (oldTokens*EXCH - awardedPremium/FEE)`` + // We can rewrite this formula to calculate the `premium` amount that would get us to the secure threshold: + // `maxPremium = (oldTokens * EXCH * SECURE - oldCol) * (FEE / (SECURE - FEE))` + // Which can be interpreted as: + // `maxPremium = missingCollateral * (FEE / (SECURE - FEE)) + + // Note that to prevent repeated premium redeems while waiting for execution, we use to_be_backed_tokens + // for `oldCol`, which takes into account pending issues and redeems + let to_be_backed_tokens = Self::vault_to_be_backed_tokens(&vault_id)?; + let global_secure_threshold = Self::get_global_secure_threshold(&vault_id.currencies)?; + let premium_redeem_rate = ext::fee::premium_redeem_reward_rate::(); + + let required_collateral = + Self::get_required_collateral_for_wrapped(&to_be_backed_tokens, vault_id.collateral_currency())?; + let current_collateral = Self::get_backing_collateral(&vault_id)?; + let missing_collateral = required_collateral.saturating_sub(¤t_collateral)?; + + // factor = fee / (secure - fee) + let factor = premium_redeem_rate + .checked_div( + &global_secure_threshold + .checked_sub(&premium_redeem_rate) + .ok_or(ArithmeticError::Underflow)?, + ) + .ok_or(ArithmeticError::DivisionByZero)?; + + let max_premium = missing_collateral.checked_mul(&factor)?; + Ok(max_premium) + } + pub fn get_liquidated_collateral(vault_id: &DefaultVaultId) -> Result, DispatchError> { let vault = Self::get_vault_from_id(vault_id)?; Ok(Amount::new(vault.liquidated_collateral, vault_id.currencies.collateral)) @@ -1089,6 +1135,25 @@ impl Pallet { Ok(()) } + /// Get the global secure threshold for a specified currency pair. + /// + /// # Arguments + /// * `currency_pair` - The currency pair for which to retrieve the global secure threshold. + /// + /// # Returns + /// Returns the global secure threshold for the specified currency pair or an error if the threshold is not set. + /// + /// # Errors + /// * `ThresholdNotSet` - If the secure collateral threshold for the given `currency_pair` is not set. + #[cfg_attr(feature = "integration-tests", visibility::make(pub))] + fn get_global_secure_threshold( + currency_pair: &VaultCurrencyPair>, + ) -> Result, DispatchError> { + let global_secure_threshold = + Self::secure_collateral_threshold(¤cy_pair).ok_or(Error::::ThresholdNotSet)?; + Ok(global_secure_threshold) + } + /// Adds an amount tokens to the to-be-redeemed tokens balance of a vault. /// This function serves as a prevention against race conditions in the /// redeem and replace procedures. If, for example, a vault would receive @@ -1482,7 +1547,7 @@ impl Pallet { Ok(()) } - pub fn _ensure_not_banned(vault_id: &DefaultVaultId) -> DispatchResult { + pub fn ensure_not_banned(vault_id: &DefaultVaultId) -> DispatchResult { let vault = Self::get_active_rich_vault_from_id(&vault_id)?; vault.ensure_not_banned() } @@ -1491,16 +1556,21 @@ impl Pallet { pub fn is_vault_below_secure_threshold(vault_id: &DefaultVaultId) -> Result { let vault = Self::get_rich_vault_from_id(&vault_id)?; let threshold = vault.get_secure_threshold()?; - Self::is_vault_below_threshold(vault_id, threshold) + Self::is_vault_below_certain_threshold(vault_id, threshold) } pub fn is_vault_liquidated(vault_id: &DefaultVaultId) -> Result { Ok(Self::get_vault_from_id(&vault_id)?.is_liquidated()) } - pub fn is_vault_below_premium_threshold(vault_id: &DefaultVaultId) -> Result { + // note: unlike `is_vault_below_secure_threshold` and `is_vault_below_liquidation_threshold`, + // this function uses to_be_backed tokens + pub fn will_be_below_premium_threshold(vault_id: &DefaultVaultId) -> Result { + let vault = Self::get_rich_vault_from_id(&vault_id)?; let threshold = Self::premium_redeem_threshold(&vault_id.currencies).ok_or(Error::::ThresholdNotSet)?; - Self::is_vault_below_threshold(vault_id, threshold) + let collateral = Self::get_backing_collateral(vault_id)?; + + Self::is_collateral_below_threshold(&collateral, &vault.to_be_backed_tokens()?, threshold) } /// check if the vault is below the liquidation threshold. @@ -1588,22 +1658,62 @@ impl Pallet { .collect(); Ok(vaults) } + + /// Calculates the inclusion fee for a redeem transaction based on the provided parameters. + pub fn calculate_inclusion_fee( + wrapped_currency: CurrencyId, + redeem_tx_size: u32, + ) -> Result, DispatchError> { + let satoshi_per_bytes = ext::oracle::get_price::(OracleKey::FeeEstimation)?; + + let fee = satoshi_per_bytes + .checked_mul_int(redeem_tx_size) + .ok_or(ArithmeticError::Overflow)?; + let amount = fee.try_into().map_err(|_| Error::::TryIntoIntError)?; + Ok(Amount::new(amount, wrapped_currency)) + } + /// Get all vaults that: /// - are below the premium redeem threshold, and /// - have a non-zero amount of redeemable tokens, and thus /// - are not banned /// - /// Maybe returns a tuple of (VaultId, RedeemableTokens) - /// The redeemable tokens are the currently vault.issued_tokens - the vault.to_be_redeemed_tokens - pub fn get_premium_redeem_vaults() -> Result, Amount)>, DispatchError> { - let mut suitable_vaults = Vaults::::iter() - .filter_map(|(vault_id, vault)| { - let rich_vault: RichVault = vault.into(); + /// Return a tuple of (VaultId, RedeemTokens to get `max_premium` from vault) + pub fn get_premium_redeem_vaults( + redeem_transaction_size: u32, + ) -> Result, Amount)>, DispatchError> { + let premium_reward_rate = ext::fee::premium_redeem_reward_rate::(); - let redeemable_tokens = rich_vault.redeemable_tokens().ok()?; - - if !redeemable_tokens.is_zero() && Self::is_vault_below_premium_threshold(&vault_id).unwrap_or(false) { - Some((vault_id, redeemable_tokens)) + let mut suitable_vaults = Vaults::::iter() + .filter_map(|(vault_id, _vault)| { + // The calculation to calculate redeem tokens to get `max_premium` is referenced from + // redeem pallet `request_redeem` method. + // BurnTokensForReachingPremiumThreshold = BurnWrap + InclusionFee + // RedeemTokens = BurnTokensForReachingPremiumThreshold / (1 - RedeemFee) + let max_premium_in_collateral = Self::get_vault_max_premium_redeem(&vault_id).ok()?; + let redeem_amount_wrapped_in_collateral = + max_premium_in_collateral.checked_div(&premium_reward_rate).ok()?; + let burn_wrap = redeem_amount_wrapped_in_collateral + .convert_to(vault_id.wrapped_currency()) + .ok()?; + let inclusion_fee = + Self::calculate_inclusion_fee(vault_id.wrapped_currency(), redeem_transaction_size).ok()?; + + let vault_to_burn_tokens = burn_wrap.checked_add(&inclusion_fee).ok()?; + + let redeem_fee = ext::fee::get_redeem_fee_value::(); + let amount_wrapped = UnsignedFixedPoint::::one().saturating_sub(redeem_fee); + + let request_redeem_tokens_for_max_premium = vault_to_burn_tokens.checked_div(&amount_wrapped).ok()?; + + if Self::ensure_not_banned(&vault_id).is_ok() + && !request_redeem_tokens_for_max_premium.is_zero() + // Need to check `will_be_below_premium_threshold` to handle a corner case + // where the vault is above PremiumThreshold, but `request_redeem_tokens_for_max_premium` is being calculated as a non-zero amount + // since the `inclusion_fee` is a non-zero amount. + && Self::will_be_below_premium_threshold(&vault_id).unwrap_or(false) + { + Some((vault_id, request_redeem_tokens_for_max_premium)) } else { None } @@ -1838,7 +1948,8 @@ impl Pallet { collateral_in_wrapped.ratio(&issued_tokens) } - fn is_vault_below_threshold( + #[cfg_attr(feature = "integration-tests", visibility::make(pub))] + fn is_vault_below_certain_threshold( vault_id: &DefaultVaultId, threshold: UnsignedFixedPoint, ) -> Result { @@ -1886,6 +1997,11 @@ impl Pallet { collateral.convert_to(wrapped_currency)?.checked_div(&threshold) } + fn vault_to_be_backed_tokens(vault_id: &DefaultVaultId) -> Result, DispatchError> { + let vault = Self::get_active_rich_vault_from_id(vault_id)?; + vault.to_be_backed_tokens() + } + pub fn new_vault_deposit_address( vault_id: &DefaultVaultId, secure_id: H256, diff --git a/crates/vault-registry/src/tests.rs b/crates/vault-registry/src/tests.rs index cd1dd05cc2..8db94062c7 100644 --- a/crates/vault-registry/src/tests.rs +++ b/crates/vault-registry/src/tests.rs @@ -987,12 +987,17 @@ fn get_settled_collateralization_from_vault_succeeds() { mod get_vaults_below_premium_collaterlization_tests { use super::{assert_eq, *}; + use crate::ext; /// sets premium_redeem threshold to 1 pub fn run_test(test: impl FnOnce()) { super::run_test(|| { VaultRegistry::_set_secure_collateral_threshold(DEFAULT_CURRENCY_PAIR, FixedU128::from_float(0.001)); VaultRegistry::_set_premium_redeem_threshold(DEFAULT_CURRENCY_PAIR, FixedU128::one()); + ext::fee::premium_redeem_reward_rate:: + .mock_safe(move || MockResult::Return(FixedU128::from_float(0.05))); + ext::oracle::get_price::.mock_safe(move |_| MockResult::Return(Ok(3.into()))); + ext::fee::get_redeem_fee_value::.mock_safe(move || MockResult::Return(FixedU128::from_float(0.005))); test() }) @@ -1016,7 +1021,7 @@ mod get_vaults_below_premium_collaterlization_tests { add_vault(vault_id(4), 50, 100); assert_err!( - VaultRegistry::get_premium_redeem_vaults(), + VaultRegistry::get_premium_redeem_vaults(10_u32), TestError::NoVaultUnderThePremiumRedeemThreshold ); }) @@ -1036,8 +1041,12 @@ mod get_vaults_below_premium_collaterlization_tests { add_vault(id1.clone(), issue_tokens1, collateral1); add_vault(id2.clone(), issue_tokens2, collateral2); + // set back secure threshold + let secure = UnsignedFixedPoint::checked_from_rational(200, 100).unwrap(); // 200% + VaultRegistry::_set_secure_collateral_threshold(DEFAULT_CURRENCY_PAIR, secure); + assert_eq!( - VaultRegistry::get_premium_redeem_vaults(), + VaultRegistry::get_premium_redeem_vaults(10_u32), Ok(vec![(id1, wrapped(issue_tokens1)), (id2, wrapped(issue_tokens2))]) ); }) @@ -1066,8 +1075,12 @@ mod get_vaults_below_premium_collaterlization_tests { let mut vault3 = VaultRegistry::get_active_rich_vault_from_id(&id3).unwrap(); vault3.ban_until(1000); + // set back secure threshold + let secure = UnsignedFixedPoint::checked_from_rational(200, 100).unwrap(); // 200% + VaultRegistry::_set_secure_collateral_threshold(DEFAULT_CURRENCY_PAIR, secure); + assert_eq!( - VaultRegistry::get_premium_redeem_vaults(), + VaultRegistry::get_premium_redeem_vaults(10_u32), Ok(vec!((id2, wrapped(issue_tokens2)))) ); }) diff --git a/crates/vault-registry/src/types.rs b/crates/vault-registry/src/types.rs index d96a7760f3..cb57a18cf6 100644 --- a/crates/vault-registry/src/types.rs +++ b/crates/vault-registry/src/types.rs @@ -102,7 +102,7 @@ impl CurrencySource { pub(crate) type BalanceOf = ::Balance; -pub(crate) type UnsignedFixedPoint = ::UnsignedFixedPoint; +pub type UnsignedFixedPoint = ::UnsignedFixedPoint; pub type CurrencyId = ::CurrencyId; @@ -381,6 +381,18 @@ impl RichVault { Ok(Amount::new(amount, self.wrapped_currency())) } + /// the number of issued tokens if all issues and redeems execute successfully + pub(crate) fn to_be_backed_tokens(&self) -> Result, DispatchError> { + let amount = self + .data + .issued_tokens + .checked_add(&self.data.to_be_issued_tokens) + .ok_or(ArithmeticError::Overflow)? + .checked_sub(&self.data.to_be_redeemed_tokens) + .ok_or(ArithmeticError::Underflow)?; + Ok(Amount::new(amount, self.wrapped_currency())) + } + pub(crate) fn to_be_replaced_tokens(&self) -> Amount { Amount::new(self.data.to_be_replaced_tokens, self.wrapped_currency()) } diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index 04a38c600e..90daff86dd 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -1812,11 +1812,6 @@ impl_runtime_apis! { Ok(BalanceWrapper{amount:result.amount()}) } - fn get_premium_redeem_vaults() -> Result)>, DispatchError> { - let result = VaultRegistry::get_premium_redeem_vaults()?; - Ok(result.iter().map(|v| (v.0.clone(), BalanceWrapper{amount:v.1.amount()})).collect()) - } - fn get_vaults_with_issuable_tokens() -> Result)>, DispatchError> { let result = VaultRegistry::get_vaults_with_issuable_tokens()?; Ok(result.into_iter().map(|v| (v.0, BalanceWrapper{amount:v.1.amount()})).collect()) @@ -1943,6 +1938,8 @@ impl_runtime_apis! { impl redeem_rpc_runtime_api::RedeemApi< Block, + VaultId, + Balance, AccountId, H256, RedeemRequest @@ -1954,6 +1951,11 @@ impl_runtime_apis! { fn get_vault_redeem_requests(account_id: AccountId) -> Vec { Redeem::get_redeem_requests_for_vault(account_id) } + + fn get_premium_redeem_vaults() -> Result)>, DispatchError> { + let result = Redeem::get_premium_redeem_vaults()?; + Ok(result.iter().map(|v| (v.0.clone(), BalanceWrapper{amount:v.1.amount()})).collect()) + } } impl replace_rpc_runtime_api::ReplaceApi< diff --git a/parachain/runtime/interlay/src/weights/redeem.rs b/parachain/runtime/interlay/src/weights/redeem.rs index 07f30bc059..2b2ced5c79 100644 --- a/parachain/runtime/interlay/src/weights/redeem.rs +++ b/parachain/runtime/interlay/src/weights/redeem.rs @@ -2,31 +2,30 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-10-04, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// redeem // --extrinsic // * -// --chain -// interlay-dev -// --execution=wasm // --wasm-execution=compiled // --steps // 50 // --repeat // 10 -// --output -// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs +// --chain +// interlay-dev +// --output +// interlay_weights.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,122 +39,124 @@ pub struct WeightInfo(PhantomData); impl redeem::WeightInfo for WeightInfo { - /// Storage: Tokens Accounts (r:2 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Fee RedeemFee (r:1 w:0) - /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:2 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) - /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) - /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PremiumRedeemFee (r:1 w:0) - /// Proof: Fee PremiumRedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Fee::RedeemFee` (r:1 w:0) + /// Proof: `Fee::RedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemTransactionSize` (r:1 w:0) + /// Proof: `Redeem::RedeemTransactionSize` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:2 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemBtcDustValue` (r:1 w:0) + /// Proof: `Redeem::RedeemBtcDustValue` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PremiumRedeemThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::PremiumRedeemThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Fee::PremiumRedeemFee` (r:1 w:0) + /// Proof: `Fee::PremiumRedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Security::Nonce` (r:1 w:1) + /// Proof: `Security::Nonce` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `System::ParentHash` (r:1 w:0) + /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemRequests` (r:0 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3155` + // Measured: `3219` // Estimated: `6260` - // Minimum execution time: 310_652_000 picoseconds. - Weight::from_parts(313_168_000, 6260) - .saturating_add(T::DbWeight::get().reads(28_u64)) + // Minimum execution time: 226_000_000 picoseconds. + Weight::from_parts(230_000_000, 6260) + .saturating_add(T::DbWeight::get().reads(29_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry LiquidationVault (r:1 w:1) - /// Proof: VaultRegistry LiquidationVault (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:1 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::LiquidationVault` (r:1 w:1) + /// Proof: `VaultRegistry::LiquidationVault` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:1 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: // Measured: `2173` // Estimated: `8760` - // Minimum execution time: 283_197_000 picoseconds. - Weight::from_parts(284_509_000, 8760) + // Minimum execution time: 139_000_000 picoseconds. + Weight::from_parts(141_000_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableInclusionCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableInclusionCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:1 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableParachainConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableParachainConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. @@ -164,235 +165,235 @@ impl redeem::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2295 + o * (1 ±0)` // Estimated: `3725` - // Minimum execution time: 183_618_000 picoseconds. - Weight::from_parts(155_534_743, 3725) - // Standard Error: 117_935 - .saturating_add(Weight::from_parts(3_687_939, 0).saturating_mul(h.into())) - // Standard Error: 106_320 - .saturating_add(Weight::from_parts(952_959, 0).saturating_mul(i.into())) - // Standard Error: 644_527 - .saturating_add(Weight::from_parts(862_990, 0).saturating_mul(o.into())) - // Standard Error: 649 - .saturating_add(Weight::from_parts(4_928, 0).saturating_mul(b.into())) + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(55_152_275, 3725) + // Standard Error: 149_738 + .saturating_add(Weight::from_parts(2_508_576, 0).saturating_mul(h.into())) + // Standard Error: 134_990 + .saturating_add(Weight::from_parts(994_344, 0).saturating_mul(i.into())) + // Standard Error: 818_328 + .saturating_add(Weight::from_parts(3_299_475, 0).saturating_mul(o.into())) + // Standard Error: 824 + .saturating_add(Weight::from_parts(5_210, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:2 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: // Measured: `5396` // Estimated: `11350` - // Minimum execution time: 847_787_000 picoseconds. - Weight::from_parts(851_295_000, 11350) + // Minimum execution time: 495_000_000 picoseconds. + Weight::from_parts(510_000_000, 11350) .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: // Measured: `5396` // Estimated: `11350` - // Minimum execution time: 775_122_000 picoseconds. - Weight::from_parts(783_890_000, 11350) + // Minimum execution time: 406_000_000 picoseconds. + Weight::from_parts(412_000_000, 11350) .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } - /// Storage: Redeem RedeemPeriod (r:0 w:1) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemPeriod` (r:0 w:1) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn set_redeem_period () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_136_000 picoseconds. - Weight::from_parts(18_727_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) fn self_redeem () -> Weight { // Proof Size summary in bytes: // Measured: `1427` // Estimated: `3725` - // Minimum execution time: 149_329_000 picoseconds. - Weight::from_parts(152_415_000, 3725) + // Minimum execution time: 71_000_000 picoseconds. + Weight::from_parts(72_000_000, 3725) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index 5c92592bbe..e689706719 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -1683,11 +1683,6 @@ impl_runtime_apis! { Ok(BalanceWrapper{amount:result.amount()}) } - fn get_premium_redeem_vaults() -> Result)>, DispatchError> { - let result = VaultRegistry::get_premium_redeem_vaults()?; - Ok(result.iter().map(|v| (v.0.clone(), BalanceWrapper{amount:v.1.amount()})).collect()) - } - fn get_vaults_with_issuable_tokens() -> Result)>, DispatchError> { let result = VaultRegistry::get_vaults_with_issuable_tokens()?; Ok(result.into_iter().map(|v| (v.0, BalanceWrapper{amount:v.1.amount()})).collect()) @@ -1814,6 +1809,8 @@ impl_runtime_apis! { impl redeem_rpc_runtime_api::RedeemApi< Block, + VaultId, + Balance, AccountId, H256, RedeemRequest @@ -1825,6 +1822,12 @@ impl_runtime_apis! { fn get_vault_redeem_requests(account_id: AccountId) -> Vec { Redeem::get_redeem_requests_for_vault(account_id) } + + + fn get_premium_redeem_vaults() -> Result)>, DispatchError> { + let result = Redeem::get_premium_redeem_vaults()?; + Ok(result.iter().map(|v| (v.0.clone(), BalanceWrapper{amount:v.1.amount()})).collect()) + } } impl replace_rpc_runtime_api::ReplaceApi< diff --git a/parachain/runtime/kintsugi/src/weights/redeem.rs b/parachain/runtime/kintsugi/src/weights/redeem.rs index ca3aee803b..65a6a95a0a 100644 --- a/parachain/runtime/kintsugi/src/weights/redeem.rs +++ b/parachain/runtime/kintsugi/src/weights/redeem.rs @@ -2,31 +2,30 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-10-04, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// redeem // --extrinsic // * -// --chain -// kintsugi-dev -// --execution=wasm // --wasm-execution=compiled // --steps // 50 // --repeat // 10 -// --output -// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs +// --chain +// kintsugi-dev +// --output +// kintsugi_weights.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,359 +39,357 @@ pub struct WeightInfo(PhantomData); impl redeem::WeightInfo for WeightInfo { - /// Storage: Tokens Accounts (r:2 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Fee RedeemFee (r:1 w:0) - /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:2 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) - /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) - /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PremiumRedeemFee (r:1 w:0) - /// Proof: Fee PremiumRedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Fee::RedeemFee` (r:1 w:0) + /// Proof: `Fee::RedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemTransactionSize` (r:1 w:0) + /// Proof: `Redeem::RedeemTransactionSize` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:2 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemBtcDustValue` (r:1 w:0) + /// Proof: `Redeem::RedeemBtcDustValue` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PremiumRedeemThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::PremiumRedeemThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Fee::PremiumRedeemFee` (r:1 w:0) + /// Proof: `Fee::PremiumRedeemFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Security::Nonce` (r:1 w:1) + /// Proof: `Security::Nonce` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `System::ParentHash` (r:1 w:0) + /// Proof: `System::ParentHash` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemRequests` (r:0 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3189` + // Measured: `3307` // Estimated: `6260` - // Minimum execution time: 311_614_000 picoseconds. - Weight::from_parts(319_349_000, 6260) - .saturating_add(T::DbWeight::get().reads(28_u64)) + // Minimum execution time: 237_000_000 picoseconds. + Weight::from_parts(242_000_000, 6260) + .saturating_add(T::DbWeight::get().reads(29_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry LiquidationVault (r:1 w:1) - /// Proof: VaultRegistry LiquidationVault (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:1 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::LiquidationVault` (r:1 w:1) + /// Proof: `VaultRegistry::LiquidationVault` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:1 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2173` + // Measured: `2193` // Estimated: `8760` - // Minimum execution time: 287_687_000 picoseconds. - Weight::from_parts(292_145_000, 8760) + // Minimum execution time: 145_000_000 picoseconds. + Weight::from_parts(147_000_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableInclusionCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableInclusionCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:1 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableParachainConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableParachainConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, i: u32, _o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2295 + o * (1 ±0)` + // Measured: `2315 + o * (1 ±0)` // Estimated: `3725` - // Minimum execution time: 184_800_000 picoseconds. - Weight::from_parts(149_034_719, 3725) - // Standard Error: 137_585 - .saturating_add(Weight::from_parts(3_833_551, 0).saturating_mul(h.into())) - // Standard Error: 124_035 - .saturating_add(Weight::from_parts(1_176_171, 0).saturating_mul(i.into())) - // Standard Error: 751_913 - .saturating_add(Weight::from_parts(1_964_806, 0).saturating_mul(o.into())) - // Standard Error: 757 - .saturating_add(Weight::from_parts(5_490, 0).saturating_mul(b.into())) + // Minimum execution time: 92_000_000 picoseconds. + Weight::from_parts(98_367_431, 3725) + // Standard Error: 105_687 + .saturating_add(Weight::from_parts(1_774_333, 0).saturating_mul(h.into())) + // Standard Error: 95_278 + .saturating_add(Weight::from_parts(64_310, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:2 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `5430` + // Measured: `5450` // Estimated: `11350` - // Minimum execution time: 850_042_000 picoseconds. - Weight::from_parts(865_223_000, 11350) + // Minimum execution time: 437_000_000 picoseconds. + Weight::from_parts(444_000_000, 11350) .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } - /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - /// Storage: Redeem RedeemPeriod (r:1 w:0) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Loans Markets (r:2 w:0) - /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Fee PunishmentFee (r:1 w:0) - /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:0) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:1) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:2 w:2) - /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Loans RewardAccrued (r:2 w:2) - /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) - /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemRequests` (r:1 w:1) + /// Proof: `Redeem::RedeemRequests` (`max_values`: None, `max_size`: Some(245), added: 2720, mode: `MaxEncodedLen`) + /// Storage: `Redeem::RedeemPeriod` (r:1 w:0) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:1 w:0) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Loans::UnderlyingAssetId` (r:1 w:0) + /// Proof: `Loans::UnderlyingAssetId` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + /// Storage: `Oracle::Aggregate` (r:1 w:0) + /// Proof: `Oracle::Aggregate` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) + /// Storage: `Loans::Markets` (r:2 w:0) + /// Proof: `Loans::Markets` (`max_values`: None, `max_size`: Some(160), added: 2635, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Loans::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `Loans::LastAccruedInterestTime` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:0) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalBorrows` (r:1 w:0) + /// Proof: `Loans::TotalBorrows` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::TotalReserves` (r:1 w:0) + /// Proof: `Loans::TotalReserves` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::MinExchangeRate` (r:1 w:0) + /// Proof: `Loans::MinExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Loans::MaxExchangeRate` (r:1 w:0) + /// Proof: `Loans::MaxExchangeRate` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Fee::PunishmentFee` (r:1 w:0) + /// Proof: `Fee::PunishmentFee` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::Nonce` (r:1 w:0) + /// Proof: `VaultStaking::Nonce` (`max_values`: None, `max_size`: Some(74), added: 2549, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalCurrentStake` (r:1 w:1) + /// Proof: `VaultStaking::TotalCurrentStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::TotalUserVaultCollateral` (r:1 w:1) + /// Proof: `VaultRegistry::TotalUserVaultCollateral` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::Stake` (r:1 w:1) + /// Proof: `VaultCapacity::Stake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardPerToken` (r:2 w:0) + /// Proof: `VaultCapacity::RewardPerToken` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardTally` (r:2 w:2) + /// Proof: `VaultCapacity::RewardTally` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalRewards` (r:2 w:2) + /// Proof: `VaultCapacity::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::Stake` (r:1 w:1) + /// Proof: `VaultRewards::Stake` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardPerToken` (r:2 w:0) + /// Proof: `VaultRewards::RewardPerToken` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardTally` (r:2 w:2) + /// Proof: `VaultRewards::RewardTally` (`max_values`: None, `max_size`: Some(124), added: 2599, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalRewards` (r:2 w:2) + /// Proof: `VaultRewards::TotalRewards` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Fee::Commission` (r:1 w:0) + /// Proof: `Fee::Commission` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::RewardPerToken` (r:2 w:2) + /// Proof: `VaultStaking::RewardPerToken` (`max_values`: None, `max_size`: Some(117), added: 2592, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::TotalStake` (r:1 w:0) + /// Proof: `VaultStaking::TotalStake` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultStaking::SlashPerToken` (r:1 w:1) + /// Proof: `VaultStaking::SlashPerToken` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::SecureCollateralThreshold` (r:1 w:0) + /// Proof: `VaultRegistry::SecureCollateralThreshold` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::TotalStake` (r:1 w:1) + /// Proof: `VaultRewards::TotalStake` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `VaultRewards::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultRewards::RewardCurrencies` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::TotalStake` (r:1 w:1) + /// Proof: `VaultCapacity::TotalStake` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `VaultCapacity::RewardCurrencies` (r:1 w:0) + /// Proof: `VaultCapacity::RewardCurrencies` (`max_values`: None, `max_size`: Some(39), added: 2514, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplyState` (r:1 w:1) + /// Proof: `Loans::RewardSupplyState` (`max_values`: None, `max_size`: Some(47), added: 2522, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplySpeed` (r:1 w:0) + /// Proof: `Loans::RewardSupplySpeed` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardSupplierIndex` (r:2 w:2) + /// Proof: `Loans::RewardSupplierIndex` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Loans::RewardAccrued` (r:2 w:2) + /// Proof: `Loans::RewardAccrued` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) + /// Storage: `Loans::AccountDeposits` (r:1 w:0) + /// Proof: `Loans::AccountDeposits` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `VaultRegistry::PunishmentDelay` (r:1 w:0) + /// Proof: `VaultRegistry::PunishmentDelay` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `5430` + // Measured: `5450` // Estimated: `11350` - // Minimum execution time: 773_779_000 picoseconds. - Weight::from_parts(789_120_000, 11350) + // Minimum execution time: 399_000_000 picoseconds. + Weight::from_parts(401_000_000, 11350) .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } - /// Storage: Redeem RedeemPeriod (r:0 w:1) - /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Redeem::RedeemPeriod` (r:0 w:1) + /// Proof: `Redeem::RedeemPeriod` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn set_redeem_period () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_106_000 picoseconds. - Weight::from_parts(18_667_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: `VaultRegistry::Vaults` (r:1 w:1) + /// Proof: `VaultRegistry::Vaults` (`max_values`: None, `max_size`: Some(260), added: 2735, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(35), added: 2510, mode: `MaxEncodedLen`) fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1427` + // Measured: `1447` // Estimated: `3725` - // Minimum execution time: 150_121_000 picoseconds. - Weight::from_parts(151_013_000, 3725) + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(72_000_000, 3725) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } diff --git a/parachain/runtime/runtime-tests/src/parachain/redeem.rs b/parachain/runtime/runtime-tests/src/parachain/redeem.rs index 16cf7ae147..acd5c9af30 100644 --- a/parachain/runtime/runtime-tests/src/parachain/redeem.rs +++ b/parachain/runtime/runtime-tests/src/parachain/redeem.rs @@ -9,29 +9,42 @@ fn test_with(execute: impl Fn(VaultId) -> R) { let test_with = |collateral_id, wrapped_id, extra_vault_currency| { ExtBuilder::build().execute_with(|| { let vault_id = PrimitiveVaultId::new(account_of(VAULT), collateral_id, wrapped_id); - SecurityPallet::set_active_block_number(1); - for currency_id in iter_collateral_currencies().filter(|c| !c.is_lend_token()) { - assert_ok!(OraclePallet::_set_exchange_rate(currency_id, FixedU128::one())); - } - if wrapped_id != DEFAULT_WRAPPED_CURRENCY { - assert_ok!(OraclePallet::_set_exchange_rate(wrapped_id, FixedU128::one())); - } - activate_lending_and_mint(Token(DOT), LendToken(1)); - set_default_thresholds(); - LiquidationVaultData::force_to(default_liquidation_vault_state(&vault_id.currencies)); - UserData::force_to(USER, default_user_state()); - CoreVaultData::force_to(&vault_id, default_vault_state(&vault_id)); - // additional vault in order to prevent the edge case where the fee pool does not - // get additional funds because there are no non-liquidated vaults left - let carol_vault_id = PrimitiveVaultId::new(account_of(CAROL), collateral_id, wrapped_id); - CoreVaultData::force_to(&carol_vault_id, default_vault_state(&carol_vault_id)); - - if let Some(other_currency) = extra_vault_currency { - assert_ok!(OraclePallet::_set_exchange_rate(other_currency, FixedU128::one())); - // check that having other vault with the same account id does not influence tests - let other_vault_id = vault_id_of(VAULT, other_currency); - CoreVaultData::force_to(&other_vault_id, default_vault_state(&other_vault_id)); - } + common_setup::( + wrapped_id, + extra_vault_currency, + collateral_id, + vault_id.clone(), + FixedU128::one(), + None, + ); + execute(vault_id) + }) + }; + + test_with(Token(DOT), Token(KBTC), None); + test_with(Token(DOT), Token(IBTC), None); + test_with(Token(DOT), Token(IBTC), Some(Token(KSM))); + test_with(Token(KSM), Token(IBTC), None); + test_with(ForeignAsset(1), Token(IBTC), None); + test_with(LendToken(1), Token(IBTC), None); +} + +fn test_setup_for_premium_redeem(execute: impl Fn(VaultId) -> R) { + let test_with = |collateral_id, wrapped_id, extra_vault_currency: Option| { + ExtBuilder::build().execute_with(|| { + let secure = FixedU128::checked_from_rational(200, 100).unwrap(); + let premium = FixedU128::checked_from_rational(160, 100).unwrap(); + let liquidation = FixedU128::checked_from_rational(110, 100).unwrap(); + + let vault_id = PrimitiveVaultId::new(account_of(VAULT), collateral_id, wrapped_id); + common_setup::( + wrapped_id, + extra_vault_currency, + collateral_id, + vault_id.clone(), + FixedU128::from(2), + Some((secure, premium, liquidation)), + ); execute(vault_id) }) }; @@ -44,6 +57,46 @@ fn test_with(execute: impl Fn(VaultId) -> R) { test_with(LendToken(1), Token(IBTC), None); } +fn common_setup( + wrapped_id: CurrencyId, + extra_vault_currency: Option, + collateral_id: CurrencyId, + vault_id: VaultId, + exchange_rate: FixedU128, + custom_thresholds: Option<(FixedU128, FixedU128, FixedU128)>, +) { + SecurityPallet::set_active_block_number(1); + for currency_id in iter_collateral_currencies().filter(|c| !c.is_lend_token()) { + assert_ok!(OraclePallet::_set_exchange_rate(currency_id, exchange_rate)); + } + if wrapped_id != DEFAULT_WRAPPED_CURRENCY { + assert_ok!(OraclePallet::_set_exchange_rate(wrapped_id, FixedU128::one())); + } + + activate_lending_and_mint(Token(DOT), LendToken(1)); + + if let Some((secure, premium, liquidation)) = custom_thresholds { + set_custom_thresholds(secure, premium, liquidation); + } else { + set_default_thresholds(); + } + + LiquidationVaultData::force_to(default_liquidation_vault_state(&vault_id.currencies)); + UserData::force_to(USER, default_user_state()); + CoreVaultData::force_to(&vault_id, default_vault_state(&vault_id)); + // additional vault in order to prevent the edge case where the fee pool does not + // get additional funds because there are no non-liquidated vaults left + let carol_vault_id = PrimitiveVaultId::new(account_of(CAROL), collateral_id, wrapped_id); + CoreVaultData::force_to(&carol_vault_id, default_vault_state(&carol_vault_id)); + + if let Some(other_currency) = extra_vault_currency { + assert_ok!(OraclePallet::_set_exchange_rate(other_currency, FixedU128::one())); + // check that having other vault with the same account id does not influence tests + let other_vault_id = vault_id_of(VAULT, other_currency); + CoreVaultData::force_to(&other_vault_id, default_vault_state(&other_vault_id)); + } +} + /// to-be-replaced & replace_collateral are decreased in request_redeem fn consume_to_be_replaced(vault: &mut CoreVaultData, amount_btc: Amount) { let to_be_replaced_decrease = amount_btc.min(&vault.to_be_replaced).unwrap(); @@ -58,6 +111,212 @@ fn consume_to_be_replaced(vault: &mut CoreVaultData, amount_btc: Amount vault.to_be_replaced -= to_be_replaced_decrease; } +mod premium_redeem_tests { + use super::{assert_eq, *}; + + fn setup_vault_below_premium_threshold(vault_id: VaultId) { + // with 2000 collateral and exchange rate at 2, the vault is at: + // - secure threshold (200%) when it has 2000/2/2 = 500 tokens + // - premium threshold (160%) when it has 2000/2/1.6 = 625 tokens + + // we award premium redeem only for the amount needed for (issued + to_be_issued - to_be_redeemed) + // to reach the secure threshold + + // setup the vault such that (issued + to_be_issued - to_be_redeemed) = (450 + 250 - 50) = 650 + // (everything scaled by 1000 to prevent getting dust amount errors) + CoreVaultData::force_to( + &vault_id, + CoreVaultData { + issued: vault_id.wrapped(450_000_000), + to_be_issued: vault_id.wrapped(250_000_000), + to_be_redeemed: vault_id.wrapped(50_000_000), + backing_collateral: vault_id.collateral(2_000_000_000), + to_be_replaced: vault_id.wrapped(0), + replace_collateral: griefing(0), + ..default_vault_state(&vault_id) + }, + ); + + // make sure user has enough tokens to redeem + let mut user_state = UserData::get(USER); + (*user_state.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free = + (*user_state.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free * 1000; + UserData::force_to(USER, user_state); + } + + #[test] + fn integration_test_premium_redeem_with_reward_for_only_part_of_the_request() { + test_setup_for_premium_redeem(|vault_id| { + setup_vault_below_premium_threshold(vault_id.clone()); + + assert!(!VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + + let compute_collateral = VaultRegistryPallet::compute_collateral(&vault_id).unwrap().amount(); + assert_eq!(compute_collateral, 2_000_000_000); + + let initial_state = ParachainState::get(&vault_id); + + let redeem_id = setup_redeem(vault_id.wrapped(400_000_000), USER, &vault_id); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert!(!VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(!VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + + dry_run(|| { + // further redeems will have no rewards, even though the premium redeem + // has not executed yet + let redeem_id = setup_redeem(vault_id.wrapped(2_000_000), USER, &vault_id); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + assert_eq!(redeem.premium, 0); + }); + + execute_redeem(redeem_id); + + assert_eq!( + ParachainState::get(&vault_id), + initial_state.with_changes(|user, vault, _, fee_pool| { + // premium transferred to user + // we should get rewarded only for 15.3846153846 *10^6 tokens (that's when we reach nearer to secure + // threshold) + let expected_premium = vault_id.collateral(15_384_615); + vault.backing_collateral -= expected_premium; + (*user.balances.get_mut(&vault_id.collateral_currency()).unwrap()).free += expected_premium; + + // bitcoin balance update as usual + (*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= + redeem.amount_btc() + redeem.fee() + redeem.transfer_fee_btc(); + vault.issued -= redeem.amount_btc() + redeem.transfer_fee_btc(); + *fee_pool.rewards_for(&vault_id) += redeem.fee(); + }) + ); + + // We already checked that redeems have no more rewards after requesting the + // premium redeem. Here we do a sanity check that it's still the case after + // execution + let redeem_id = setup_redeem(vault_id.wrapped(2_000_000), USER, &vault_id); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + assert_eq!(redeem.premium, 0); + }); + } + + #[test] + fn integration_test_try_get_premium_vaults_which_is_sufficiently_collateralized_then_under_collateralized() { + test_setup_for_premium_redeem(|vault_id| { + assert_noop!( + RedeemPallet::get_premium_redeem_vaults(), + VaultRegistryError::NoVaultUnderThePremiumRedeemThreshold + ); + + // put vault under premium redeem threshold + setup_vault_below_premium_threshold(vault_id.clone()); + assert_eq!(RedeemPallet::get_premium_redeem_vaults().unwrap().len(), 1); + }); + } + + #[test] + fn integration_test_redeem_max_premium_redeemable_token() { + test_setup_for_premium_redeem(|vault_id| { + setup_vault_below_premium_threshold(vault_id.clone()); + + let global_secure = VaultRegistryPallet::get_global_secure_threshold(&vault_id.currencies).unwrap(); // 200% + + // secure > premium > liquidation threshold + // at start the vault is above the custom&global secure threshold, but due to the to_be_issued + // tokens it is already eligible for premium redeem + assert!(!VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(!VaultRegistryPallet::is_vault_below_certain_threshold(&vault_id, global_secure).unwrap()); + assert!(VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + + // Change vault secure threshold, + // now custom secure > global secure > premium > liquidation threshold + let vault_custom_secure_threshold = UnsignedFixedPoint::checked_from_rational(300, 100); + assert_ok!( + RuntimeCall::VaultRegistry(VaultRegistryCall::set_custom_secure_threshold { + currency_pair: vault_id.currencies.clone(), + custom_threshold: vault_custom_secure_threshold, + }) + .dispatch(origin_of(vault_id.account_id.clone())) + ); + + // vault should be below premium & secure threshold, while above global secure threshold + assert!(VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(!VaultRegistryPallet::is_vault_below_certain_threshold(&vault_id, global_secure).unwrap()); + assert!(VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + + let max_premium_for_vault = VaultRegistryPallet::get_vault_max_premium_redeem(&vault_id).unwrap(); + // get premium redeem vaults + let premium_redeem_vaults = RedeemPallet::get_premium_redeem_vaults().unwrap()[0].clone(); + // non-zero amount of tokens that are elible for premium redeem + assert!(!premium_redeem_vaults.1.is_zero()); + + // request redeem tokens given by RPC + let redeem_id_1 = setup_redeem(premium_redeem_vaults.1, USER, &vault_id); + + let redeem_1 = RedeemPallet::get_open_redeem_request_from_id(&redeem_id_1).unwrap(); + // premium should be equal to max premium, but allow rounding error in this check. + assert!( + redeem_1.premium >= max_premium_for_vault.amount() - 1 + && redeem_1.premium <= max_premium_for_vault.amount() + 1 + ); + assert!(!redeem_1.premium.is_zero()); + + // max premium for vault should be zero + let max_premium_for_vault = VaultRegistryPallet::get_vault_max_premium_redeem(&vault_id).unwrap(); + assert!(max_premium_for_vault.amount().is_zero()); + + // redeeming the max premium amount put backs vault above premium threshold + // vault should be below secure threshold, while above global secure & premium threshold + assert!(VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(!VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + assert!(!VaultRegistryPallet::is_vault_below_certain_threshold(&vault_id, global_secure).unwrap()); + + execute_redeem(redeem_id_1); + // We should be almost exactly at the secure threshold (there should only be minor + // rounding errors) + let vault = CoreVaultData::vault(vault_id.clone()); + let future_tokens = vault.to_be_issued + vault.issued - vault.to_be_redeemed; + let collateral = vault.backing_collateral; + let future_ratio = collateral + .ratio(&future_tokens.convert_to(vault_id.collateral_currency()).unwrap()) + .unwrap(); + // actual collateralization rate: 2.000004822104648639. Allow small rounding changes + assert!(future_ratio - global_secure < FixedU128::from_float(0.00001)); + + let redeem_id_2 = setup_redeem(vault_id.wrapped(800_00), USER, &vault_id); + let redeem_2 = RedeemPallet::get_open_redeem_request_from_id(&redeem_id_2).unwrap(); + // no premium is given out for new redeems + assert!(redeem_2.premium.is_zero()); + }); + } + #[test] + fn integration_test_premium_redeem_with_reward_for_full_request() { + test_setup_for_premium_redeem(|vault_id| { + setup_vault_below_premium_threshold(vault_id.clone()); + + assert!(!VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + + let redeem_id = setup_redeem(vault_id.wrapped(100_000_000), USER, &vault_id); + + assert!(!VaultRegistryPallet::is_vault_below_secure_threshold(&vault_id).unwrap()); + assert!(!VaultRegistryPallet::will_be_below_premium_threshold(&vault_id).unwrap()); + + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + // we should get rewarded for the full amount, since we did not reach secure threshold + let expected_premium = FeePallet::get_premium_redeem_fee( + &vault_id + .wrapped(redeem.amount_btc) + .convert_to(vault_id.collateral_currency()) + .unwrap(), + ) + .unwrap(); + assert_eq!(vault_id.collateral(redeem.premium), expected_premium); + }); + } +} + mod spec_based_tests { use primitives::VaultCurrencyPair; @@ -710,7 +969,7 @@ mod spec_based_tests { ); check_redeem_status(USER, RedeemRequestStatus::Reimbursed(true)); assert_noop!( - VaultRegistryPallet::_ensure_not_banned(&vault_id), + VaultRegistryPallet::ensure_not_banned(&vault_id), VaultRegistryError::VaultBanned ); }); @@ -843,7 +1102,7 @@ mod spec_based_tests { }) ); assert_noop!( - VaultRegistryPallet::_ensure_not_banned(&vault_id), + VaultRegistryPallet::ensure_not_banned(&vault_id), VaultRegistryError::VaultBanned ); }); @@ -1183,7 +1442,7 @@ fn integration_test_execute_redeem_on_banned_vault_succeeds() { // should now be banned assert_noop!( - VaultRegistryPallet::_ensure_not_banned(&vault_id), + VaultRegistryPallet::ensure_not_banned(&vault_id), VaultRegistryError::VaultBanned ); diff --git a/parachain/runtime/runtime-tests/src/utils.rs b/parachain/runtime/runtime-tests/src/utils.rs index de80c7b33c..b95eba183a 100644 --- a/parachain/runtime/runtime-tests/src/utils.rs +++ b/parachain/runtime/runtime-tests/src/utils.rs @@ -1004,6 +1004,20 @@ pub fn set_default_thresholds() { } } +pub fn set_custom_thresholds(secure: FixedU128, premium: FixedU128, liquidation: FixedU128) { + for collateral_id in iter_collateral_currencies() { + for wrapped_id in iter_wrapped_currencies() { + let currency_pair = VaultCurrencyPair { + collateral: collateral_id, + wrapped: wrapped_id, + }; + VaultRegistryPallet::_set_secure_collateral_threshold(currency_pair.clone(), secure); + VaultRegistryPallet::_set_premium_redeem_threshold(currency_pair.clone(), premium); + VaultRegistryPallet::_set_liquidation_collateral_threshold(currency_pair.clone(), liquidation); + } + } +} + pub fn dummy_public_key() -> BtcPublicKey { BtcPublicKey([ 2, 205, 114, 218, 156, 16, 235, 172, 106, 37, 18, 153, 202, 140, 176, 91, 207, 51, 187, 55, 18, 45, 222, 180, diff --git a/parachain/src/service.rs b/parachain/src/service.rs index 13eb51c1ca..03da257eec 100644 --- a/parachain/src/service.rs +++ b/parachain/src/service.rs @@ -109,6 +109,8 @@ pub trait RuntimeApiCollection: issue::IssueRequest, > + redeem_rpc_runtime_api::RedeemApi< Block, + VaultId, + Balance, AccountId, H256, redeem::RedeemRequest, @@ -157,6 +159,8 @@ where issue::IssueRequest, > + redeem_rpc_runtime_api::RedeemApi< Block, + VaultId, + Balance, AccountId, H256, redeem::RedeemRequest, diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 764a7f69e8..d86b3037da 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -87,6 +87,8 @@ where issue_rpc::IssueRuntimeApi>, C::Api: redeem_rpc::RedeemRuntimeApi< Block, + VaultId, + Balance, AccountId, H256, RedeemRequest,