api

package
v0.0.0-...-f31cdad Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSpanTooSmall            = errors.New("span to write is too small")
	ErrValidation              = errors.New("wasm code does not pass basic validation")
	ErrDeserialization         = errors.New("fail to deserialize wasm into Partity-wasm module")
	ErrSerialization           = errors.New("fail to serialize Parity-wasm module into wasm")
	ErrInvalidImports          = errors.New("wasm code contains invalid import symbols")
	ErrInvalidExports          = errors.New("wasm code contains invalid export symbols")
	ErrBadMemorySection        = errors.New("wasm code contains bad memory sections")
	ErrGasCounterInjection     = errors.New("fail to inject gas counter into Wasm code")
	ErrStackHeightInjection    = errors.New("fail to inject stack height limit into Wasm code")
	ErrInstantiation           = errors.New("error while instantiating Wasm with resolvers")
	ErrRuntime                 = errors.New("runtime error while executing the Wasm script")
	ErrOutOfGas                = errors.New("out-of-gas while executing the wasm script")
	ErrBadEntrySignature       = errors.New("bad execution entry point signature")
	ErrMemoryOutOfBound        = errors.New("out-of-bound memory access while executing the wasm script")
	ErrWrongPeriodAction       = errors.New("OEI action to invoke is not available")
	ErrTooManyExternalData     = errors.New("too many external data requests")
	ErrDuplicateExternalID     = errors.New("wasm code asks data with duplicate external id")
	ErrBadValidatorIndex       = errors.New("bad validator index parameter")
	ErrBadExternalID           = errors.New("bad external ID parameter")
	ErrUnavailableExternalData = errors.New("external data is not available")
	ErrRepeatSetReturnData     = errors.New("set return data is called more than once")
	ErrUnknown                 = errors.New("unknown error")
)

Functions

func Compile

func Compile(code []byte, spanSize int) ([]byte, error)

Types

type EnvInterface

type EnvInterface interface {
	GetCalldata() []byte
	SetReturnData([]byte) error
	GetAskCount() int64
	GetMinCount() int64
	GetAnsCount() (int64, error)
	AskExternalData(eid int64, did int64, data []byte) error
	GetExternalDataStatus(eid int64, vid int64) (int64, error)
	GetExternalData(eid int64, vid int64) ([]byte, error)
}

type RunOutput

type RunOutput struct {
	GasUsed uint32
}

func Execute

func Execute(code []byte, gasLimit uint32, spanSize int64, env EnvInterface) (RunOutput, error)

func Prepare

func Prepare(code []byte, gasLimit uint32, spanSize int64, env EnvInterface) (RunOutput, error)

Jump to

Keyboard shortcuts

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