From d5582e7625c080e244d8cb5cd2d0260588c3a8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A4=E7=8B=90=E4=B8=80=E5=86=B2?= <43949039+anonymousGiga@users.noreply.github.com> Date: Thu, 29 Dec 2022 17:21:05 +0800 Subject: [PATCH] update for relayer fee (#104) --- bridge/benchmarking/src/lib.rs | 12 ++--- bridge/src/lib.rs | 56 ++++++++++------------- bridge/src/nep141.rs | 3 +- bridge/src/nonfungible.rs | 8 +++- bridge/src/tests.rs | 16 +------ bridge/src/token.rs | 4 +- bridge/src/weights.rs | 84 +++++++++++++++++----------------- 7 files changed, 80 insertions(+), 103 deletions(-) diff --git a/bridge/benchmarking/src/lib.rs b/bridge/benchmarking/src/lib.rs index 79f69a3..fc4533f 100644 --- a/bridge/benchmarking/src/lib.rs +++ b/bridge/benchmarking/src/lib.rs @@ -111,7 +111,6 @@ benchmarks! { origin.into(), "test-account.testnet".to_string().as_bytes().to_vec(), min, - min, ); assert!(ret.is_ok()); } @@ -120,7 +119,7 @@ benchmarks! { sender: caller, receiver: "test-account.testnet".to_string().as_bytes().to_vec(), amount: min.into(), - fee: min.checked_into().unwrap(), + fee: 0u128.checked_into().unwrap(), sequence: 1u64, } .into()); @@ -152,7 +151,6 @@ benchmarks! { asset_id, "test-account.testnet".to_string().as_bytes().to_vec(), 10_000u32.into(), - fee, ); } verify { @@ -162,7 +160,7 @@ benchmarks! { receiver: "test-account.testnet".to_string().as_bytes().to_vec(), amount: 10_000u32.into(), sequence: 1u64, - fee, + fee: 0u128.checked_into().unwrap(), } .into()); } @@ -182,8 +180,6 @@ benchmarks! { 0u128.into(), 0u128.into(), "test-account.testnet".to_string().as_bytes().to_vec(), - fee, - 100u32, ); assert!(ret.is_ok()); @@ -195,7 +191,7 @@ benchmarks! { item: 0u128.into(), sender: caller, receiver: "test-account.testnet".to_string().as_bytes().to_vec(), - fee, + fee: 0u128.checked_into().unwrap(), sequence: 1u64, } .into()); @@ -314,8 +310,6 @@ benchmarks! { 0u128.into(), 0u128.into(), "test-account.testnet".to_string().as_bytes().to_vec(), - fee, - 100u32, ); let fee = ::Currency::minimum_balance(); }: { diff --git a/bridge/src/lib.rs b/bridge/src/lib.rs index 9590ac5..36bd8ff 100644 --- a/bridge/src/lib.rs +++ b/bridge/src/lib.rs @@ -181,13 +181,11 @@ pub mod pallet { origin: OriginFor, receiver_id: Vec, amount: BalanceOf, - fee: BalanceOf, ) -> DispatchResult { let sender = ensure_signed(origin)?; ensure!(T::AppchainInterface::is_activated(), Error::::NotActivated); - Self::do_lock_fungible_transfer_fee(sender.clone(), fee)?; - Self::do_lock(sender, receiver_id, amount, fee)?; + Self::do_lock(sender, receiver_id, amount)?; Ok(()) } @@ -199,13 +197,11 @@ pub mod pallet { asset_id: T::AssetId, receiver_id: Vec, amount: T::AssetBalance, - fee: BalanceOf, ) -> DispatchResult { let sender = ensure_signed(origin)?; ensure!(T::AppchainInterface::is_activated(), Error::::NotActivated); - Self::do_lock_fungible_transfer_fee(sender.clone(), fee)?; - Self::do_burn_nep141(asset_id, sender, receiver_id, amount, fee)?; + Self::do_burn_nep141(asset_id, sender, receiver_id, amount)?; Ok(()) } @@ -217,14 +213,11 @@ pub mod pallet { collection_id: T::CollectionId, item_id: T::ItemId, receiver_id: Vec, - fee: BalanceOf, - metadata_length: u32, ) -> DispatchResult { let sender = ensure_signed(origin)?; ensure!(T::AppchainInterface::is_activated(), Error::::NotActivated); - Self::do_lock_nonfungible_transfer_fee(sender.clone(), fee, metadata_length)?; - Self::do_lock_nonfungible(collection_id, item_id, sender, receiver_id, fee)?; + Self::do_lock_nonfungible(collection_id, item_id, sender, receiver_id)?; Ok(()) } @@ -482,8 +475,8 @@ pub mod pallet { NativeTokenPriceSetedIsZero, /// Update token price must use oracle account. UpdatePriceWithNoPermissionAccount, - /// Invalid fee. - InvalidFee, + /// Not enough balance for deduction fee. + NotEnoughBalanceForDeductionFee, /// Invalid coef. InvalidCoef, /// Invalid fee make overflow @@ -628,8 +621,10 @@ impl Pallet { Ok(()) } - fn do_lock_fungible_transfer_fee(sender: T::AccountId, fee: BalanceOf) -> DispatchResult { - let min_fee: Option> = >::try_get( + pub(crate) fn do_lock_fungible_transfer_fee( + sender: &T::AccountId, + ) -> Result, DispatchError> { + let fee: Option> = >::try_get( CrossChainTransferType::Fungible, ) .unwrap_or_else(|_| { @@ -637,37 +632,32 @@ impl Pallet { log!(warn, "Storage CrosschainTransferFee is empty, default ft fee is zero."); 0u128.checked_into() }); + let fee = fee.unwrap(); - if Some(fee) < min_fee { - return Err(Error::::InvalidFee.into()) - } - - T::Currency::transfer(&sender, &Self::account_id(), fee, AllowDeath)?; + T::Currency::transfer(sender, &Self::account_id(), fee, AllowDeath) + .map_err(|_| Error::::NotEnoughBalanceForDeductionFee)?; - Ok(()) + Ok(fee) } - fn do_lock_nonfungible_transfer_fee( - sender: T::AccountId, - fee: BalanceOf, + pub(crate) fn do_lock_nonfungible_transfer_fee( + sender: &T::AccountId, _metadata_length: u32, - ) -> DispatchResult { - let min_fee: Option> = + ) -> Result, DispatchError> { + log!(debug, "Metadata length is {:?} .", _metadata_length); + + let fee: Option> = >::try_get(CrossChainTransferType::Nonfungible) .unwrap_or_else(|_| { // Need Check. log!(warn, "Storage CrosschainTransferFee is empty, default nft fee is zero."); 0u128.checked_into() }); + let fee = fee.unwrap(); - // The min_fee will be related to metadata_length in future. - - if Some(fee) < min_fee { - return Err(Error::::InvalidFee.into()) - } + T::Currency::transfer(sender, &Self::account_id(), fee, AllowDeath) + .map_err(|_| Error::::NotEnoughBalanceForDeductionFee)?; - T::Currency::transfer(&sender, &Self::account_id(), fee, AllowDeath)?; - - Ok(()) + Ok(fee) } } diff --git a/bridge/src/nep141.rs b/bridge/src/nep141.rs index 1cce6eb..2258285 100644 --- a/bridge/src/nep141.rs +++ b/bridge/src/nep141.rs @@ -8,7 +8,6 @@ impl Pallet { sender: T::AccountId, receiver_id: Vec, amount: T::AssetBalance, - fee: BalanceOf, ) -> DispatchResult { let receiver_id = String::from_utf8(receiver_id).map_err(|_| Error::::InvalidReceiverId)?; @@ -18,6 +17,8 @@ impl Pallet { let token_id = String::from_utf8(token_id).map_err(|_| Error::::InvalidTokenId)?; + //deduction fee + let fee: BalanceOf = Self::do_lock_fungible_transfer_fee(&sender)?; let fee_wrapped: u128 = fee.checked_into().ok_or(Error::::AmountOverflow)?; >::burn_from(asset_id, &sender, amount)?; diff --git a/bridge/src/nonfungible.rs b/bridge/src/nonfungible.rs index babb248..fe33830 100644 --- a/bridge/src/nonfungible.rs +++ b/bridge/src/nonfungible.rs @@ -11,7 +11,6 @@ impl Pallet { item: T::ItemId, sender: T::AccountId, receiver_id: Vec, - fee: BalanceOf, ) -> DispatchResult { let receiver_id = String::from_utf8(receiver_id).map_err(|_| Error::::InvalidReceiverId)?; @@ -19,6 +18,13 @@ impl Pallet { let metadata = T::Convertor::convert_into_nep171_metadata(collection, item) .ok_or::>(Error::::ConvertorNotImplement.into())?; + // Deduction fee: + // This is a temporary scheme for calculating fees. + // It may be changed to be related to the length of messages later. + let data_in_vec = + metadata.clone().try_to_vec().map_err(|_| Error::::BorshSerializeFailed)?; + let fee: BalanceOf = + Self::do_lock_nonfungible_transfer_fee(&sender, data_in_vec.len() as u32)?; let fee_wrapped: u128 = fee.checked_into().ok_or(Error::::AmountOverflow)?; >::transfer( diff --git a/bridge/src/tests.rs b/bridge/src/tests.rs index 17d5db3..097276b 100644 --- a/bridge/src/tests.rs +++ b/bridge/src/tests.rs @@ -101,20 +101,18 @@ fn test_lock() { 100000 )); let minimum_amount = Balances::minimum_balance(); - let fee = Balances::minimum_balance(); assert_noop!( OctopusBridge::lock( origin.clone(), "test-account.testnet".to_string().as_bytes().to_vec(), minimum_amount, - fee, ), Error::::NotActivated ); assert_ok!(OctopusAppchain::force_set_is_activated(RuntimeOrigin::root(), true)); assert_noop!( - OctopusBridge::lock(origin.clone(), vec![0, 159], minimum_amount, fee), + OctopusBridge::lock(origin.clone(), vec![0, 159], minimum_amount), Error::::InvalidReceiverId ); @@ -122,7 +120,6 @@ fn test_lock() { origin, "test-account.testnet".to_string().as_bytes().to_vec(), minimum_amount, - fee, )); }); } @@ -133,7 +130,6 @@ fn test_burn_nep141() { let origin = RuntimeOrigin::signed(alice.clone()); let source = sp_runtime::MultiAddress::Id(alice); new_tester().execute_with(|| { - let fee = Balances::minimum_balance(); assert_ok!(Balances::set_balance( RuntimeOrigin::root(), source.clone(), @@ -148,7 +144,6 @@ fn test_burn_nep141() { 0, "test-account.testnet".to_string().as_bytes().to_vec(), 10000000000, - fee, ), Error::::NotActivated ); @@ -163,7 +158,6 @@ fn test_burn_nep141() { 0, "test-account.testnet".to_string().as_bytes().to_vec(), 100000000, - fee, )); }); } @@ -174,7 +168,6 @@ pub fn test_lock_nonfungible() { let origin = RuntimeOrigin::signed(alice.clone()); let source = sp_runtime::MultiAddress::Id(alice); new_tester().execute_with(|| { - let fee = Balances::minimum_balance(); assert_ok!(Balances::set_balance( RuntimeOrigin::root(), source.clone(), @@ -189,8 +182,6 @@ pub fn test_lock_nonfungible() { 0, 42, "test-account.testnet".to_string().as_bytes().to_vec(), - fee, - 1, ), Error::::NotActivated ); @@ -200,8 +191,6 @@ pub fn test_lock_nonfungible() { 0, 42, "test-account.testnet".to_string().as_bytes().to_vec(), - fee, - 1, )); }); } @@ -266,7 +255,6 @@ pub fn test_force_unlock_nft() { assert_ok!(Uniques::force_create(RuntimeOrigin::root(), 0, source.clone(), true)); assert_ok!(Uniques::mint(origin.clone(), 0, 42, source.clone(),)); assert_ok!(OctopusAppchain::force_set_is_activated(RuntimeOrigin::root(), true)); - let fee = Balances::minimum_balance(); assert_ok!(Balances::set_balance( RuntimeOrigin::root(), source.clone(), @@ -278,8 +266,6 @@ pub fn test_force_unlock_nft() { 0, 42, "test-account.testnet".to_string().as_bytes().to_vec(), - fee, - 1, )); assert_ok!(OctopusBridge::force_unlock_nonfungible( diff --git a/bridge/src/token.rs b/bridge/src/token.rs index 2733b5f..9ed9382 100644 --- a/bridge/src/token.rs +++ b/bridge/src/token.rs @@ -8,12 +8,14 @@ impl Pallet { sender: T::AccountId, receiver_id: Vec, amount: BalanceOf, - fee: BalanceOf, ) -> DispatchResult { let receiver_id = String::from_utf8(receiver_id).map_err(|_| Error::::InvalidReceiverId)?; let amount_wrapped: u128 = amount.checked_into().ok_or(Error::::AmountOverflow)?; + + //deduction fee + let fee: BalanceOf = Self::do_lock_fungible_transfer_fee(&sender)?; let fee_wrapped: u128 = fee.checked_into().ok_or(Error::::AmountOverflow)?; T::Currency::transfer(&sender, &Self::account_id(), amount, AllowDeath)?; diff --git a/bridge/src/weights.rs b/bridge/src/weights.rs index 9b38f5b..e74276f 100644 --- a/bridge/src/weights.rs +++ b/bridge/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_octopus_bridge //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! HOSTNAME: `andy-VirtualBox`, CPU: `AMD Ryzen 7 5800H with Radeon Graphics` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 @@ -28,8 +28,10 @@ // pallet // --chain // dev -// --execution=wasm -// --wasm-execution=compiled +// --execution +// wasm +// --wasm-execution +// compiled // --pallet // pallet_octopus_bridge // --extrinsic @@ -73,28 +75,26 @@ impl WeightInfo for SubstrateWeight { // Storage: OctopusUpwardMessages MessageQueue (r:1 w:1) // Storage: OctopusUpwardMessages Nonce (r:1 w:1) fn lock() -> Weight { - Weight::from_ref_time(166_342_000 as u64) + Weight::from_ref_time(130_449_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: OctopusAppchain IsActivated (r:1 w:0) - // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) - // Storage: System Account (r:1 w:1) // Storage: OctopusBridge AssetIdByTokenId (r:2 w:0) + // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) // Storage: OctopusAssets Asset (r:1 w:1) // Storage: OctopusAssets Account (r:1 w:1) // Storage: OctopusUpwardMessages MessageQueue (r:1 w:1) // Storage: OctopusUpwardMessages Nonce (r:1 w:1) fn burn_nep141() -> Weight { - Weight::from_ref_time(220_224_000 as u64) - .saturating_add(T::DbWeight::get().reads(9 as u64)) - .saturating_add(T::DbWeight::get().writes(5 as u64)) + Weight::from_ref_time(158_225_000 as u64) + .saturating_add(T::DbWeight::get().reads(8 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: OctopusAppchain IsActivated (r:1 w:0) - // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) - // Storage: System Account (r:1 w:1) // Storage: OctopusUniques ClassMetadataOf (r:1 w:0) // Storage: OctopusUniques InstanceMetadataOf (r:1 w:0) + // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) // Storage: OctopusUniques Class (r:1 w:0) // Storage: OctopusUniques Asset (r:1 w:1) // Storage: OctopusUpwardMessages MessageQueue (r:1 w:1) @@ -102,48 +102,48 @@ impl WeightInfo for SubstrateWeight { // Storage: OctopusUniques Account (r:0 w:2) // Storage: OctopusUniques ItemPriceOf (r:0 w:1) fn lock_nonfungible() -> Weight { - Weight::from_ref_time(207_861_000 as u64) - .saturating_add(T::DbWeight::get().reads(9 as u64)) - .saturating_add(T::DbWeight::get().writes(7 as u64)) + Weight::from_ref_time(156_792_000 as u64) + .saturating_add(T::DbWeight::get().reads(8 as u64)) + .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: OctopusAppchain IsActivated (r:1 w:0) // Storage: OctopusBridge AssetIdByTokenId (r:3 w:1) fn set_token_id() -> Weight { - Weight::from_ref_time(44_884_000 as u64) + Weight::from_ref_time(55_321_000 as u64) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: OctopusBridge AssetIdByTokenId (r:1 w:1) fn delete_token_id() -> Weight { - Weight::from_ref_time(24_105_000 as u64) + Weight::from_ref_time(23_566_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unlock() -> Weight { - Weight::from_ref_time(95_870_000 as u64) + Weight::from_ref_time(95_486_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: OctopusAssets Asset (r:1 w:1) // Storage: OctopusAssets Account (r:1 w:1) fn force_mint_nep141() -> Weight { - Weight::from_ref_time(82_385_000 as u64) + Weight::from_ref_time(82_034_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: OctopusUniques Class (r:1 w:0) // Storage: OctopusUniques Asset (r:1 w:1) - // Storage: OctopusUniques Account (r:0 w:1) + // Storage: OctopusUniques Account (r:0 w:2) // Storage: OctopusUniques ItemPriceOf (r:0 w:1) fn force_unlock_nonfungible() -> Weight { - Weight::from_ref_time(86_562_000 as u64) + Weight::from_ref_time(87_126_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } // Storage: OctopusBridge OracleAccount (r:0 w:1) fn set_oracle_account() -> Weight { - Weight::from_ref_time(31_309_000 as u64) + Weight::from_ref_time(30_963_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: OctopusBridge OracleAccount (r:1 w:0) @@ -152,7 +152,7 @@ impl WeightInfo for SubstrateWeight { // Storage: OctopusBridge NearPrice (r:0 w:1) // Storage: OctopusBridge TokenPrice (r:0 w:1) fn set_token_price() -> Weight { - Weight::from_ref_time(51_477_000 as u64) + Weight::from_ref_time(51_843_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(4 as u64)) } @@ -166,28 +166,26 @@ impl WeightInfo for () { // Storage: OctopusUpwardMessages MessageQueue (r:1 w:1) // Storage: OctopusUpwardMessages Nonce (r:1 w:1) fn lock() -> Weight { - Weight::from_ref_time(166_342_000 as u64) + Weight::from_ref_time(130_449_000 as u64) .saturating_add(RocksDbWeight::get().reads(5 as u64)) .saturating_add(RocksDbWeight::get().writes(3 as u64)) } // Storage: OctopusAppchain IsActivated (r:1 w:0) - // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) - // Storage: System Account (r:1 w:1) // Storage: OctopusBridge AssetIdByTokenId (r:2 w:0) + // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) // Storage: OctopusAssets Asset (r:1 w:1) // Storage: OctopusAssets Account (r:1 w:1) // Storage: OctopusUpwardMessages MessageQueue (r:1 w:1) // Storage: OctopusUpwardMessages Nonce (r:1 w:1) fn burn_nep141() -> Weight { - Weight::from_ref_time(220_224_000 as u64) - .saturating_add(RocksDbWeight::get().reads(9 as u64)) - .saturating_add(RocksDbWeight::get().writes(5 as u64)) + Weight::from_ref_time(158_225_000 as u64) + .saturating_add(RocksDbWeight::get().reads(8 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } // Storage: OctopusAppchain IsActivated (r:1 w:0) - // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) - // Storage: System Account (r:1 w:1) // Storage: OctopusUniques ClassMetadataOf (r:1 w:0) // Storage: OctopusUniques InstanceMetadataOf (r:1 w:0) + // Storage: OctopusBridge CrosschainTransferFee (r:1 w:0) // Storage: OctopusUniques Class (r:1 w:0) // Storage: OctopusUniques Asset (r:1 w:1) // Storage: OctopusUpwardMessages MessageQueue (r:1 w:1) @@ -195,48 +193,48 @@ impl WeightInfo for () { // Storage: OctopusUniques Account (r:0 w:2) // Storage: OctopusUniques ItemPriceOf (r:0 w:1) fn lock_nonfungible() -> Weight { - Weight::from_ref_time(207_861_000 as u64) - .saturating_add(RocksDbWeight::get().reads(9 as u64)) - .saturating_add(RocksDbWeight::get().writes(7 as u64)) + Weight::from_ref_time(156_792_000 as u64) + .saturating_add(RocksDbWeight::get().reads(8 as u64)) + .saturating_add(RocksDbWeight::get().writes(6 as u64)) } // Storage: OctopusAppchain IsActivated (r:1 w:0) // Storage: OctopusBridge AssetIdByTokenId (r:3 w:1) fn set_token_id() -> Weight { - Weight::from_ref_time(44_884_000 as u64) + Weight::from_ref_time(55_321_000 as u64) .saturating_add(RocksDbWeight::get().reads(4 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: OctopusBridge AssetIdByTokenId (r:1 w:1) fn delete_token_id() -> Weight { - Weight::from_ref_time(24_105_000 as u64) + Weight::from_ref_time(23_566_000 as u64) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unlock() -> Weight { - Weight::from_ref_time(95_870_000 as u64) + Weight::from_ref_time(95_486_000 as u64) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: OctopusAssets Asset (r:1 w:1) // Storage: OctopusAssets Account (r:1 w:1) fn force_mint_nep141() -> Weight { - Weight::from_ref_time(82_385_000 as u64) + Weight::from_ref_time(82_034_000 as u64) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: OctopusUniques Class (r:1 w:0) // Storage: OctopusUniques Asset (r:1 w:1) - // Storage: OctopusUniques Account (r:0 w:1) + // Storage: OctopusUniques Account (r:0 w:2) // Storage: OctopusUniques ItemPriceOf (r:0 w:1) fn force_unlock_nonfungible() -> Weight { - Weight::from_ref_time(86_562_000 as u64) + Weight::from_ref_time(87_126_000 as u64) .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(4 as u64)) } // Storage: OctopusBridge OracleAccount (r:0 w:1) fn set_oracle_account() -> Weight { - Weight::from_ref_time(31_309_000 as u64) + Weight::from_ref_time(30_963_000 as u64) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: OctopusBridge OracleAccount (r:1 w:0) @@ -245,7 +243,7 @@ impl WeightInfo for () { // Storage: OctopusBridge NearPrice (r:0 w:1) // Storage: OctopusBridge TokenPrice (r:0 w:1) fn set_token_price() -> Weight { - Weight::from_ref_time(51_477_000 as u64) + Weight::from_ref_time(51_843_000 as u64) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(4 as u64)) }