From 3de5809b0b050a3d648c4178214d6df73658b6ab Mon Sep 17 00:00:00 2001 From: Daniel Van Der Maden Date: Fri, 4 Sep 2020 09:32:25 -0700 Subject: [PATCH] [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 --- core/genesis.go | 7 +++++++ rosetta/services/block.go | 3 +++ 2 files changed, 10 insertions(+) diff --git a/core/genesis.go b/core/genesis.go index 113c4b35c..1dcaf764e 100644 --- a/core/genesis.go +++ b/core/genesis.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{ diff --git a/rosetta/services/block.go b/rosetta/services/block.go index 5ca490dee..c2329b779 100644 --- a/rosetta/services/block.go +++ b/rosetta/services/block.go @@ -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) }