types

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "contract"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey is the msg router key for the IBC module
	RouterKey string = ModuleName
)
View Source
const (
	ObjectTypeHTTP cross.ObjectType = 10
)
View Source
const (
	QuerySimulation = "simulation"
)

Variables

View Source
var (
	ErrFailedContractHandle = sdkerrors.Register(ModuleName, 2, "failed to execute contract handler")
	ErrFailedCommitStore    = sdkerrors.Register(ModuleName, 3, "failed to commit updates")
)
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func EncodeContractCallInfo added in v0.0.5

func EncodeContractCallInfo(c ContractCallInfo) ([]byte, error)

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type ContractCallInfo

type ContractCallInfo struct {
	ID     string   `json:"id"`
	Method string   `json:"method"`
	Args   [][]byte `json:"args"`
}

func DecodeContractCallInfo added in v0.0.5

func DecodeContractCallInfo(bz []byte) (*ContractCallInfo, error)

func NewContractCallInfo

func NewContractCallInfo(id, method string, args [][]byte) ContractCallInfo

func (ContractCallInfo) Bytes

func (ci ContractCallInfo) Bytes() []byte

type ContractCallResponse

type ContractCallResponse struct {
	ReturnValue []byte    `json:"return_value"`
	OPs         cross.OPs `json:"ops"`
}

type ContractHandlerResult

type ContractHandlerResult struct {
	Data   []byte
	Events sdk.Events
}

func NewContractHandlerResult

func NewContractHandlerResult(data []byte, events sdk.Events) ContractHandlerResult

func (ContractHandlerResult) GetData

func (r ContractHandlerResult) GetData() []byte

func (ContractHandlerResult) GetEvents

func (r ContractHandlerResult) GetEvents() sdk.Events

type HTTPObject added in v0.0.5

type HTTPObject struct {
	K          []byte
	ServerInfo *HTTPServerInfo
}

func (HTTPObject) Evaluate added in v0.0.5

func (o HTTPObject) Evaluate(_ []byte) ([]byte, error)

func (HTTPObject) Key added in v0.0.5

func (o HTTPObject) Key() []byte

func (HTTPObject) Type added in v0.0.5

func (HTTPObject) Type() cross.ObjectType

type HTTPResolver added in v0.0.5

type HTTPResolver struct {
	Router ServerRouter
}

func NewHTTPResolver added in v0.0.5

func NewHTTPResolver(router ServerRouter) HTTPResolver

func (HTTPResolver) Resolve added in v0.0.5

func (rs HTTPResolver) Resolve(bz []byte) (cross.Object, error)

type HTTPServerInfo added in v0.0.5

type HTTPServerInfo struct {
	Address string
}

type HTTPServerRouter added in v0.0.5

type HTTPServerRouter struct {
	// contains filtered or unexported fields
}

func NewHTTPServerRouter added in v0.0.5

func NewHTTPServerRouter() *HTTPServerRouter

func (*HTTPServerRouter) AddRoute added in v0.0.5

func (r *HTTPServerRouter) AddRoute(id string, info HTTPServerInfo)

func (HTTPServerRouter) Route added in v0.0.5

func (r HTTPServerRouter) Route(bz []byte) (cross.Object, error)

type MsgContractCall

type MsgContractCall struct {
	Sender              sdk.AccAddress            `json:"sender" yaml:"sender"`
	Signers             []sdk.AccAddress          `json:"signers" yaml:"signers"`
	CallInfo            cross.ContractCallInfo    `json:"call_info" yaml:"call_info"`
	StateConstraintType cross.StateConstraintType `json:"state_constraint_type" yaml:"state_constraint_type"`
}

func NewMsgContractCall

func NewMsgContractCall(sender sdk.AccAddress, signers []sdk.AccAddress, callInfo cross.ContractCallInfo, scType cross.StateConstraintType) MsgContractCall

func (MsgContractCall) GetSignBytes

func (msg MsgContractCall) GetSignBytes() []byte

func (MsgContractCall) GetSigners

func (msg MsgContractCall) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg GetSigners returns the addresses that must sign the transaction. Addresses are returned in a deterministic order. Duplicate addresses will be omitted.

func (MsgContractCall) Route

func (MsgContractCall) Route() string

func (MsgContractCall) Type

func (MsgContractCall) Type() string

func (MsgContractCall) ValidateBasic

func (msg MsgContractCall) ValidateBasic() error

type QuerySimulationResponse

type QuerySimulationResponse = sdk.Result

type ServerRouter added in v0.0.5

type ServerRouter interface {
	Route(bz []byte) (cross.Object, error)
}

Jump to

Keyboard shortcuts

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