Documentation ¶
Index ¶
- type BlockContext
- type Environment
- func (env *Environment) BlockContext() *BlockContext
- func (env *Environment) Call(proc func(env *Environment) []interface{}) (output []byte, err error)
- func (env *Environment) Caller() meter.Address
- func (env *Environment) Log(abi *abi.Event, address meter.Address, topics []meter.Bytes32, ...)
- func (env *Environment) ParseArgs(val interface{})
- func (env *Environment) Seeker() *chain.Seeker
- func (env *Environment) State() *state.State
- func (env *Environment) To() meter.Address
- func (env *Environment) TransactionContext() *TransactionContext
- func (env *Environment) UseGas(gas uint64)
- type TransactionContext
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) 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
Click to show internal directories.
Click to hide internal directories.