types

package
Version: v1.65.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WasmX      = "wasm"
	NameRegExp = "^[a-z0-9]+$"
	//TODO: max size to define
	MaxCodeSize = 1 << 20
)
View Source
const (
	WasmActionCreate = iota + 1
	WasmActionUpdate
	WasmActionCall
)

action for executor

View Source
const (
	TyLogWasmCreate = iota + 100
	TyLogWasmUpdate
	TyLogWasmCall
	TyLogCustom
	TyLogLocalData
)

log ty for executor

Variables

View Source
var (
	ErrContractExist       = errors.New("contract already exist")
	ErrContractNotExist    = errors.New("contract not exist")
	ErrInvalidCreator      = errors.New("invalid contract creator")
	ErrInvalidWasm         = errors.New("invalid wasm code")
	ErrCodeOversize        = errors.New("code oversize")
	ErrInvalidMethod       = errors.New("invalid method")
	ErrInvalidContractName = errors.New("invalid contract name")
	ErrInvalidParam        = errors.New("invalid parameters")
	ErrUnknown             = errors.New("unknown error")
)
View Source
var NameReg *regexp.Regexp

Functions

func InitExecutor

func InitExecutor(cfg *types.Chain33Config)

func InitFork

func InitFork(cfg *types.Chain33Config)

Types

type CallContractLog

type CallContractLog struct {
	Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	Method   string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	Result   int32  `protobuf:"varint,3,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*CallContractLog) Descriptor deprecated

func (*CallContractLog) Descriptor() ([]byte, []int)

Deprecated: Use CallContractLog.ProtoReflect.Descriptor instead.

func (*CallContractLog) GetContract

func (x *CallContractLog) GetContract() string

func (*CallContractLog) GetMethod

func (x *CallContractLog) GetMethod() string

func (*CallContractLog) GetResult

func (x *CallContractLog) GetResult() int32

func (*CallContractLog) ProtoMessage

func (*CallContractLog) ProtoMessage()

func (*CallContractLog) ProtoReflect added in v1.65.3

func (x *CallContractLog) ProtoReflect() protoreflect.Message

func (*CallContractLog) Reset

func (x *CallContractLog) Reset()

func (*CallContractLog) String

func (x *CallContractLog) String() string

type CreateContractLog

type CreateContractLog struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateContractLog) Descriptor deprecated

func (*CreateContractLog) Descriptor() ([]byte, []int)

Deprecated: Use CreateContractLog.ProtoReflect.Descriptor instead.

func (*CreateContractLog) GetCode

func (x *CreateContractLog) GetCode() string

func (*CreateContractLog) GetName

func (x *CreateContractLog) GetName() string

func (*CreateContractLog) ProtoMessage

func (*CreateContractLog) ProtoMessage()

func (*CreateContractLog) ProtoReflect added in v1.65.3

func (x *CreateContractLog) ProtoReflect() protoreflect.Message

func (*CreateContractLog) Reset

func (x *CreateContractLog) Reset()

func (*CreateContractLog) String

func (x *CreateContractLog) String() string

type CustomLog

type CustomLog struct {
	Info []string `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"`
	// contains filtered or unexported fields
}

func (*CustomLog) Descriptor deprecated

func (*CustomLog) Descriptor() ([]byte, []int)

Deprecated: Use CustomLog.ProtoReflect.Descriptor instead.

func (*CustomLog) GetInfo

func (x *CustomLog) GetInfo() []string

func (*CustomLog) ProtoMessage

func (*CustomLog) ProtoMessage()

func (*CustomLog) ProtoReflect added in v1.65.3

func (x *CustomLog) ProtoReflect() protoreflect.Message

func (*CustomLog) Reset

func (x *CustomLog) Reset()

func (*CustomLog) String

func (x *CustomLog) String() string

type LocalDataLog

type LocalDataLog struct {
	Key   []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*LocalDataLog) Descriptor deprecated

func (*LocalDataLog) Descriptor() ([]byte, []int)

Deprecated: Use LocalDataLog.ProtoReflect.Descriptor instead.

func (*LocalDataLog) GetKey

func (x *LocalDataLog) GetKey() []byte

func (*LocalDataLog) GetValue

func (x *LocalDataLog) GetValue() []byte

