utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BorReceiptKey

func BorReceiptKey(number uint64, hash common.Hash) []byte

BorReceiptKey = borReceiptPrefix + num (uint64 big endian) + hash

func BuildBlockProof

func BuildBlockProof(ctx context.Context, client types.IClient, txBlockNumber, startBlock, endBlock *big.Int) ([]byte, error)

func CallContract

func CallContract(ctx context.Context, client types.IClient, to common.Address, abi abi.ABI, method string, args ...interface{}) ([]interface{}, error)

func FindRootBlockFromChild

func FindRootBlockFromChild(ctx context.Context, client types.IClient, childBlockNumber *big.Int, rootChain common.Address) (*big.Int, error)

func Get added in v0.1.0

func Get(url string, params map[string]string, headers map[string]string) (string, error)

func GetAllLogIndices

func GetAllLogIndices(logEventSig string, receipt *ether.Receipt) ([]uint64, error)

func GetContractByNetwork added in v0.1.0

func GetContractByNetwork(network types.Network) types.Contract

func GetDerivedBorTxHash

func GetDerivedBorTxHash(receiptKey []byte) common.Hash

func GetLogIndex

func GetLogIndex(logEventSig string, receipt *ether.Receipt) uint64

func GetReceiptProof

func GetReceiptProof(ctx context.Context, client types.IClient, txReceipt *ether.Receipt, block *ether.Block) ([]byte, []byte, error)

Types

type MerkleTree

type MerkleTree struct {
	// contains filtered or unexported fields
}

func NewMerkleTree

func NewMerkleTree(leaves []common.Hash) (*MerkleTree, error)

func (*MerkleTree) GetLayers

func (merkleTree *MerkleTree) GetLayers() [][]common.Hash

func (*MerkleTree) GetLeaves

func (merkleTree *MerkleTree) GetLeaves() []common.Hash

func (*MerkleTree) GetRoot

func (merkleTree *MerkleTree) GetRoot() common.Hash

Jump to

Keyboard shortcuts

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