Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeContractCallInfo(c ContractCallInfo) ([]byte, error)
- func RegisterCodec(cdc *codec.Codec)
- type ContractCallInfo
- type ContractCallResponse
- type ContractHandlerResult
- type HTTPObject
- type HTTPObjectResolver
- type HTTPServerInfo
- type HTTPServerRouter
- type MsgContractCall
- type QuerySimulationResponse
- type ServerRouter
Constants ¶
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 )
const (
ObjectTypeHTTP cross.ObjectType = 10
)
const (
QuerySimulation = "simulation"
)
Variables ¶
var ( ErrFailedContractHandle = sdkerrors.Register(ModuleName, 2, "failed to execute contract handler") ErrFailedCommitStore = sdkerrors.Register(ModuleName, 3, "failed to commit updates") )
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 ¶
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 ContractHandlerResult ¶
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 }
HTTPObject is an Object that wraps HTTPServerInfo
func (HTTPObject) ChainID ¶ added in v0.0.6
func (o HTTPObject) ChainID() types.ChainID
ChainID implements Object.ChainID
func (HTTPObject) Evaluate ¶ added in v0.0.5
func (o HTTPObject) Evaluate(_ []byte) ([]byte, error)
Evaluate implements Object.Evaluate
func (HTTPObject) Type ¶ added in v0.0.5
func (HTTPObject) Type() cross.ObjectType
Type implements Object.Type
type HTTPObjectResolver ¶ added in v0.0.6
type HTTPObjectResolver struct {
Router ServerRouter
}
HTTPObjectResolver resolves a given ChainID and call info to HTTPObject
func NewHTTPObjectResolver ¶ added in v0.0.6
func NewHTTPObjectResolver(router ServerRouter) HTTPObjectResolver
NewHTTPObjectResolver returns a new HTTPObjectResolver
type HTTPServerInfo ¶ added in v0.0.5
HTTPServerInfo is an info of http server
type HTTPServerRouter ¶ added in v0.0.5
type HTTPServerRouter struct {
// contains filtered or unexported fields
}
HTTPServerRouter manages the routes to each http servers that have contract functions
func NewHTTPServerRouter ¶ added in v0.0.5
func NewHTTPServerRouter() *HTTPServerRouter
NewHTTPServerRouter returns a new HTTPServerRouter
func (*HTTPServerRouter) AddRoute ¶ added in v0.0.5
func (r *HTTPServerRouter) AddRoute(chainID types.ChainID, id string, info HTTPServerInfo)
AddRoute adds a new route to the http server
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