func (*LocalDataLog) ProtoMessage

func (*LocalDataLog) ProtoMessage()

func (*LocalDataLog) ProtoReflect added in v1.65.3

func (x *LocalDataLog) ProtoReflect() protoreflect.Message

func (*LocalDataLog) Reset

func (x *LocalDataLog) Reset()

func (*LocalDataLog) String

func (x *LocalDataLog) String() string

type QueryCheckContract

type QueryCheckContract struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryCheckContract) Descriptor deprecated

func (*QueryCheckContract) Descriptor() ([]byte, []int)

Deprecated: Use QueryCheckContract.ProtoReflect.Descriptor instead.

func (*QueryCheckContract) GetName

func (x *QueryCheckContract) GetName() string

func (*QueryCheckContract) ProtoMessage

func (*QueryCheckContract) ProtoMessage()

func (*QueryCheckContract) ProtoReflect added in v1.65.3

func (x *QueryCheckContract) ProtoReflect() protoreflect.Message

func (*QueryCheckContract) Reset

func (x *QueryCheckContract) Reset()

func (*QueryCheckContract) String

func (x *QueryCheckContract) String() string

type QueryContractDB added in v1.65.3

type QueryContractDB struct {
	Contract string `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	Key      string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryContractDB) Descriptor deprecated added in v1.65.3

func (*QueryContractDB) Descriptor() ([]byte, []int)

Deprecated: Use QueryContractDB.ProtoReflect.Descriptor instead.

func (*QueryContractDB) GetContract added in v1.65.3

func (x *QueryContractDB) GetContract() string

func (*QueryContractDB) GetKey added in v1.65.3

func (x *QueryContractDB) GetKey() string

func (*QueryContractDB) ProtoMessage added in v1.65.3

func (*QueryContractDB) ProtoMessage()

func (*QueryContractDB) ProtoReflect added in v1.65.3

func (x *QueryContractDB) ProtoReflect() protoreflect.Message

func (*QueryContractDB) Reset added in v1.65.3

func (x *QueryContractDB) Reset()

func (*QueryContractDB) String added in v1.65.3

func (x *QueryContractDB) String() string

type UpdateContractLog added in v1.65.3

type UpdateContractLog struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateContractLog) Descriptor deprecated added in v1.65.3

func (*UpdateContractLog) Descriptor() ([]byte, []int)

Deprecated: Use UpdateContractLog.ProtoReflect.Descriptor instead.

func (*UpdateContractLog) GetCode added in v1.65.3

func (x *UpdateContractLog) GetCode() string

func (*UpdateContractLog) GetName added in v1.65.3

func (x *UpdateContractLog) GetName() string

func (*UpdateContractLog) ProtoMessage added in v1.65.3

func (*UpdateContractLog) ProtoMessage()

func (*UpdateContractLog) ProtoReflect added in v1.65.3

func (x *UpdateContractLog) ProtoReflect() protoreflect.Message

func (*UpdateContractLog) Reset added in v1.65.3

func (x *UpdateContractLog) Reset()

func (*UpdateContractLog) String added in v1.65.3

func (x *UpdateContractLog) String() string

type WasmAction

type WasmAction struct {

	// Types that are assignable to Value:
	//	*WasmAction_Create
	//	*WasmAction_Update
	//	*WasmAction_Call
	Value isWasmAction_Value `protobuf_oneof:"value"`
	Ty    int32              `protobuf:"varint,4,opt,name=ty,proto3" json:"ty,omitempty"`
	// contains filtered or unexported fields
}

func (*WasmAction) Descriptor deprecated

func (*WasmAction) Descriptor() ([]byte, []int)

Deprecated: Use WasmAction.ProtoReflect.Descriptor instead.

func (*WasmAction) GetCall

func (x *WasmAction) GetCall() *WasmCall

func (*WasmAction) GetCreate

func (x *WasmAction) GetCreate() *WasmCreate

func (*WasmAction) GetTy

func (x *WasmAction) GetTy() int32

func (*WasmAction) GetUpdate added in v1.65.3

func (x *WasmAction) GetUpdate() *WasmUpdate

func (*WasmAction) GetValue

func (m *WasmAction) GetValue() isWasmAction_Value

func (*WasmAction) ProtoMessage

func (*WasmAction) ProtoMessage()

func (*WasmAction) ProtoReflect added in v1.65.3

func (x *WasmAction) ProtoReflect() protoreflect.Message

func (*WasmAction) Reset

func (x *WasmAction) Reset()

func (*WasmAction) String

func (x *WasmAction) String() string

type WasmAction_Call

type WasmAction_Call struct {
	Call *WasmCall `protobuf:"bytes,3,opt,name=call,proto3,oneof"`
}

type WasmAction_Create

type WasmAction_Create struct {
	Create *WasmCreate `protobuf:"bytes,1,opt,name=create,proto3,oneof"`
}

type WasmAction_Update added in v1.65.3

type WasmAction_Update struct {
	Update *WasmUpdate `protobuf:"bytes,2,opt,name=update,proto3,oneof"`
}

type WasmCall

type WasmCall struct {
	Contract   string   `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	Method     string   `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	Parameters []int64  `protobuf:"varint,3,rep,packed,name=parameters,proto3" json:"parameters,omitempty"`
	Env        []string `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"`
	// contains filtered or unexported fields
}

