Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Aug 8, 2024
1 parent caae7ac commit 0351ea5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 27 deletions.
19 changes: 2 additions & 17 deletions tests/xcm-simulator/src/mocks/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use frame_support::{
dispatch::DispatchClass,
parameter_types,
traits::{
AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, Contains, Currency,
Everything, Imbalance, InstanceFilter, Nothing, OnUnbalanced,
AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, Contains, Everything,
InstanceFilter, Nothing,
},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND},
Expand Down Expand Up @@ -74,8 +74,6 @@ pub type AccountId = AccountId32;
pub type Balance = u128;
pub type AssetId = u128;

pub type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;

pub type ShidenAssetLocationIdConverter = AssetLocationIdConverter<AssetId, XcAssetConfig>;

parameter_types! {
Expand Down Expand Up @@ -280,19 +278,6 @@ impl pallet_contracts::Config for Runtime {
type ApiVersion = ();
}

pub struct BurnFees;
impl OnUnbalanced<NegativeImbalance> for BurnFees {
/// Payout tips but burn all the fees
fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance>) {
if let Some(mut fees_to_burn) = fees_then_tips.next() {
if let Some(tips) = fees_then_tips.next() {
fees_to_burn.subsume(tips)
}
drop(fees_to_burn);
}
}
}

/// The type used to represent the kinds of proxying allowed.
#[derive(
Copy,
Expand Down
20 changes: 10 additions & 10 deletions tests/xcm-simulator/src/tests/fungible_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn para_to_para_reserve_transfer_and_back_via_xtokens() {
parachain::RuntimeOrigin::signed(ALICE),
Box::new((Here, withdraw_amount).into()),
Box::new(destination.into()),
WeightLimit::Unlimited
Unlimited
));

// Parachain 2 sovereign account should have it's balance increased, while Alice balance should be decreased.
Expand Down Expand Up @@ -105,7 +105,7 @@ fn para_to_para_reserve_transfer_and_back_via_xtokens() {
parachain::RuntimeOrigin::signed(ALICE),
Box::new((para_a_multiloc, remaining).into()),
Box::new(destination.into()),
WeightLimit::Unlimited
Unlimited
));
});

Expand Down Expand Up @@ -446,7 +446,7 @@ fn receive_relay_asset_from_relay_and_send_them_back_via_xtokens() {
Box::new(alice.into()),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));

// Parachain A sovereign account should have it's balance increased, while Alice balance should be decreased.
Expand Down Expand Up @@ -493,7 +493,7 @@ fn receive_relay_asset_from_relay_and_send_them_back_via_xtokens() {
parachain::RuntimeOrigin::signed(ALICE),
Box::new((Parent, para_a_alice_expected_balance).into()),
Box::new(destination.into()),
WeightLimit::Unlimited,
Unlimited,
));
});

Expand Down Expand Up @@ -545,7 +545,7 @@ fn receive_relay_asset_from_relay_and_send_them_back() {
Box::new(alice.into()),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));

// Parachain A sovereign account should have it's balance increased, while Alice balance should be decreased.
Expand Down Expand Up @@ -655,7 +655,7 @@ fn para_a_send_relay_asset_to_para_b() {
Box::new(alice.into_location().into_versioned()),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));
});

Expand Down Expand Up @@ -757,7 +757,7 @@ fn send_relay_asset_to_para_b_with_extra_native() {
Box::new(alice.into_location().into_versioned()),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));
});

Expand Down Expand Up @@ -845,7 +845,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() {
),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));
});

Expand Down Expand Up @@ -880,7 +880,7 @@ fn receive_asset_with_no_sufficients_not_possible_if_non_existent_account() {
),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));
});

Expand Down Expand Up @@ -932,7 +932,7 @@ fn receive_assets_with_sufficients_true_allows_non_funded_account_to_receive_ass
),
Box::new((Here, withdraw_amount).into()),
0,
WeightLimit::Unlimited,
Unlimited,
));
});

Expand Down

0 comments on commit 0351ea5

Please sign in to comment.