mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 13:01:21 +00:00
a8ec9eb471
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
31 lines
793 B
Go
31 lines
793 B
Go
package commands
|
|
|
|
import (
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
|
|
"github.com/ledgerwatch/log/v3"
|
|
)
|
|
|
|
const (
|
|
addr = "0x71562b71999873DB5b286dF957af199Ec94617F7"
|
|
)
|
|
|
|
func callGetBalance(addr string, blockNum models.BlockNumber, checkBal uint64, logger log.Logger) {
|
|
logger.Info("Getting balance", "addeess", addr)
|
|
address := libcommon.HexToAddress(addr)
|
|
bal, err := requests.GetBalance(models.ReqId, address, blockNum, logger)
|
|
if err != nil {
|
|
logger.Error("FAILURE", "error", err)
|
|
return
|
|
}
|
|
|
|
if checkBal > 0 && checkBal != bal {
|
|
logger.Error("FAILURE => Balance mismatch", "expected", checkBal, "got", bal)
|
|
return
|
|
}
|
|
|
|
logger.Info("SUCCESS", "balance", bal)
|
|
}
|