func (*WasmCall) Descriptor deprecated

func (*WasmCall) Descriptor() ([]byte, []int)

Deprecated: Use WasmCall.ProtoReflect.Descriptor instead.

func (*WasmCall) GetContract

func (x *WasmCall) GetContract() string

func (*WasmCall) GetEnv

func (x *WasmCall) GetEnv() []string

func (*WasmCall) GetMethod

func (x *WasmCall) GetMethod() string

func (*WasmCall) GetParameters

func (x *WasmCall) GetParameters() []int64

func (*WasmCall) ProtoMessage

func (*WasmCall) ProtoMessage()

func (*WasmCall) ProtoReflect added in v1.65.3

func (x *WasmCall) ProtoReflect() protoreflect.Message

func (*WasmCall) Reset

func (x *WasmCall) Reset()

func (*WasmCall) String

func (x *WasmCall) String() string

type WasmCreate

type WasmCreate struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Code []byte `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*WasmCreate) Descriptor deprecated

func (*WasmCreate) Descriptor() ([]byte, []int)

Deprecated: Use WasmCreate.ProtoReflect.Descriptor instead.

func (*WasmCreate) GetCode

func (x *WasmCreate) GetCode() []byte

func (*WasmCreate) GetName

func (x *WasmCreate) GetName() string

func (*WasmCreate) ProtoMessage

func (*WasmCreate) ProtoMessage()

func (*WasmCreate) ProtoReflect added in v1.65.3

func (x *WasmCreate) ProtoReflect() protoreflect.Message

func (*WasmCreate) Reset

func (x *WasmCreate) Reset()

func (*WasmCreate) String

func (x *WasmCreate) String() string

type WasmType

type WasmType struct {
	types.ExecTypeBase
}

func NewType

func NewType(cfg *types.Chain33Config) *WasmType

func (*WasmType) GetLogMap

func (t *WasmType) GetLogMap() map[int64]*types.LogInfo

func (*WasmType) GetPayload

func (t *WasmType) GetPayload() types.Message

func (*WasmType) GetTypeMap

func (t *WasmType) GetTypeMap() map[string]int32

type WasmUpdate added in v1.65.3

type WasmUpdate struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Code []byte `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

func (*WasmUpdate) Descriptor deprecated added in v1.65.3

func (*WasmUpdate) Descriptor() ([]byte, []int)

Deprecated: Use WasmUpdate.ProtoReflect.Descriptor instead.

func (*WasmUpdate) GetCode added in v1.65.3

func (x *WasmUpdate) GetCode() []byte

func (*WasmUpdate) GetName added in v1.65.3

func (x *WasmUpdate) GetName() string

func (*WasmUpdate) ProtoMessage added in v1.65.3

func (*WasmUpdate) ProtoMessage()

func (*WasmUpdate) ProtoReflect added in v1.65.3

func (x *WasmUpdate) ProtoReflect() protoreflect.Message

func (*WasmUpdate) Reset added in v1.65.3

func (x *WasmUpdate) Reset()

func (*WasmUpdate) String added in v1.65.3

func (x *WasmUpdate) String() string

Jump to

Keyboard shortcuts

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