xenv

package
v0.0.0-...-e4e12f0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 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 workshare.Address
	Signer      workshare.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() workshare.Address

func (*Environment) Chain

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

func (*Environment) Log

func (env *Environment) Log(abi *abi.Event, address workshare.Address, topics []workshare.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() workshare.Address

func (*Environment) TransactionContext

func (env *Environment) TransactionContext() *TransactionContext

func (*Environment) UseGas

func (env *Environment) UseGas(gas uint64)

type TransactionContext

type TransactionContext struct {
	ID         workshare.Bytes32
	Origin     workshare.Address
	GasPayer   workshare.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