diff --git a/bfa_client/src/bfa/node.go b/bfa_client/src/bfa/node.go index 6d11f47e7ea6385d157f8b7d49c3a26a14412e71..c0b66fe304321761d796392aeaf22f71e0125bce 100644 --- a/bfa_client/src/bfa/node.go +++ b/bfa_client/src/bfa/node.go @@ -259,13 +259,13 @@ func (node *Node) PeerCount() uint64 { return uint64(peerCount) } -func (node *Node) BalanceAtBlock(account string, blockNumber int64) *big.Int { +func (node *Node) BalanceAtBlock(account common.Address, blockNumber int64) *big.Int { var balance BigInt node.Call(&balance, "eth_getBalance", account, hexBlockNumber(blockNumber)) return (*big.Int)(&balance) } -func (node *Node) Balance(account string) *big.Int { +func (node *Node) Balance(account common.Address) *big.Int { return node.BalanceAtBlock(account, -1) } @@ -430,7 +430,7 @@ func (node *Node) SealersStatus(blockNumber int64) (status map[string]*SealerSta status = make(map[string]*SealerStatus) for _, address := range node.SealersAtBlock(blockNumber) { status[address] = &SealerStatus{ - Balance: node.BalanceAtBlock(address, blockNumber), + Balance: node.BalanceAtBlock(common.HexToAddress(address), blockNumber), } } notSeen := int64(len(status)) diff --git a/bfa_client/src/client/bfa_client.go b/bfa_client/src/client/bfa_client.go index 68429b3bbcbdf92c7c15f9d254f0ecb659e56c14..f3f25ace7e062c969343a22e01d80f52332cb68c 100644 --- a/bfa_client/src/client/bfa_client.go +++ b/bfa_client/src/client/bfa_client.go @@ -5,6 +5,7 @@ import ( "../util" "flag" "fmt" + "github.com/ethereum/go-ethereum/common" "log" "math/big" "os" @@ -380,7 +381,7 @@ func status() { util.Check(err) defer node.Close() for _, account := range node.Accounts() { - nodeStatus.Accounts[account] = node.Balance(account) + nodeStatus.Accounts[account] = node.Balance(common.HexToAddress(account)) } nodeStatus.Coinbase, _ = node.Coinbase() nodeStatus.BlockNumber = node.BlockNumber()