@@ -19,12 +19,12 @@ use pallet_currencies::fungibles::FungibleCurrencies;
1919use primitives:: EvmAddress ;
2020use sp_runtime:: {
2121 traits:: { BlakeTwo256 , IdentityLookup } ,
22- BuildStorage ,
22+ AccountId32 , BuildStorage ,
2323} ;
2424use sp_std:: cell:: RefCell ;
2525use sp_std:: vec:: Vec ;
2626
27- type AccountId = u64 ;
27+ type AccountId = AccountId32 ;
2828pub type AssetId = u32 ;
2929type Balance = u128 ;
3030type Amount = i128 ;
@@ -35,19 +35,17 @@ pub const ATOKEN_ED: u128 = 1000u128;
3535
3636type Block = frame_system:: mocking:: MockBlock < Test > ;
3737
38- lazy_static:: lazy_static! {
39- pub static ref ALICE : AccountId = 100 ;
40- pub static ref BOB : AccountId = 200 ;
41- pub static ref DUSTER : AccountId = 300 ;
42- pub static ref TREASURY : AccountId = 400 ;
43- }
38+ pub const ALICE : AccountId = AccountId32 :: new ( [ 1u8 ; 32 ] ) ;
39+ pub const BOB : AccountId = AccountId32 :: new ( [ 2u8 ; 32 ] ) ;
40+ pub const DUSTER : AccountId = AccountId32 :: new ( [ 3u8 ; 32 ] ) ;
41+ pub const TREASURY : AccountId = AccountId32 :: new ( [ 4u8 ; 32 ] ) ;
4442
4543thread_local ! {
4644 pub static ATOKEN_IDS : RefCell <Vec <AssetId >> = const { RefCell :: new( vec![ ] ) } ;
4745}
4846
4947parameter_types ! {
50- pub TreasuryAccount : AccountId = * TREASURY ;
48+ pub TreasuryAccount : AccountId = TREASURY ;
5149}
5250
5351frame_support:: construct_runtime!(
@@ -76,13 +74,13 @@ parameter_types! {
7674}
7775
7876thread_local ! {
79- pub static KILLED : RefCell <Vec <u64 >> = const { RefCell :: new( vec![ ] ) } ;
77+ pub static KILLED : RefCell <Vec <AccountId32 >> = const { RefCell :: new( vec![ ] ) } ;
8078}
8179
8280pub struct RecordKilled ;
83- impl OnKilledAccount < u64 > for RecordKilled {
84- fn on_killed_account ( who : & u64 ) {
85- KILLED . with ( |r| r. borrow_mut ( ) . push ( * who) )
81+ impl OnKilledAccount < AccountId32 > for RecordKilled {
82+ fn on_killed_account ( who : & AccountId32 ) {
83+ KILLED . with ( |r| r. borrow_mut ( ) . push ( who. clone ( ) ) )
8684 }
8785}
8886
@@ -97,7 +95,7 @@ impl system::Config for Test {
9795 type Block = Block ;
9896 type Hash = H256 ;
9997 type Hashing = BlakeTwo256 ;
100- type AccountId = u64 ;
98+ type AccountId = AccountId32 ;
10199 type Lookup = IdentityLookup < Self :: AccountId > ;
102100 type RuntimeEvent = RuntimeEvent ;
103101 type BlockHashCount = BlockHashCount ;
@@ -190,8 +188,8 @@ impl Erc20OnDust<AccountId, AssetId> for ATokenDusterMock {
190188 let balance = Tokens :: free_balance ( currency_id, account) ;
191189 if balance < ATOKEN_ED {
192190 Tokens :: transfer (
193- RuntimeOrigin :: signed ( * account) ,
194- * dust_dest_account,
191+ RuntimeOrigin :: signed ( account. clone ( ) ) ,
192+ dust_dest_account. clone ( ) ,
195193 currency_id,
196194 balance,
197195 ) ?;
@@ -221,7 +219,7 @@ impl pallet_currencies::Config for Test {
221219 type NativeCurrency = BasicCurrencyAdapter < Test , Balances , Amount , u32 > ;
222220 type Erc20Currency = MockErc20Currency < Test > ;
223221 type BoundErc20 = MockBoundErc20 < Test > ;
224- type ReserveAccount = ( ) ;
222+ type ReserveAccount = TreasuryAccount ;
225223 type GetNativeCurrencyId = NativeCurrencyId ;
226224 type RegistryInspect = MockBoundErc20 < Test > ;
227225 type WeightInfo = ( ) ;
@@ -252,7 +250,7 @@ impl Default for ExtBuilder {
252250 fn default ( ) -> Self {
253251 Self {
254252 endowed_accounts : vec ! [ ] ,
255- native_balances : vec ! [ ( * TREASURY , 1_000_000 ) ] ,
253+ native_balances : vec ! [ ( TREASURY , 1_000_000 ) ] ,
256254 }
257255 }
258256}
@@ -284,7 +282,7 @@ impl ExtBuilder {
284282 . unwrap ( ) ;
285283
286284 duster:: GenesisConfig :: < Test > {
287- account_whitelist : vec ! [ * TREASURY ] ,
285+ account_whitelist : vec ! [ TREASURY ] ,
288286 }
289287 . assimilate_storage ( & mut t)
290288 . unwrap ( ) ;
0 commit comments