types

package
v1.65.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 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
	WasmActionCall
)

action for executor

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

log ty for executor

Variables

View Source
var (
	ErrContractExist       = errors.New("contract exist")
	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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CallContractLog) Descriptor

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

func (*CallContractLog) GetContract

func (m *CallContractLog) GetContract() string

func (*CallContractLog) GetMethod

func (m *CallContractLog) GetMethod() string

func (*CallContractLog) GetResult

func (m *CallContractLog) GetResult() int32

func (*CallContractLog) ProtoMessage

func (*CallContractLog) ProtoMessage()

func (*CallContractLog) Reset

func (m *CallContractLog) Reset()

func (*CallContractLog) String

func (m *CallContractLog) String() string

func (*CallContractLog) XXX_DiscardUnknown

func (m *CallContractLog) XXX_DiscardUnknown()

func (*CallContractLog) XXX_Marshal

func (m *CallContractLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CallContractLog) XXX_Merge

func (m *CallContractLog) XXX_Merge(src proto.Message)

func (*CallContractLog) XXX_Size

func (m *CallContractLog) XXX_Size() int

func (*CallContractLog) XXX_Unmarshal

func (m *CallContractLog) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateContractLog) Descriptor

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

func (*CreateContractLog) GetCode

func (m *CreateContractLog) GetCode() string

func (*CreateContractLog) GetName

func (m *CreateContractLog) GetName() string

func (*CreateContractLog) ProtoMessage

func (*CreateContractLog) ProtoMessage()

func (*CreateContractLog) Reset

func (m *CreateContractLog) Reset()

func (*CreateContractLog) String

func (m *CreateContractLog) String() string

func (*CreateContractLog) XXX_DiscardUnknown

func (m *CreateContractLog) XXX_DiscardUnknown()

func (*CreateContractLog) XXX_Marshal

func (m *CreateContractLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateContractLog) XXX_Merge

func (m *CreateContractLog) XXX_Merge(src proto.Message)

func (*CreateContractLog) XXX_Size

func (m *CreateContractLog) XXX_Size() int

func (*CreateContractLog) XXX_Unmarshal

func (m *CreateContractLog) XXX_Unmarshal(b []byte) error

type CustomLog

type CustomLog struct {
	Info                 []string `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CustomLog) Descriptor

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

func (*CustomLog) GetInfo

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

func (*CustomLog) ProtoMessage

func (*CustomLog) ProtoMessage()

func (*CustomLog) Reset

func (m *CustomLog) Reset()

func (*CustomLog) String

func (m *CustomLog) String() string

func (*CustomLog) XXX_DiscardUnknown

func (m *CustomLog) XXX_DiscardUnknown()

func (*CustomLog) XXX_Marshal

func (m *CustomLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CustomLog) XXX_Merge

func (m *CustomLog) XXX_Merge(src proto.Message)

func (*CustomLog) XXX_Size

func (m *CustomLog) XXX_Size() int

func (*CustomLog) XXX_Unmarshal

func (m *CustomLog) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LocalDataLog) Descriptor

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

func (*LocalDataLog) GetKey

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

func (*LocalDataLog) GetValue

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

func (*LocalDataLog) ProtoMessage

func (*LocalDataLog) ProtoMessage()

func (*LocalDataLog) Reset

func (m *LocalDataLog) Reset()

func (*LocalDataLog) String

func (m *LocalDataLog) String() string

func (*LocalDataLog) XXX_DiscardUnknown

func (m *LocalDataLog) XXX_DiscardUnknown()

func (*LocalDataLog) XXX_Marshal

func (m *LocalDataLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LocalDataLog) XXX_Merge

func (m *LocalDataLog) XXX_Merge(src proto.Message)

func (*LocalDataLog) XXX_Size

func (m *LocalDataLog) XXX_Size() int

func (*LocalDataLog) XXX_Unmarshal

func (m *LocalDataLog) XXX_Unmarshal(b []byte) error

type QueryCheckContract

type QueryCheckContract struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*QueryCheckContract) Descriptor

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

func (*QueryCheckContract) GetName

func (m *QueryCheckContract) GetName() string

func (*QueryCheckContract) ProtoMessage

func (*QueryCheckContract) ProtoMessage()

func (*QueryCheckContract) Reset

func (m *QueryCheckContract) Reset()

func (*QueryCheckContract) String

func (m *QueryCheckContract) String() string

func (*QueryCheckContract) XXX_DiscardUnknown

func (m *QueryCheckContract) XXX_DiscardUnknown()

func (*QueryCheckContract) XXX_Marshal

func (m *QueryCheckContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryCheckContract) XXX_Merge

func (m *QueryCheckContract) XXX_Merge(src proto.Message)

func (*QueryCheckContract) XXX_Size

func (m *QueryCheckContract) XXX_Size() int

func (*QueryCheckContract) XXX_Unmarshal

func (m *QueryCheckContract) XXX_Unmarshal(b []byte) error

type WasmAction

type WasmAction struct {
	// Types that are valid to be assigned to Value:
	//	*WasmAction_Create
	//	*WasmAction_Call
	Value                isWasmAction_Value `protobuf_oneof:"value"`
	Ty                   int32              `protobuf:"varint,3,opt,name=ty,proto3" json:"ty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*WasmAction) Descriptor

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

func (*WasmAction) GetCall

func (m *WasmAction) GetCall() *WasmCall

func (*WasmAction) GetCreate

func (m *WasmAction) GetCreate() *WasmCreate

func (*WasmAction) GetTy

func (m *WasmAction) GetTy() int32

func (*WasmAction) GetValue

func (m *WasmAction) GetValue() isWasmAction_Value

func (*WasmAction) ProtoMessage

func (*WasmAction) ProtoMessage()

func (*WasmAction) Reset

func (m *WasmAction) Reset()

func (*WasmAction) String

func (m *WasmAction) String() string

func (*WasmAction) XXX_DiscardUnknown

func (m *WasmAction) XXX_DiscardUnknown()

func (*WasmAction) XXX_Marshal

func (m *WasmAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WasmAction) XXX_Merge

func (m *WasmAction) XXX_Merge(src proto.Message)

func (*WasmAction) XXX_OneofWrappers

func (*WasmAction) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*WasmAction) XXX_Size

