Skip to content

Commit d52b0c3

Browse files
authored
Merge pull request bnb-chain#3635 from holiman/hive_fixes
core/genesis: add support for setting nonce in 'alloc'
2 parents 7734ead + da92f5b commit d52b0c3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎core/genesis.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block,
5757
Code string
5858
Storage map[string]string
5959
Balance string
60+
Nonce string
6061
}
6162
}
6263

@@ -70,6 +71,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block,
7071
address := common.HexToAddress(addr)
7172
statedb.AddBalance(address, common.String2Big(account.Balance))
7273
statedb.SetCode(address, common.Hex2Bytes(account.Code))
74+
statedb.SetNonce(address, common.String2Big(account.Nonce).Uint64())
7375
for key, value := range account.Storage {
7476
statedb.SetState(address, common.HexToHash(key), common.HexToHash(value))
7577
}

0 commit comments

Comments
 (0)