Skip to content
Snippets Groups Projects
Commit a6a9b4e8 authored by Miguel Montes's avatar Miguel Montes
Browse files

Cambio de tipo del argumento de los métodos Balance y BalanceAtBlock

parent 771b74ac
No related branches found
No related tags found
No related merge requests found
...@@ -259,13 +259,13 @@ func (node *Node) PeerCount() uint64 { ...@@ -259,13 +259,13 @@ func (node *Node) PeerCount() uint64 {
return uint64(peerCount) 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 var balance BigInt
node.Call(&balance, "eth_getBalance", account, hexBlockNumber(blockNumber)) node.Call(&balance, "eth_getBalance", account, hexBlockNumber(blockNumber))
return (*big.Int)(&balance) 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) return node.BalanceAtBlock(account, -1)
} }
...@@ -430,7 +430,7 @@ func (node *Node) SealersStatus(blockNumber int64) (status map[string]*SealerSta ...@@ -430,7 +430,7 @@ func (node *Node) SealersStatus(blockNumber int64) (status map[string]*SealerSta
status = make(map[string]*SealerStatus) status = make(map[string]*SealerStatus)
for _, address := range node.SealersAtBlock(blockNumber) { for _, address := range node.SealersAtBlock(blockNumber) {
status[address] = &SealerStatus{ status[address] = &SealerStatus{
Balance: node.BalanceAtBlock(address, blockNumber), Balance: node.BalanceAtBlock(common.HexToAddress(address), blockNumber),
} }
} }
notSeen := int64(len(status)) notSeen := int64(len(status))
......
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"../util" "../util"
"flag" "flag"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/common"
"log" "log"
"math/big" "math/big"
"os" "os"
...@@ -380,7 +381,7 @@ func status() { ...@@ -380,7 +381,7 @@ func status() {
util.Check(err) util.Check(err)
defer node.Close() defer node.Close()
for _, account := range node.Accounts() { for _, account := range node.Accounts() {
nodeStatus.Accounts[account] = node.Balance(account) nodeStatus.Accounts[account] = node.Balance(common.HexToAddress(account))
} }
nodeStatus.Coinbase, _ = node.Coinbase() nodeStatus.Coinbase, _ = node.Coinbase()
nodeStatus.BlockNumber = node.BlockNumber() nodeStatus.BlockNumber = node.BlockNumber()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment