Versions in this module Expand all Collapse all v0 v0.1.1 May 14, 2019 v0.1.0 May 14, 2019 Changes in this version + var ErrContractNotFound = errors.New("contract not found") + func CallContract(ps Process, addr, entry Reader, argb Reader) int + func ECRecover(ps Process, h, v, r, s Reader, ret Writer) int + func ECRecoverAddress(ps Process, h, v, r, s Reader, ret Writer) int + func GetArg(ps Process, idx, offset int, buf Writer) int + func GetSender(ps Process, w Writer) int + func Log(ps Process, msg Reader) int + func Read(ps Process, id, offset int, buf Writer) int + func ReadState(ps Process, key Reader, offset int, buf Writer) int + func SetResponse(ps Process, val Reader) int + func WriteState(ps Process, key, val Reader) int + type Args struct + func DeserializeArgs(b []byte) (Args, error) + func NewArgs(bs [][]byte) Args + func NewArgsFromStrings(ss []string) Args + func (a *Args) Len() int + func (a *Args) PushBytes(b []byte) + func (a *Args) PushString(s string) + func (a Args) Get(idx int) []byte + type Contract struct + Code []byte + Owner common.Address + func TxToContract(tx *transaction.ContractDeployTx) *Contract + func (c *Contract) Address() common.Address + func (c *Contract) Bytes() []byte + func (c *Contract) Decode(b []byte) error + func (c *Contract) Encode() ([]byte, error) + type ContractManager struct + func NewContractManager(mp ContractMapper) *ContractManager + func (cm *ContractManager) DeployContract(ctx types.Context, tx *transaction.ContractDeployTx) (common.Address, error) + func (cm *ContractManager) GetContract(ctx types.Context, addr common.Address) (*Contract, error) + func (cm *ContractManager) SaveContract(ctx types.Context, addr common.Address, c *Contract) error + type ContractMapper interface + Get func(ctx types.Context, addr common.Address) (*Contract, error) + Put func(ctx types.Context, addr common.Address, c *Contract) + func NewContractMapper(storeKey types.StoreKey) ContractMapper + type Env struct + Args Args + Context sdk.Context + Contract *Contract + DB *db.VersionedDB + EnvManager *EnvManager + Logger logger.Logger + Sender common.Address + VMProvider VMProvider + func (env *Env) Exec(ctx sdk.Context, entry string) (*Result, error) + func (env *Env) GetReponse() []byte + func (env *Env) SetResponse(v []byte) + type EnvManager struct + func NewEnvManager(key sdk.StoreKey, cm ContractMapper) *EnvManager + func (em *EnvManager) Get(ctx sdk.Context, sender, addr common.Address, args Args) (*Env, error) + type Process interface + Args func() Args + Call func(addr common.Address, entry []byte, args Args) (int, error) + Logger func() logger.Logger + Read func(id int) ([]byte, error) + Sender func() common.Address + SetResponse func([]byte) + State func() db.StateDB + ValueTable func() ValueTable + func NewProcess(vm *exec.VirtualMachine, env *Env, logger logger.Logger, vt ValueTable) Process + type Reader interface + Len func() int + Read func() []byte + func NewReader(mem []byte, pos, len int64) Reader + type Resolver struct + func NewResolver(env *Env) *Resolver + func (r *Resolver) ResolveFunc(module, field string) exec.FunctionImport + func (r *Resolver) ResolveGlobal(module, field string) int64 + type Result struct + Code int32 + RWSets *db.RWSets + Response []byte + type VM struct + func DefaultVMProvider(env *Env) (*VM, error) + type VMProvider func(*Env) (*VM, error) + type ValueTable interface + Get func(id int) ([]byte, error) + Put func(v []byte) (int, error) + type Writer interface + Len func() int + Write func([]byte) int + func NewWriter(mem []byte, pos, len int64) Writer