utils

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: CC0-1.0 Imports: 23 Imported by: 3

Documentation

Index

Constants

View Source
const (
	AccountId = "aurora"
)

Variables

View Source
var Constants constants

Functions

func CalculateKeccak256 added in v1.1.0

func CalculateKeccak256(input []byte) string

CalculateKeccak256 calculates and returns the Keccak256 hash of the input data

func ClientIpFromContext added in v1.1.0

func ClientIpFromContext(ctx context.Context) (*net.IP, bool)

ClientIpFromContext returns the clientIp value stored in ctx, if any.

func ComputeBlockHash

func ComputeBlockHash(bHeight, chainId uint64) []byte

func GetChainId

func GetChainId(ctx context.Context) uint64

GetChainId returns the chainId in the following order;

  1. returns chainId if exists in ctx
  2. returns chainId if exists in relayer configuration .yml file
  3. returns defaultChainId=1313161554

func GetPrehistoryChainId

func GetPrehistoryChainId() uint64

GetPrehistoryChainId returns the chainId config that the prehistory was indexed for;

  1. returns prehistoryChainId if exists in relayer configuration .yml file
  2. returns defaultChainId=1313161554

func GetPrehistoryHeight

func GetPrehistoryHeight() uint64

GetPrehistoryHeight returns the height of the prehistory given in relayer configuration .yml file

  1. returns prehistoryHeight if exists in relayer configuration .yml file
  2. returns defaultPrehistoryHeight=37157758 that is for mainnet

func IndexerBlockToDbBlock

func IndexerBlockToDbBlock(block *indexer.Block) *dbt.Block

func IndexerLogToDbLog

func IndexerLogToDbLog(log *indexer.Log) *dbt.Log

func IndexerTxnToDbTxn

func IndexerTxnToDbTxn(txn *indexer.Transaction, cumulativeGas primitives.Quantity) *dbt.Transaction

func ParseEVMRevertReason

func ParseEVMRevertReason(data []byte) (string, error)

ParseEVMRevertReason resolves the abi-encoded revert reason

func PutChainId

func PutChainId(ctx context.Context, chainId uint64) context.Context

PutChainId is a helper function to put chainId in the context, also see GetChainId

func PutClientIpKey added in v1.1.0

func PutClientIpKey(ctx context.Context, ip net.IP) context.Context

PutClientIpKey is a helper function to put clientIp in the context so that handlers can use it

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL