aboutsummaryrefslogtreecommitdiff
path: root/core/genesis.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 347beb3..ef490bf 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -78,11 +78,14 @@ func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error {
return nil
}
+type GenesisMultiCoinBalance map[common.Hash]*big.Int
+
// GenesisAccount is an account in the state of the genesis block.
type GenesisAccount struct {
Code []byte `json:"code,omitempty"`
Storage map[common.Hash]common.Hash `json:"storage,omitempty"`
Balance *big.Int `json:"balance" gencodec:"required"`
+ MCBalance GenesisMultiCoinBalance `json:"mcbalance,omitempty"`
Nonce uint64 `json:"nonce,omitempty"`
PrivateKey []byte `json:"secretKey,omitempty"` // for tests
}
@@ -261,6 +264,12 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block {
for key, value := range account.Storage {
statedb.SetState(addr, key, value)
}
+ if account.MCBalance != nil {
+ statedb.ForceEnableMultiCoin(addr)
+ for coinID, value := range account.MCBalance {
+ statedb.AddBalanceMultiCoin(addr, coinID, value)
+ }
+ }
}
root := statedb.IntermediateRoot(false)
head := &types.Header{