33#![ cfg( test) ]
44
55use frame_support:: { impl_outer_event, impl_outer_origin, parameter_types} ;
6- use orml_traits:: { parameter_type_with_key, OnDust } ;
6+ use orml_traits:: parameter_type_with_key;
77use pallet_balances;
88use sp_core:: H256 ;
99use sp_runtime:: {
@@ -12,8 +12,6 @@ use sp_runtime::{
1212 AccountId32 , ModuleId , Perbill ,
1313} ;
1414
15- use tokens;
16-
1715use super :: * ;
1816
1917mod currencies {
@@ -24,7 +22,7 @@ impl_outer_event! {
2422 pub enum TestEvent for Runtime {
2523 frame_system<T >,
2624 currencies<T >,
27- tokens <T >,
25+ orml_tokens <T >,
2826 pallet_balances<T >,
2927 }
3028}
@@ -91,13 +89,6 @@ impl pallet_balances::Trait for Runtime {
9189}
9290pub type PalletBalances = pallet_balances:: Module < Runtime > ;
9391
94- pub struct MockOnDust ;
95- impl OnDust < AccountId , CurrencyId , Balance > for MockOnDust {
96- fn on_dust ( who : & AccountId , currency_id : CurrencyId , amount : Balance ) {
97- let _ = <Tokens as MultiCurrency < _ > >:: transfer ( currency_id, who, & DustAccount :: get ( ) , amount) ;
98- }
99- }
100-
10192parameter_type_with_key ! {
10293 pub ExistentialDeposits : |currency_id: CurrencyId | -> Balance {
10394 Default :: default ( )
@@ -108,16 +99,16 @@ parameter_types! {
10899 pub DustAccount : AccountId = ModuleId ( * b"orml/dst" ) . into_account( ) ;
109100}
110101
111- impl tokens :: Trait for Runtime {
102+ impl orml_tokens :: Trait for Runtime {
112103 type Event = TestEvent ;
113104 type Balance = Balance ;
114105 type Amount = i64 ;
115106 type CurrencyId = CurrencyId ;
116107 type WeightInfo = ( ) ;
117108 type ExistentialDeposits = ExistentialDeposits ;
118- type OnDust = MockOnDust ;
109+ type OnDust = orml_tokens :: TransferDust < Runtime , DustAccount > ;
119110}
120- pub type Tokens = tokens :: Module < Runtime > ;
111+ pub type Tokens = orml_tokens :: Module < Runtime > ;
121112
122113pub const NATIVE_CURRENCY_ID : CurrencyId = 1 ;
123114pub const X_TOKEN_ID : CurrencyId = 2 ;
@@ -186,7 +177,7 @@ impl ExtBuilder {
186177 . assimilate_storage ( & mut t)
187178 . unwrap ( ) ;
188179
189- tokens :: GenesisConfig :: < Runtime > {
180+ orml_tokens :: GenesisConfig :: < Runtime > {
190181 endowed_accounts : self
191182 . endowed_accounts
192183 . into_iter ( )
0 commit comments