interop

package
v0.0.0-...-f94ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	GetConfig() config.ProtocolConfiguration
	Contracts() *native.Contracts
	GetCurrentValidators() ([]*keys.PublicKey, error)
}

type Context

type Context struct {
	Chain Chain
	Block *block.Block
	Tx    *transaction.Transaction
	VM    *EVM
	// contains filtered or unexported fields
}

Context represents context in which interops are executed.

func NewContext

func NewContext(block *block.Block, tx *transaction.Transaction, sdb *statedb.StateDB, chain Chain, tracer vm.EVMLogger) (*Context, error)

func (Context) Address

func (c Context) Address() common.Address

func (Context) Coinbase

func (c Context) Coinbase() common.Address

func (Context) Container

func (c Context) Container() *transaction.Transaction

func (Context) Dao

func (c Context) Dao() *dao.Simple

func (Context) Log

func (c Context) Log(log *types.Log)

func (Context) PersistingBlock

func (c Context) PersistingBlock() *block.Block

func (Context) Sender

func (c Context) Sender() common.Address

type EVM

type EVM struct {
	*vm.EVM
	ChainConfig *params.ChainConfig
}

func NewEVM

func NewEVM(bctx vm.BlockContext,
	tctx vm.TxContext,
	sdb vm.StateDB,
	protocolSettings config.ProtocolConfiguration,
	nativeContracts map[common.Address]vm.NativeContract, tracer vm.EVMLogger) *EVM

type NativeContract

type NativeContract interface {
	RequiredGas(ic native.InteropContext, input []byte) uint64
	Run(ic native.InteropContext, input []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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