mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 21:11:20 +00:00
708ea9225d
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
31 lines
822 B
Go
31 lines
822 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(reqGen *requests.RequestGenerator, addr string, blockNum models.BlockNumber, checkBal uint64, logger log.Logger) {
|
|
logger.Info("Getting balance", "addeess", addr)
|
|
address := libcommon.HexToAddress(addr)
|
|
bal, err := requests.GetBalance(reqGen, 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)
|
|
}
|