Make -account handle both base16 and bech32

pull/1055/head
Eugene Kim 6 years ago
parent 286adb9fb6
commit 3b9732dea8
  1. 6
      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
}
}

Loading…
Cancel
Save