Merge pull request #1055 from harmony-ek/fix_find_account

Make -account handle both base16 and bech32
pull/1058/head
Eugene Kim 6 years ago committed by GitHub
commit e35c52c37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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