func (m *WasmAction) XXX_Size() int

func (*WasmAction) XXX_Unmarshal

func (m *WasmAction) XXX_Unmarshal(b []byte) error

type WasmAction_Call

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

type WasmAction_Create

type WasmAction_Create struct {
	Create *WasmCreate `protobuf:"bytes,1,opt,name=create,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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WasmCall) Descriptor

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

func (*WasmCall) GetContract

func (m *WasmCall) GetContract() string

func (*WasmCall) GetEnv

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

func (*WasmCall) GetMethod

func (m *WasmCall) GetMethod() string

func (*WasmCall) GetParameters

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

func (*WasmCall) ProtoMessage

func (*WasmCall) ProtoMessage()

func (*WasmCall) Reset

func (m *WasmCall) Reset()

func (*WasmCall) String

func (m *WasmCall) String() string

func (*WasmCall) XXX_DiscardUnknown

func (m *WasmCall) XXX_DiscardUnknown()

func (*WasmCall) XXX_Marshal

func (m *WasmCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WasmCall) XXX_Merge

func (m *WasmCall) XXX_Merge(src proto.Message)

func (*WasmCall) XXX_Size

func (m *WasmCall) XXX_Size() int

func (*WasmCall) XXX_Unmarshal

func (m *WasmCall) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WasmCreate) Descriptor

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

func (*WasmCreate) GetCode

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

func (*WasmCreate) GetName

func (m *WasmCreate) GetName() string

func (*WasmCreate) ProtoMessage

func (*WasmCreate) ProtoMessage()

func (*WasmCreate) Reset

func (m *WasmCreate) Reset()

func (*WasmCreate) String

func (m *WasmCreate) String() string

func (*WasmCreate) XXX_DiscardUnknown

func (m *WasmCreate) XXX_DiscardUnknown()

func (*WasmCreate) XXX_Marshal

func (m *WasmCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WasmCreate) XXX_Merge

func (m *WasmCreate) XXX_Merge(src proto.Message)

func (*WasmCreate) XXX_Size

func (m *WasmCreate) XXX_Size() int

func (*WasmCreate) XXX_Unmarshal

func (m *WasmCreate) XXX_Unmarshal(b []byte) error

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

Jump to

Keyboard shortcuts

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