common

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorStackHandler

func ErrorStackHandler(h log.Handler) log.Handler

ErrorStackHandler is a log handler that prints the stack trace of an error

func Exit added in v0.1.1

func Exit(msg string, args ...any)

Exit prints the message to stderr and exits with status 1

func PrintMessage added in v0.1.1

func PrintMessage(msg string, args ...any)

PrintMessage prints a message to the console (i.e. stdout)

Types

type Address

type Address = common.Address

Address is an alias for geth Address

type BigInt

type BigInt = *big.Int

BigInt is used everywhere in Ethereum

type Block

type Block = types.Block

Block is an alias for geth Block

type Hash

type Hash = common.Hash

Hash is an alias for geth Hash

type Header = types.Header

Header is an alias for geth Header

type Transaction

type Transaction interface {
	BlockNumber() BigInt

	Hash() Hash

	From() *Address

	To() *Address

	Value() BigInt

	Timestamp() uint64

	Data() []byte
}

Transaction represents an Ethereum transaction.

func WrapTransaction

func WrapTransaction(txn *types.Transaction, blockNumber BigInt, from *common.Address, timestamp uint64) Transaction

func WrapTransactionWithBlock

func WrapTransactionWithBlock(txn *types.Transaction, block *types.Block, sender *common.Address) Transaction

type Transactions

type Transactions = []Transaction

type TxnRequest

type TxnRequest struct {
	PrivateKey *ecdsa.PrivateKey
	To         *Address
	Value      BigInt
	Data       []byte
	GasLimit   uint64
	GasPrice   BigInt
}

TxnRequest represents a transaction to be submitted for execution

type WrappedTransaction

type WrappedTransaction struct {
	*types.Transaction
	// contains filtered or unexported fields
}

WrappedTransaction is a wrapper around geth Transaction for convenience

func (*WrappedTransaction) BlockNumber

func (t *WrappedTransaction) BlockNumber() BigInt

func (*WrappedTransaction) From

func (t *WrappedTransaction) From() *Address

func (*WrappedTransaction) Timestamp

func (t *WrappedTransaction) Timestamp() uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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