From 60847baef07c2bd7887e2fc9a13e6ca48ac93c92 Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Fri, 14 Jun 2019 18:15:13 -0700 Subject: [PATCH] Make -account handle both base16 and bech32 --- internal/genesis/genesis.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/genesis/genesis.go b/internal/genesis/genesis.go index 0cbd35242..bc079e016 100644 --- a/internal/genesis/genesis.go +++ b/internal/genesis/genesis.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/crypto" + "github.com/harmony-one/harmony/internal/common" "github.com/harmony-one/harmony/internal/utils" ) @@ -40,13 +41,14 @@ func BeaconAccountPriKey() *ecdsa.PrivateKey { // the account address could be from GenesisAccounts or from GenesisFNAccounts // the account index can be used to determin the shard of the account func FindAccount(address string) (int, *DeployAccount) { + addr := common.ParseAddr(address) for i, acc := range GenesisAccounts { - if address == acc.Address { + if addr == common.ParseAddr(acc.Address) { return i, &acc } } for i, acc := range GenesisFNAccounts { - if address == acc.Address { + if addr == common.ParseAddr(acc.Address) { return i + 8, &acc } }