Documentation ¶
Index ¶
- Constants
- Variables
- func CheckBlockFinality(evmHeader types.Header, evmBlockHash rCommon.Hash, hosts []string, ...) (bool, bool, error)
- func GetEVMHeaderByHash(evmBlockHash rCommon.Hash, host string) (*types.Header, error)
- func GetEVMHeaderByNumber(blockNumber *big.Int, host string) (*types.Header, error)
- func GetMostRecentEVMBlockHeight(host string) (*big.Int, error)
- func InitCacher()
- type EVMCallerError
- type EVMCallerLogger
- type EVMHeaderResult
- func GetEVMHeaderResult(evmBlockHash rCommon.Hash, hosts []string, minConfirmationBlocks int, ...) (*EVMHeaderResult, error)
- func GetEVMHeaderResultMultipleHosts(evmBlockHash rCommon.Hash, hosts []string, minConfirmationBlocks int) (*EVMHeaderResult, error)
- func NewEVMHeaderResult() *EVMHeaderResult
- type GetEVMBlockNumRes
- type GetEVMHeaderByHashRes
- type GetEVMHeaderByNumberRes
Constants ¶
View Source
const ( UnexpectedError = iota GetEVMHeaderByHashError GetEVMHeaderByHeightError GetEVMBlockHeightError GetEVMHeaderResultFromDBError )
View Source
const CacheLiveTime = 5 * time.Minute
Variables ¶
View Source
var ErrCodeMessage = map[int]struct { Code int Message string }{ UnexpectedError: {-16000, "Unexpected error"}, GetEVMHeaderByHashError: {-16001, "Get evm header by block hash error"}, GetEVMHeaderByHeightError: {-16002, "Get evm header by block height error"}, GetEVMBlockHeightError: {-16003, "Get latest evm block height error"}, GetEVMHeaderResultFromDBError: {-16004, "Get evm header result from DB error"}, }
View Source
var Logger = EVMCallerLogger{}
Global instant to use
Functions ¶
func CheckBlockFinality ¶
func GetEVMHeaderByHash ¶
func GetEVMHeaderByNumber ¶
func GetMostRecentEVMBlockHeight ¶
GetMostRecentEVMBlockHeight get most recent block height on Ethereum/BSC/PLG
func InitCacher ¶
func InitCacher()
Types ¶
type EVMCallerError ¶
type EVMCallerError struct { Code int // The code to send with reject messages Message string // Human readable message of the issue Err error }
func NewEVMCallerError ¶
func NewEVMCallerError(key int, err error, params ...interface{}) *EVMCallerError
func (EVMCallerError) Error ¶
func (e EVMCallerError) Error() string
Error satisfies the error interface and prints human-readable errors.
type EVMCallerLogger ¶
type EVMCallerLogger struct {
// contains filtered or unexported fields
}
func (*EVMCallerLogger) Init ¶
func (metricLogger *EVMCallerLogger) Init(inst common.Logger)
type EVMHeaderResult ¶
func GetEVMHeaderResult ¶
func NewEVMHeaderResult ¶
func NewEVMHeaderResult() *EVMHeaderResult
type GetEVMBlockNumRes ¶
type GetEVMBlockNumRes struct { rpccaller.RPCBaseRes Result string `json:"result"` }
type GetEVMHeaderByHashRes ¶
type GetEVMHeaderByHashRes struct { rpccaller.RPCBaseRes Result *types.Header `json:"result"` }
type GetEVMHeaderByNumberRes ¶
type GetEVMHeaderByNumberRes struct { rpccaller.RPCBaseRes Result *types.Header `json:"result"` }
Click to show internal directories.
Click to hide internal directories.