MCPcopy
hub / github.com/bnb-chain/bsc / toBlockNumArg

Function toBlockNumArg

ethclient/ethclient.go:692–705  ·  view source on GitHub ↗
(number *big.Int)

Source from the content-addressed store, hash-verified

690}
691
692func toBlockNumArg(number *big.Int) string {
693 if number == nil {
694 return "latest"
695 }
696 if number.Sign() >= 0 {
697 return hexutil.EncodeBig(number)
698 }
699 // It's negative.
700 if number.IsInt64() {
701 return rpc.BlockNumber(number.Int64()).String()
702 }
703 // It's negative and large, which is invalid.
704 return fmt.Sprintf("<invalid %d>", number)
705}
706
707func toCallArg(msg ethereum.CallMsg) interface{} {
708 arg := map[string]interface{}{

Callers 12

BlockByNumberMethod · 0.70
HeaderByNumberMethod · 0.70
GetRootByDiffHashMethod · 0.70
TransactionsInBlockMethod · 0.70
BalanceAtMethod · 0.70
StorageAtMethod · 0.70
CodeAtMethod · 0.70
NonceAtMethod · 0.70
toFilterArgFunction · 0.70
CallContractMethod · 0.70
FeeHistoryMethod · 0.70

Calls 5

EncodeBigFunction · 0.92
BlockNumberTypeAlias · 0.92
Int64Method · 0.80
StringMethod · 0.65
SignMethod · 0.45

Tested by

no test coverage detected