Skip to content

Commit

Permalink
switch to FixedRateOfFungible
Browse files Browse the repository at this point in the history
  • Loading branch information
GopherJ committed Sep 25, 2021
1 parent 02c7a0e commit e79b5d1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
10 changes: 5 additions & 5 deletions pallets/liquid-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pub use xcm::latest::prelude::*;
pub use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfConcreteFungible,
FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser,
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
CurrencyAdapter as XcmCurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds,
IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser, ParentIsDefault,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
};
use xcm_executor::{Config, XcmExecutor};
Expand Down Expand Up @@ -78,7 +78,7 @@ pub type XcmOriginToCallOrigin = (

parameter_types! {
pub const UnitWeightCost: Weight = 1;
pub DotPerSecond: (MultiLocation, u128) = (MultiLocation::parent(), 1);
pub DotPerSecond: (AssetId, u128) = (AssetId::Concrete(MultiLocation::parent()), 1);
}

pub type LocalAssetTransactor = MultiCurrencyAdapter<
Expand All @@ -103,7 +103,7 @@ impl Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
type Trader = FixedRateOfConcreteFungible<DotPerSecond, ()>;
type Trader = FixedRateOfFungible<DotPerSecond, ()>;
type ResponseHandler = ();
type SubscriptionService = PolkadotXcm;
}
Expand Down
13 changes: 6 additions & 7 deletions runtime/heiko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ use primitives::{
};
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin,
FixedRateOfConcreteFungible, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue,
TakeWeightCredit,
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible,
FixedWeightBounds, LocationInverter, ParentAsSuperuser, ParentIsDefault, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit,
};
use xcm_executor::{Config, XcmExecutor};

Expand Down Expand Up @@ -812,7 +811,7 @@ pub type XcmOriginToTransactDispatchOrigin = (

parameter_types! {
pub UnitWeightCost: Weight = 20_000_000;
pub KsmPerSecond: (MultiLocation, u128) = (MultiLocation::parent(), ksm_per_second());
pub KsmPerSecond: (AssetId, u128) = (AssetId::Concrete(MultiLocation::parent()), ksm_per_second());
}

parameter_types! {
Expand Down Expand Up @@ -852,7 +851,7 @@ impl Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
type Trader = FixedRateOfConcreteFungible<KsmPerSecond, ToTreasury>;
type Trader = FixedRateOfFungible<KsmPerSecond, ToTreasury>;
type ResponseHandler = ();
type SubscriptionService = PolkadotXcm;
}
Expand Down
13 changes: 6 additions & 7 deletions runtime/parallel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ use primitives::{
use hex_literal::hex;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin,
FixedRateOfConcreteFungible, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue,
TakeWeightCredit,
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible,
FixedWeightBounds, LocationInverter, ParentAsSuperuser, ParentIsDefault, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit,
};
use xcm_executor::{Config, XcmExecutor};
pub mod constants;
Expand Down Expand Up @@ -812,7 +811,7 @@ pub type XcmOriginToTransactDispatchOrigin = (

parameter_types! {
pub UnitWeightCost: Weight = 20_000_000;
pub DotPerSecond: (MultiLocation, u128) = (MultiLocation::parent(), dot_per_second());
pub DotPerSecond: (AssetId, u128) = (AssetId::Concrete(MultiLocation::parent()), dot_per_second());
}

parameter_types! {
Expand Down Expand Up @@ -852,7 +851,7 @@ impl Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
type Trader = FixedRateOfConcreteFungible<DotPerSecond, ToTreasury>;
type Trader = FixedRateOfFungible<DotPerSecond, ToTreasury>;
type ResponseHandler = (); // Don't handle responses for now.
type SubscriptionService = PolkadotXcm;
}
Expand Down
13 changes: 6 additions & 7 deletions runtime/vanilla/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin,
FixedRateOfConcreteFungible, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
ParentIsDefault, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue,
TakeWeightCredit,
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible,
FixedWeightBounds, LocationInverter, ParentAsSuperuser, ParentIsDefault, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit,
};
use xcm_executor::{Config, XcmExecutor};

Expand Down Expand Up @@ -790,7 +789,7 @@ pub type XcmOriginToTransactDispatchOrigin = (

parameter_types! {
pub UnitWeightCost: Weight = 20_000_000;
pub KsmPerSecond: (MultiLocation, u128) = (MultiLocation::parent(), ksm_per_second());
pub KsmPerSecond: (AssetId, u128) = (AssetId::Concrete(MultiLocation::parent()), ksm_per_second());
}

parameter_types! {
Expand Down Expand Up @@ -830,7 +829,7 @@ impl Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
type Trader = FixedRateOfConcreteFungible<KsmPerSecond, ToTreasury>;
type Trader = FixedRateOfFungible<KsmPerSecond, ToTreasury>;
type ResponseHandler = (); // Don't handle responses for now.
type SubscriptionService = PolkadotXcm;
}
Expand Down

0 comments on commit e79b5d1

Please sign in to comment.