aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2017-01-25 03:42:47 +0800
committerMartin Holst Swende <martin@swende.se>2017-01-25 03:42:47 +0800
commitda92f5b2d6482b5d0b30a2b20f397f28427a2b0d (patch)
treee9df5e0869705ea32769ab5a3c66b3ebc22cdc59 /core
parentf1069a30b9ca13769ace154ff25dfabc83f25485 (diff)
downloaddexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.tar
dexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.tar.gz
dexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.tar.bz2
dexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.tar.lz
dexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.tar.xz
dexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.tar.zst
dexon-da92f5b2d6482b5d0b30a2b20f397f28427a2b0d.zip
core/genesis: add support for setting nonce in 'alloc'
This is to be able to set `pre`-state when performing blockchain tests through Hive, we need to be able to set the nonce.
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 4a440c267..a06c40408 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -57,6 +57,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block,
Code string
Storage map[string]string
Balance string
+ Nonce string
}
}
@@ -70,6 +71,7 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block,
address := common.HexToAddress(addr)
statedb.AddBalance(address, common.String2Big(account.Balance))
statedb.SetCode(address, common.Hex2Bytes(account.Code))
+ statedb.SetNonce(address, common.String2Big(account.Nonce).Uint64())
for key, value := range account.Storage {
statedb.SetState(address, common.HexToHash(key), common.HexToHash(value))
}