Companion for Weight v1.5 (#1581)

* cargo test -p cumulus-primitives-utility

* cargo test -p cumulus-pallet-xcmp-queue

* cargo test -p cumulus-pallet-xcm

* cargo test -p cumulus-pallet-dmp-queue

* cargo test -p pallet-template

* cargo test -p cumulus-test-runtime

* fix weights

* fix more weights

* cargo test -p parachains-common

* cargo test -p parachain-template-runtime

* fix weights import

* cargo test -p collectives-polkadot-runtime

* cargo test -p contracts-rococo-runtime

* more

* unused

* fixes

* Update benchmarking.rs

* Update lib.rs

* Update lib.rs

* fix

* fix bug in conversion

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Shawn Tabrizi
2022-08-31 13:24:42 +01:00
committed by GitHub
parent 1ab196df49
commit 3fb9c8a7be
118 changed files with 2005 additions and 1885 deletions
@@ -1,6 +1,8 @@
use asset_test_utils::{ExtBuilder, RuntimeHelper};
use frame_support::{
assert_noop, assert_ok, traits::PalletInfo, weights::WeightToFee as WeightToFeeT,
assert_noop, assert_ok,
traits::PalletInfo,
weights::{Weight, WeightToFee as WeightToFeeT},
};
use parachains_common::{AccountId, AuraId};
pub use statemine_runtime::{
@@ -49,7 +51,7 @@ fn test_asset_xcm_trader() {
let bought = 4_000_000_000u64;
// lets calculate amount needed
let amount_needed = WeightToFee::weight_to_fee(&bought);
let amount_needed = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought));
let asset_multilocation = MultiLocation::new(
0,
@@ -130,7 +132,7 @@ fn test_asset_xcm_trader_with_refund() {
);
// lets calculate amount needed
let amount_bought = WeightToFee::weight_to_fee(&bought);
let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought));
let asset: MultiAsset = (asset_multilocation.clone(), amount_bought).into();
@@ -144,7 +146,8 @@ fn test_asset_xcm_trader_with_refund() {
let weight_used = bought / 2;
// Make sure refurnd works.
let amount_refunded = WeightToFee::weight_to_fee(&(bought - weight_used));
let amount_refunded =
WeightToFee::weight_to_fee(&Weight::from_ref_time(bought - weight_used));
assert_eq!(
trader.refund_weight(bought - weight_used),
@@ -155,7 +158,7 @@ fn test_asset_xcm_trader_with_refund() {
drop(trader);
// We only should have paid for half of the bought weight
let fees_paid = WeightToFee::weight_to_fee(&weight_used);
let fees_paid = WeightToFee::weight_to_fee(&Weight::from_ref_time(weight_used));
assert_eq!(
Assets::balance(1, AccountId::from(ALICE)),
@@ -207,7 +210,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
),
);
let amount_bought = WeightToFee::weight_to_fee(&bought);
let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought));
assert!(
amount_bought < ExistentialDeposit::get(),
@@ -267,7 +270,7 @@ fn test_that_buying_ed_refund_does_not_refund() {
),
);
let amount_bought = WeightToFee::weight_to_fee(&bought);
let amount_bought = WeightToFee::weight_to_fee(&Weight::from_ref_time(bought));
assert!(
amount_bought < ExistentialDeposit::get(),