@@ -20,6 +20,10 @@ const ACCOUNT_2_BONDED_AMOUNT: u64 = 2_000_000;
2020const ACCOUNT_1_BALANCE : u64 = 1_000_000_000 ;
2121const ACCOUNT_2_BALANCE : u64 = 2_000_000_000 ;
2222
23+ const ACCOUNT_3_BONDED_AMOUNT : u64 = 3_000_000 ;
24+
25+ const ACCOUNT_3_BALANCE : u64 = 3_000_000_000 ;
26+
2327static ACCOUNT_1_PUBLIC_KEY : Lazy < PublicKey > = Lazy :: new ( || {
2428 let secret_key = SecretKey :: ed25519_from_bytes ( [ 42 ; SecretKey :: ED25519_LENGTH ] ) . unwrap ( ) ;
2529 PublicKey :: from ( & secret_key)
@@ -31,6 +35,11 @@ static ACCOUNT_2_PUBLIC_KEY: Lazy<PublicKey> = Lazy::new(|| {
3135} ) ;
3236static ACCOUNT_2_ADDR : Lazy < AccountHash > = Lazy :: new ( || AccountHash :: from ( & * ACCOUNT_2_PUBLIC_KEY ) ) ;
3337
38+ static ACCOUNT_3_PUBLIC_KEY : Lazy < PublicKey > = Lazy :: new ( || {
39+ let secret_key = SecretKey :: ed25519_from_bytes ( [ 45 ; SecretKey :: ED25519_LENGTH ] ) . unwrap ( ) ;
40+ PublicKey :: from ( & secret_key)
41+ } ) ;
42+
3443static GENESIS_CUSTOM_ACCOUNTS : Lazy < Vec < GenesisAccount > > = Lazy :: new ( || {
3544 let account_1 = {
3645 let account_1_balance = Motes :: new ( ACCOUNT_1_BALANCE ) ;
@@ -56,7 +65,18 @@ static GENESIS_CUSTOM_ACCOUNTS: Lazy<Vec<GenesisAccount>> = Lazy::new(|| {
5665 ) ) ,
5766 )
5867 } ;
59- vec ! [ account_1, account_2]
68+ let account_3 = {
69+ let account_3_balance = Motes :: new ( ACCOUNT_3_BALANCE ) ;
70+ let account_3_bonded_amount = Motes :: new ( ACCOUNT_3_BONDED_AMOUNT ) ;
71+ GenesisAccount :: Delegator {
72+ validator_public_key : ACCOUNT_1_PUBLIC_KEY . clone ( ) ,
73+ delegator_public_key : ACCOUNT_3_PUBLIC_KEY . clone ( ) ,
74+ balance : account_3_balance,
75+ delegated_amount : account_3_bonded_amount,
76+ }
77+ } ;
78+
79+ vec ! [ account_1, account_2, account_3]
6080} ) ;
6181
6282#[ ignore]
@@ -118,6 +138,16 @@ fn should_run_genesis() {
118138#[ ignore]
119139#[ test]
120140fn should_track_total_token_supply_in_mint ( ) {
141+ should_track_total_token ( false )
142+ }
143+
144+ #[ ignore]
145+ #[ test]
146+ fn should_track_total_token_supply_in_mint_with_enable_addressable_entity ( ) {
147+ should_track_total_token ( true )
148+ }
149+
150+ fn should_track_total_token ( enable_ae : bool ) {
121151 let accounts = GENESIS_CUSTOM_ACCOUNTS . clone ( ) ;
122152 let wasm_config = * DEFAULT_WASM_CONFIG ;
123153 let system_config = * DEFAULT_SYSTEM_CONFIG ;
@@ -139,6 +169,7 @@ fn should_track_total_token_supply_in_mint() {
139169 . with_unbonding_delay ( unbonding_delay)
140170 . with_genesis_timestamp_millis ( genesis_timestamp)
141171 . with_storage_costs ( * DEFAULT_STORAGE_COSTS )
172+ . with_enable_addressable_entity ( enable_ae)
142173 . build ( ) ;
143174
144175 let genesis_request = GenesisRequest :: new (
@@ -148,7 +179,9 @@ fn should_track_total_token_supply_in_mint() {
148179 DEFAULT_CHAINSPEC_REGISTRY . clone ( ) ,
149180 ) ;
150181
151- let mut builder = LmdbWasmTestBuilder :: default ( ) ;
182+ let chainspec_config = ChainspecConfig :: default ( ) . with_enable_addressable_entity ( enable_ae) ;
183+
184+ let mut builder = LmdbWasmTestBuilder :: new_temporary_with_config ( chainspec_config) ;
152185
153186 builder. run_genesis ( genesis_request) ;
154187
0 commit comments