arwen

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AddressLen = 32
View Source
const BalanceLen = 32
View Source
const HashLen = 32

Variables

This section is empty.

Functions

func AddHostContext added in v0.2.5

func AddHostContext(ctx VMContext) int

func ConvertReturnValue added in v0.2.5

func ConvertReturnValue(wasmValue wasmer.Value) *big.Int

func LoadBytes added in v0.2.5

func LoadBytes(from *wasmer.Memory, offset int32, length int32) []byte

func RemoveHostContext added in v0.2.5

func RemoveHostContext(idx int)

func StoreBytes added in v0.2.5

func StoreBytes(to *wasmer.Memory, offset int32, data []byte) error

Types

type BigIntContext added in v0.2.5

type BigIntContext interface {
	GasSchedule() *config.GasCost
	UseGas(gas uint64)
	GasLeft() uint64
	Put(value int64) int32
	GetOne(id int32) *big.Int
	GetTwo(id1, id2 int32) (*big.Int, *big.Int)
	GetThree(id1, id2, id3 int32) (*big.Int, *big.Int, *big.Int)
	Arguments() []*big.Int
	GetStorage(addr []byte, key []byte) []byte
	SetStorage(addr []byte, key []byte, value []byte) int32
	GetVMInput() vmcommon.VMInput
	GetBalance(addr []byte) []byte
	GetSCAddress() []byte
	Finish(data []byte)
}

func GetBigIntContext added in v0.2.5

func GetBigIntContext(pointer unsafe.Pointer) BigIntContext

type CryptoContext added in v0.2.5

type CryptoContext interface {
	GasSchedule() *config.GasCost
	UseGas(gas uint64)
	CryptoHooks() vmcommon.CryptoHook
}

func GetCryptoContext added in v0.2.5

func GetCryptoContext(pointer unsafe.Pointer) CryptoContext

type EthContext added in v0.2.5

type EthContext interface {
	GasSchedule() *config.GasCost
	GetSCAddress() []byte
	CallData() []byte
	UseGas(gas uint64)
	GasLeft() uint64
	BlockGasLimit() uint64
	GetBalance(addr []byte) []byte
	BlockHash(nonce int64) []byte
	GetVMInput() vmcommon.VMInput
	Transfer(destination []byte, sender []byte, value *big.Int, input []byte, gas int64) (gasLeft int64, err error)
	GetStorage(addr []byte, key []byte) []byte
	SetStorage(addr []byte, key []byte, value []byte) int32
	GetCode(addr []byte) []byte
	GetCodeSize(addr []byte) int32
	SignalUserError()
	Finish(data []byte)
	WriteLog(addr []byte, topics [][]byte, data []byte)
	SelfDestruct(addr []byte, beneficiary []byte)
}

func GetEthContext added in v0.2.5

func GetEthContext(pointer unsafe.Pointer) EthContext

type HostContext

type HostContext interface {
	GasSchedule() *config.GasCost
	UseGas(gas uint64)
	GasLeft() uint64
	Function() string
	Arguments() []*big.Int
	GetStorage(addr []byte, key []byte) []byte
	SetStorage(addr []byte, key []byte, value []byte) int32
	GetBalance(addr []byte) []byte
	BlockHash(nonce int64) []byte
	GetVMInput() vmcommon.VMInput
	GetSCAddress() []byte
	WriteLog(addr []byte, topics [][]byte, data []byte)
	Transfer(destination []byte, sender []byte, value *big.Int, input []byte, gas int64) (gasLeft int64, err error)
	Finish(data []byte)
	BlockChainHook() vmcommon.BlockchainHook
	SignalUserError()
}

func GetErdContext added in v0.2.5

func GetErdContext(pointer unsafe.Pointer) HostContext

type VMContext added in v0.2.5

type VMContext interface {
	EthContext() EthContext
	CoreContext() HostContext
	BigInContext() BigIntContext
	CryptoContext() CryptoContext
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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