aboutsummaryrefslogtreecommitdiffstats
path: root/core/genesis.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-16 18:27:38 +0800
committerobscuren <geffobscura@gmail.com>2015-03-16 18:27:38 +0800
commitb5234413611ce5984292f85a01de1f56c045b490 (patch)
treee6e0c6f7fe8358a2dc63cdea11ac66b4f59397f5 /core/genesis.go
parent0b8f66ed9ef177dc72442dd7ba337c6733e30344 (diff)
downloaddexon-b5234413611ce5984292f85a01de1f56c045b490.tar
dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.gz
dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.bz2
dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.lz
dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.xz
dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.zst
dexon-b5234413611ce5984292f85a01de1f56c045b490.zip
Moved ethutil => common
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 9c82a28c8..bfd51f196 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/state"
)
@@ -19,21 +19,21 @@ import (
var ZeroHash256 = make([]byte, 32)
var ZeroHash160 = make([]byte, 20)
var ZeroHash512 = make([]byte, 64)
-var EmptyShaList = crypto.Sha3(ethutil.Encode([]interface{}{}))
-var EmptyListRoot = crypto.Sha3(ethutil.Encode(""))
+var EmptyShaList = crypto.Sha3(common.Encode([]interface{}{}))
+var EmptyListRoot = crypto.Sha3(common.Encode(""))
var GenesisDiff = big.NewInt(131072)
var GenesisGasLimit = big.NewInt(3141592)
-func GenesisBlock(db ethutil.Database) *types.Block {
+func GenesisBlock(db common.Database) *types.Block {
genesis := types.NewBlock(ZeroHash256, ZeroHash160, nil, GenesisDiff, 42, "")
- genesis.Header().Number = ethutil.Big0
+ genesis.Header().Number = common.Big0
genesis.Header().GasLimit = GenesisGasLimit
- genesis.Header().GasUsed = ethutil.Big0
+ genesis.Header().GasUsed = common.Big0
genesis.Header().Time = 0
genesis.Header().MixDigest = make([]byte, 32)
- genesis.Td = ethutil.Big0
+ genesis.Td = common.Big0
genesis.SetUncles([]*types.Header{})
genesis.SetTransactions(types.Transactions{})
@@ -48,9 +48,9 @@ func GenesisBlock(db ethutil.Database) *types.Block {
statedb := state.New(genesis.Root(), db)
for addr, account := range accounts {
- codedAddr := ethutil.Hex2Bytes(addr)
+ codedAddr := common.Hex2Bytes(addr)
accountState := statedb.GetAccount(codedAddr)
- accountState.SetBalance(ethutil.Big(account.Balance))
+ accountState.SetBalance(common.Big(account.Balance))
statedb.UpdateStateObject(accountState)
}
statedb.Sync()