xenv

package
v1.2.0-pre-fork6-fix3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: LGPL-3.0 Imports: 13 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 meter.Address
	Signer      meter.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,
	seeker *chain.Seeker,
	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() meter.Address

func (*Environment) Log

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

func (*Environment) ParseArgs

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

func (*Environment) Seeker

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

func (*Environment) State

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

func (*Environment) To

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

func (*Environment) TransactionContext

func (env *Environment) TransactionContext() *TransactionContext

func (*Environment) UseGas

func (env *Environment) UseGas(gas uint64)

type TransactionContext

type TransactionContext struct {
	ID         meter.Bytes32
	Origin     meter.Address
	GasPrice   *big.Int
	ProvedWork *big.Int
	BlockRef   tx.BlockRef
	Expiration uint32
	Nonce      uint64
}

TransactionContext transaction context.

func (*TransactionContext) String

func (ctx *TransactionContext) String() string

Jump to

Keyboard shortcuts

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