Skip to content

Commit

Permalink
Replace Weight::from_ref_time by Weight::from_parts
Browse files Browse the repository at this point in the history
  • Loading branch information
vovac12 committed Apr 5, 2023
1 parent 5652c2d commit 9f52e5f
Show file tree
Hide file tree
Showing 37 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion common/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub mod constants {
use crate::{balance, Balance};
use frame_support::weights::Weight;

pub const EXTRINSIC_FIXED_WEIGHT: Weight = Weight::from_ref_time(100_000_000);
pub const EXTRINSIC_FIXED_WEIGHT: Weight = Weight::from_parts(100_000_000, 0);
pub const SMALL_FEE: Balance = balance!(0.0007);
pub const BIG_FEE: Balance = balance!(0.007);
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/assets/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub const MOCK_LIQUIDITY_PROXY_TECH_ACCOUNT: AccountId = 24;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/ceres-governance-platform/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetXykFee: Fixed = fixed!(0.003);
Expand Down
2 changes: 1 addition & 1 deletion pallets/ceres-launchpad/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub const DEX_B_ID: DEXId = DEXId::PolkaswapXSTUSD;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetXykFee: Fixed = fixed!(0.003);
Expand Down
2 changes: 1 addition & 1 deletion pallets/ceres-liquidity-locker/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetBaseAssetId: AssetId = common::AssetId32::from_bytes(hex!("0200000000000000000000000000000000000000000000000000000000000000").into());
Expand Down
2 changes: 1 addition & 1 deletion pallets/ceres-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/ceres-token-locker/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetXykFee: Fixed = fixed!(0.003);
Expand Down
2 changes: 1 addition & 1 deletion pallets/demeter-farming-platform/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub const DEX_B_ID: DEXId = DEXId::PolkaswapXSTUSD;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetXykFee: Fixed = fixed!(0.003);
Expand Down
2 changes: 1 addition & 1 deletion pallets/dex-api/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub const DEX_B_ID: DEXId = 2;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId = XOR;
Expand Down
2 changes: 1 addition & 1 deletion pallets/dex-manager/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub const DEX_B_ID: DEXId = 2;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId = XOR;
Expand Down
2 changes: 1 addition & 1 deletion pallets/eth-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub const DEPOSIT_TOPIC: H256 = H256(hex!(
"85c0fa492ded927d3acca961da52b0dda1debb06d8c27fe189315f06bb6e26c8"
));
pub const OFFCHAIN_TRANSACTION_WEIGHT_LIMIT: Weight =
Weight::from_ref_time(10_000_000_000_000_000u64);
Weight::from_parts(10_000_000_000_000_000u64, 0);
const MAX_PENDING_TX_BLOCKS_PERIOD: u32 = 100;
const RE_HANDLE_TXS_PERIOD: u32 = 200;
/// Minimum peers required to start bridge migration
Expand Down
6 changes: 3 additions & 3 deletions pallets/eth-bridge/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl<RuntimeCall: Encode, Extra: Encode> GetDispatchInfo for MyTestXt<RuntimeCal
fn get_dispatch_info(&self) -> DispatchInfo {
// for testing: weight == size.
DispatchInfo {
weight: Weight::from_ref_time(self.encode().len() as u64),
weight: Weight::from_parts(self.encode().len() as u64, 0),
pays_fee: Pays::No,
..Default::default()
}
Expand All @@ -246,13 +246,13 @@ pub type TestExtrinsic = MyTestXt<RuntimeCall, MyExtra>;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const ExistentialDeposit: u128 = 0;
pub const RemovePendingOutgoingRequestsAfter: BlockNumber = 100;
pub const TrackPendingIncomingRequestsAfter: (BlockNumber, u64) = (0, 0);
pub const SchedulerMaxWeight: Weight = Weight::from_ref_time(1024);
pub const SchedulerMaxWeight: Weight = Weight::from_parts(1024, 0);
}

pub struct RemoveTemporaryPeerAccountId;
Expand Down
4 changes: 2 additions & 2 deletions pallets/farming/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub const DEX_B_ID: DEXId = 1;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId = common::AssetId32 { code: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], phantom: PhantomData };
Expand All @@ -122,7 +122,7 @@ parameter_types! {
pub GetBondingCurveRewardsAccountId: AccountId = AccountId32::from([13; 32]);
pub GetFarmingRewardsAccountId: AccountId = AccountId32::from([14; 32]);
pub GetCrowdloanRewardsAccountId: AccountId = AccountId32::from([15; 32]);
pub const SchedulerMaxWeight: Weight = Weight::from_ref_time(1024);
pub const SchedulerMaxWeight: Weight = Weight::from_parts(1024, 0);
pub const MinimumPeriod: u64 = 5;
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/faucet/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub const NOT_SUPPORTED_ASSET_ID: AssetId = USDT;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId = XOR;
Expand Down
2 changes: 1 addition & 1 deletion pallets/hermes-governance-platform/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetXykFee: Fixed = fixed!(0.003);
Expand Down
2 changes: 1 addition & 1 deletion pallets/iroha-migration/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId32<PredefinedAssetId> = AssetId32::from_asset_id(XOR);
Expand Down
2 changes: 1 addition & 1 deletion pallets/liquidity-proxy/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn special_asset() -> AssetId {

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetLiquidityProxyTechAccountId: TechAccountId = {
Expand Down
4 changes: 2 additions & 2 deletions pallets/liquidity-proxy/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> crate::WeightInfo for WeightInfo<T> {
fn enable_liquidity_source() -> Weight {
Weight::from_ref_time(21_575_000)
Weight::from_parts(21_575_000, 0)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
fn disable_liquidity_source() -> Weight {
Weight::from_ref_time(20_003_000)
Weight::from_parts(20_003_000, 0)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/mock-liquidity-source/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub const DEX_B_ID: DEXId = 2;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetFee: Fixed = fixed_from_basis_points(30u16);
Expand Down
2 changes: 1 addition & 1 deletion pallets/multicollateral-bonding-curve-pool/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub const DEX_A_ID: DEXId = DEXId::Polkaswap;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetDefaultFee: u16 = 30;
Expand Down
2 changes: 1 addition & 1 deletion pallets/permissions/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub const JOHN: AccountId = 3;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const ExistentialDeposit: u128 = 0;
Expand Down
2 changes: 1 addition & 1 deletion pallets/pool-xyk/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Block = frame_system::mocking::MockBlock<Runtime>;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetBaseAssetId: AssetId = common::AssetId32::from_bytes(hex!("0200000000000000000000000000000000000000000000000000000000000000").into());
Expand Down
2 changes: 1 addition & 1 deletion pallets/price-tools/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub const DAI: AssetId = common::AssetId32::from_bytes(hex!(

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetDefaultFee: u16 = 30;
Expand Down
2 changes: 1 addition & 1 deletion pallets/pswap-distribution/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ parameter_types! {
pub const PoolTokenAId: AssetId = common::AssetId32::from_bytes(hex!("0211110000000000000000000000000000000000000000000000000000000000"));
pub const PoolTokenBId: AssetId = common::AssetId32::from_bytes(hex!("0222220000000000000000000000000000000000000000000000000000000000"));
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetDefaultFee: u16 = 30;
Expand Down
2 changes: 1 addition & 1 deletion pallets/referrals/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub const BUY_BACK_ACCOUNT: AccountId = 23;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId32<PredefinedAssetId> = AssetId32::from_asset_id(PredefinedAssetId::XOR);
Expand Down
2 changes: 1 addition & 1 deletion pallets/rewards/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn account_id() -> AccountId {

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId = XOR;
Expand Down
6 changes: 3 additions & 3 deletions pallets/rewards/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<T: frame_system::Config> crate::WeightInfo for WeightInfo<T> {
// Storage: Rewards UmiNftReceivers (r:1 w:0)
fn claim() -> Weight {
// Minimum execution time: 2_380_000 nanoseconds.
Weight::from_ref_time(2_399_000_000 as u64)
Weight::from_parts(2_399_000_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(14 as u64))
.saturating_add(T::DbWeight::get().writes(10 as u64))
}
Expand All @@ -86,9 +86,9 @@ impl<T: frame_system::Config> crate::WeightInfo for WeightInfo<T> {
/// The range of component `n` is `[1, 1000]`.
fn add_umi_nfts_receivers(n: u64, ) -> Weight {
// Minimum execution time: 199_000 nanoseconds.
Weight::from_ref_time(199_000_000 as u64)
Weight::from_parts(199_000_000 as u64, 0)
// Standard Error: 115_239
.saturating_add(Weight::from_ref_time(54_319_538 as u64).saturating_mul(n as u64))
.saturating_add(Weight::from_parts(54_319_538 as u64, 0).saturating_mul(n as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(n as u64)))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(n as u64)))
Expand Down
2 changes: 1 addition & 1 deletion pallets/technical/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Block = frame_system::mocking::MockBlock<Runtime>;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetBaseAssetId: AssetId = common::AssetId32 { code: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], phantom: PhantomData };
Expand Down
2 changes: 1 addition & 1 deletion pallets/trading-pair/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type AssetId = AssetId32<common::PredefinedAssetId>;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/vested-rewards/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl LiquidityProxyTrait<DEXId, AccountId, AssetId> for MockLiquidityProxy {

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub GetIncentiveAssetId: AssetId = common::PSWAP.into();
Expand Down
4 changes: 2 additions & 2 deletions pallets/vested-rewards/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<T: frame_system::Config> crate::WeightInfo for WeightInfo<T> {
// Storage: VestedRewards TotalRewards (r:1 w:1)
fn claim_rewards() -> Weight {
// Minimum execution time: 1_009_000 nanoseconds.
Weight::from_ref_time(1_073_000_000 as u64)
Weight::from_parts(1_073_000_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
Expand All @@ -80,7 +80,7 @@ impl<T: frame_system::Config> crate::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:2 w:1)
fn claim_crowdloan_rewards() -> Weight {
// Minimum execution time: 1_157_000 nanoseconds.
Weight::from_ref_time(1_163_000_000 as u64)
Weight::from_parts(1_163_000_000 as u64, 0)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
Expand Down
4 changes: 2 additions & 2 deletions pallets/xor-fee/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ parameter_types! {
min_val_burned_percentage_reward: Percent::from_percent(35),
max_val_burned_percentage_reward: Percent::from_percent(90),
};
pub OffchainSolutionWeightLimit: Weight = Weight::from_ref_time(600_000_000);
pub OffchainSolutionWeightLimit: Weight = Weight::from_parts(600_000_000, 0);
pub GetXorFeeTechAccountId: TechAccountId = {
TechAccountId::Generic(
crate::TECH_ACCOUNT_PREFIX.to_vec(),
Expand All @@ -124,7 +124,7 @@ parameter_types! {
pub const RemovePendingOutgoingRequestsAfter: BlockNumber = 100;
pub const TrackPendingIncomingRequestsAfter: (BlockNumber, u64) = (0, 0);
pub RemoveTemporaryPeerAccountId: Vec<(AccountId, H160)> = Vec::new();
pub const SchedulerMaxWeight: Weight = Weight::from_ref_time(1024);
pub const SchedulerMaxWeight: Weight = Weight::from_parts(1024, 0);
pub const DepositBase: u64 = 1;
pub const DepositFactor: u64 = 1;
pub const MaxSignatories: u16 = 4;
Expand Down
8 changes: 4 additions & 4 deletions pallets/xor-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ fn weight_to_fee_works() {
ext.execute_with(|| {
set_weight_to_fee_multiplier(1);
assert_eq!(
XorFee::weight_to_fee(&Weight::from_ref_time(100_000_000_000)),
XorFee::weight_to_fee(&Weight::from_parts(100_000_000_000, 0)),
balance!(0.7)
);
assert_eq!(
XorFee::weight_to_fee(&Weight::from_ref_time(500_000_000)),
XorFee::weight_to_fee(&Weight::from_parts(500_000_000, 0)),
balance!(0.0035)
);
assert_eq!(
XorFee::weight_to_fee(&Weight::from_ref_time(72_000_000)),
XorFee::weight_to_fee(&Weight::from_parts(72_000_000, 0)),
balance!(0.000504)
);
assert_eq!(
XorFee::weight_to_fee(&Weight::from_ref_time(210_200_000_000)),
XorFee::weight_to_fee(&Weight::from_parts(210_200_000_000, 0)),
balance!(1.4714)
);
});
Expand Down
2 changes: 1 addition & 1 deletion pallets/xst/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub const DEX_A_ID: DEXId = DEXId::Polkaswap;

parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024);
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const GetDefaultFee: u16 = 30;
Expand Down
Loading

0 comments on commit 9f52e5f

Please sign in to comment.