1414// limitations under the License.
1515
1616use crate :: {
17- constants:: fee:: WeightToFee , impls:: ToAuthor , weights:: TrappistDropAssetsWeigher ,
17+ constants:: fee:: { default_fee_per_second, WeightToFee } ,
18+ impls:: ToAuthor ,
19+ weights:: TrappistDropAssetsWeigher ,
1820 AllPalletsWithSystem ,
1921} ;
2022
@@ -46,10 +48,10 @@ use xcm::latest::{prelude::*, Fungibility::Fungible, MultiAsset, MultiLocation};
4648use xcm_builder:: {
4749 AccountId32Aliases , AllowKnownQueryResponses , AllowSubscriptionsFrom ,
4850 AllowTopLevelPaidExecutionFrom , AllowUnpaidExecutionFrom , CurrencyAdapter , EnsureXcmOrigin ,
49- FungiblesAdapter , IsConcrete , MintLocation , NativeAsset , NoChecking , ParentAsSuperuser ,
50- ParentIsPreset , RelayChainAsNative , SiblingParachainAsNative , SiblingParachainConvertsVia ,
51- SignedAccountId32AsNative , SignedToAccountId32 , SovereignSignedViaLocation , TakeWeightCredit ,
52- UsingComponents , WeightInfoBounds ,
51+ FixedRateOfFungible , FungiblesAdapter , IsConcrete , MintLocation , NativeAsset , NoChecking ,
52+ ParentAsSuperuser , ParentIsPreset , RelayChainAsNative , SiblingParachainAsNative ,
53+ SiblingParachainConvertsVia , SignedAccountId32AsNative , SignedToAccountId32 ,
54+ SovereignSignedViaLocation , TakeWeightCredit , UsingComponents , WeightInfoBounds ,
5355} ;
5456use xcm_executor:: XcmExecutor ;
5557
@@ -218,6 +220,14 @@ parameter_types! {
218220 // Rockmine's Assets pallet index
219221 pub RockmineAssetsPalletLocation : MultiLocation =
220222 MultiLocation :: new( 1 , X2 ( Parachain ( 1000 ) , PalletInstance ( 50 ) ) ) ;
223+
224+ pub RUsdPerSecond : ( xcm:: v3:: AssetId , u128 , u128 ) = (
225+ MultiLocation :: new( 1 , X3 ( Parachain ( 1000 ) , PalletInstance ( 50 ) , GeneralIndex ( 1984 ) ) ) . into( ) ,
226+ default_fee_per_second( ) * 10 ,
227+ 0u128
228+ ) ;
229+ /// Roc = 7 RUSD
230+ pub RocPerSecond : ( xcm:: v3:: AssetId , u128 , u128 ) = ( MultiLocation :: parent( ) . into( ) , default_fee_per_second( ) * 70 , 0u128 ) ;
221231}
222232
223233//- From PR https://github.com/paritytech/cumulus/pull/936
@@ -244,7 +254,14 @@ impl<T: Get<MultiLocation>> ContainsPair<MultiAsset, MultiLocation> for ReserveA
244254 }
245255}
246256
247- //--
257+ pub type Traders = (
258+ // RUSD
259+ FixedRateOfFungible < RUsdPerSecond , ( ) > ,
260+ // Roc
261+ FixedRateOfFungible < RocPerSecond , ( ) > ,
262+ // Everything else
263+ UsingComponents < WeightToFee , SelfReserve , AccountId , Balances , ToAuthor < Runtime > > ,
264+ ) ;
248265
249266pub type Reserves = ( NativeAsset , ReserveAssetsFrom < RockmineLocation > ) ;
250267
@@ -262,8 +279,7 @@ impl xcm_executor::Config for XcmConfig {
262279 RuntimeCall ,
263280 MaxInstructions ,
264281 > ;
265- type Trader = UsingComponents < WeightToFee , SelfReserve , AccountId , Balances , ToAuthor < Runtime > > ;
266-
282+ type Trader = Traders ;
267283 type ResponseHandler = PolkadotXcm ;
268284 type AssetTrap = TrappistDropAssets <
269285 AssetIdForTrustBackedAssets ,
0 commit comments