[core] Add localnet only testing account in genesis conf (#3332)

[rosetta] Update Genesis to reflect localnet genesis changes

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
pull/3333/head
Daniel Van Der Maden 4 years ago committed by GitHub
parent 3aaccf8c81
commit 3de5809b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      core/genesis.go
  2. 3
      rosetta/services/block.go

@ -128,6 +128,13 @@ func NewGenesisSpec(netType nodeconfig.NetworkType, shardID uint32) *Genesis {
contractDeployerFunds, big.NewInt(denominations.One),
)
genesisAlloc[contractDeployerAddress] = GenesisAccount{Balance: contractDeployerFunds}
// Localnet only testing account
if netType == nodeconfig.Localnet {
// PK: 1f84c95ac16e6a50f08d44c7bde7aff8742212fda6e4321fde48bf83bef266dc
testAddress := common.HexToAddress("0xA5241513DA9F4463F1d4874b548dFBAC29D91f34")
genesisAlloc[testAddress] = GenesisAccount{Balance: contractDeployerFunds}
}
}
return &Genesis{

@ -1079,5 +1079,8 @@ func getGenesisSpec(shardID uint32) *core.Genesis {
if shard.Schedule.GetNetworkID() == shardingconfig.MainNet {
return core.NewGenesisSpec(nodeconfig.Mainnet, shardID)
}
if shard.Schedule.GetNetworkID() == shardingconfig.LocalNet {
return core.NewGenesisSpec(nodeconfig.Localnet, shardID)
}
return core.NewGenesisSpec(nodeconfig.Testnet, shardID)
}

Loading…
Cancel
Save