plugins

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SafeBlockNumber      = rpc.BlockNumber(-4)
	FinalizedBlockNumber = rpc.BlockNumber(-3)
	PendingBlockNumber   = rpc.BlockNumber(-2)
	LatestBlockNumber    = rpc.BlockNumber(-1)
	EarliestBlockNumber  = rpc.BlockNumber(0)
)

Variables

This section is empty.

Functions

func BytesToAddress

func BytesToAddress(data []byte) common.Address

func BytesToHash

func BytesToHash(data []byte) types.Hash

func Compress

func Compress(data []byte) []byte

func Decompress

func Decompress(data []byte) ([]byte, error)

func DeriveBlockNumberOrHash

func DeriveBlockNumberOrHash(db *sql.DB, blockNrOrHash BlockNumberOrHash) (*uint64, *types.Hash, error)

func GetLogsBloom

func GetLogsBloom(db *sql.DB, blockNumber uint64) ([]byte, error)

func GetTopicIndex

func GetTopicIndex(topics []types.Hash, idx int) []byte

func GetTransactionReceiptsBlock

func GetTransactionReceiptsBlock(ctx context.Context, db *sql.DB, offset, limit int, chainid uint64, whereClause string, params ...interface{}) ([]map[string]interface{}, error)

func TrimPrefix

func TrimPrefix(data []byte) []byte

func UintToHexBig

func UintToHexBig(a uint64) *hexutil.Big

Types

type BlockNumberOrHash

type BlockNumberOrHash struct {
	BlockNumber      *rpc.BlockNumber `json:"blockNumber,omitempty"`
	BlockHash        *types.Hash      `json:"blockHash,omitempty"`
	RequireCanonical bool             `json:"requireCanonical,omitempty"`
}

func BlockNumberOrHashWithHash

func BlockNumberOrHashWithHash(hash types.Hash, canonical bool) BlockNumberOrHash

func BlockNumberOrHashWithNumber

func BlockNumberOrHashWithNumber(blockNr rpc.BlockNumber) BlockNumberOrHash

func (*BlockNumberOrHash) Hash

func (bnh *BlockNumberOrHash) Hash() (types.Hash, bool)

func (*BlockNumberOrHash) Number

func (bnh *BlockNumberOrHash) Number() (rpc.BlockNumber, bool)

func (*BlockNumberOrHash) String added in v1.7.0

func (bnh *BlockNumberOrHash) String() string

func (*BlockNumberOrHash) UnmarshalJSON

func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error

type LogType

type LogType struct {
	Address     common.Address `json:"address" gencodec:"required"`
	Topics      []types.Hash   `json:"topics" gencodec:"required"`
	Data        hexutil.Bytes  `json:"data" gencodec: "required"`
	BlockNumber string         `json:"blockNumber"`
	TxHash      types.Hash     `json:"transactionHash" gencodec:"required"`
	TxIndex     hexutil.Uint   `json:"transactionIndex"`
	BlockHash   types.Hash     `json:"blockHash"`
	Index       hexutil.Uint   `json:"logIndex"`
	Removed     bool           `json:"removed"`
}

type PluginLoader

type PluginLoader struct {
	Plugins     []pluginDetails
	LookupCache map[string][]interface{}
}

func NewPluginLoader

func NewPluginLoader(cfg *config.Config) (*PluginLoader, error)

func (*PluginLoader) Initialize

func (pl *PluginLoader) Initialize(cfg *config.Config)

func (*PluginLoader) Lookup

func (pl *PluginLoader) Lookup(name string, validate func(interface{}) bool) []interface{}

type SortLogs

type SortLogs []*LogType

func GetLogs

func GetLogs(db *sql.DB, blockNumber uint64, bkHash types.Hash, txIndex uint64) (SortLogs, error)

func (SortLogs) Len

func (ms SortLogs) Len() int

func (SortLogs) Less

func (ms SortLogs) Less(i, j int) bool

func (SortLogs) Swap

func (ms SortLogs) Swap(i, j int)

Directories

Path Synopsis
packages

Jump to

Keyboard shortcuts

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