xenv

package
v2.1.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockContext

type BlockContext struct {
	Beneficiary thor.Address
	Signer      thor.Address
	Number      uint32
	Time        uint64
	GasLimit    uint64
	TotalScore  uint64
}

BlockContext block context.

type Environment

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

Environment an env to execute native method.

func New

func New(
	abi *abi.Method,
	chain *chain.Chain,
	state *state.State,
	blockCtx *BlockContext,
	txCtx *TransactionContext,
	evm *vm.EVM,
	contract *vm.Contract,
) *Environment

New create a new env.

func (*Environment) BlockContext

func (env *Environment) BlockContext() *BlockContext

func (*Environment) Call

func (env *Environment) Call(proc func(env *Environment) []interface{}) (output []byte, err error)

func (*Environment) Caller

func (env *Environment) Caller() thor.Address

func (*Environment) Chain

func (env *Environment) Chain() *chain.Chain

func (*Environment) Log

func (env *Environment) Log(abi *abi.Event, address thor.Address, topics []thor.Bytes32, args ...interface{})

func (*Environment) ParseArgs

func (env *Environment) ParseArgs(val interface{})

func (*Environment) State

func (env *Environment) State() *state.State

func (*Environment) To

func (env *Environment) To() thor.Address

func (*Environment) TransactionContext

func (env *Environment) TransactionContext() *TransactionContext

func (*Environment) UseGas

func (env *Environment) UseGas(gas uint64)

type TransactionContext

type TransactionContext struct {
	ID         thor.Bytes32
	Origin     thor.Address
	GasPayer   thor.Address
	GasPrice   *big.Int
	ProvedWork *big.Int
	BlockRef   tx.BlockRef
	Expiration uint32
}

TransactionContext transaction context.

Jump to

Keyboard shortcuts

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