mint demo funds for testnet

pull/1209/head
Minh Doan 5 years ago committed by Minh Doan
parent fffc0b03f7
commit ac9f5c4054
  1. 11
      node/node_genesis.go

@ -76,6 +76,7 @@ func (node *Node) SetupGenesisBlock(db ethdb.Database, shardID uint32, myShardSt
genesisAlloc[foundationAddress] = core.GenesisAccount{Balance: genesisFunds}
}
case nodeconfig.Testnet:
AddDemoAddressesToGenesisAlloc(genesisAlloc)
fallthrough
case nodeconfig.Devnet:
chainConfig = *params.TestnetChainConfig
@ -149,3 +150,13 @@ func AddNodeAddressesToGenesisAlloc(genesisAlloc core.GenesisAlloc) {
genesisAlloc[address] = core.GenesisAccount{Balance: testBankFunds}
}
}
// AddDemoAddressesToGenesisAlloc funds demo addresses with free fund.
func AddDemoAddressesToGenesisAlloc(genesisAlloc core.GenesisAlloc) {
for _, account := range DemoAccounts {
testBankFunds := big.NewInt(InitFreeFund)
testBankFunds = testBankFunds.Mul(testBankFunds, big.NewInt(params.Ether))
address := common.HexToAddress(account.Address)
genesisAlloc[address] = core.GenesisAccount{Balance: testBankFunds}
}
}

Loading…
Cancel
Save