Make -account handle both base16 and bech32

pull/1057/head
Eugene Kim 6 years ago committed by Rongjian Lan
parent 272e6bae4c
commit 60847baef0
  1. 6
      internal/genesis/genesis.go

@ -7,6 +7,7 @@ import (
"strings" "strings"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/harmony-one/harmony/internal/common"
"github.com/harmony-one/harmony/internal/utils" "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 address could be from GenesisAccounts or from GenesisFNAccounts
// the account index can be used to determin the shard of the account // the account index can be used to determin the shard of the account
func FindAccount(address string) (int, *DeployAccount) { func FindAccount(address string) (int, *DeployAccount) {
addr := common.ParseAddr(address)
for i, acc := range GenesisAccounts { for i, acc := range GenesisAccounts {
if address == acc.Address { if addr == common.ParseAddr(acc.Address) {
return i, &acc return i, &acc
} }
} }
for i, acc := range GenesisFNAccounts { for i, acc := range GenesisFNAccounts {
if address == acc.Address { if addr == common.ParseAddr(acc.Address) {
return i + 8, &acc return i + 8, &acc
} }
} }

Loading…
Cancel
Save