Documentation
¶
Index ¶
- Constants
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterCodec(cdc *codec.Codec)
- type Keeper
- func (k Keeper) DeployContract(ctx sdk.Context, contractAddr sdk.AccAddress, contactCode []byte, ...) sdk.Error
- func (k Keeper) GetContract(ctx sdk.Context, addr sdk.AccAddress) types.ConAccount
- func (k Keeper) GetContractAccountsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetResult(ctx sdk.Context, caller sdk.AccAddress, contractAddr sdk.AccAddress) string
- func (k Keeper) SetContractState(ctx sdk.Context, contractAddr sdk.AccAddress, fromAddr sdk.AccAddress, ...) bool
- type MsgContractDeploy
- type MsgContractExec
- type MsgTransfer
- type QueryResContractCode
Constants ¶
const ( MinTransferFee = 1 MinContractDeployFee = 10 MinContractExecFee = 1 )
const ( TypeMsgContractDeploy = "tcp_deploy" RouteMsgContractDeploy = "tcp" TypeMsgContractExec = "tcp_exec" RouteMsgContractExec = "tcp" )
message type and route constants
const (
QueryContractCode = "code"
)
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler returns a handler for "tcp" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func (Keeper) DeployContract ¶
func (k Keeper) DeployContract(ctx sdk.Context, contractAddr sdk.AccAddress, contactCode []byte, contactHash []byte, targets []sdk.AccAddress, dataSources []sdk.AccAddress) sdk.Error
func (Keeper) GetContract ¶
func (k Keeper) GetContract(ctx sdk.Context, addr sdk.AccAddress) types.ConAccount
func (Keeper) GetContractAccountsIterator ¶
func (Keeper) GetResult ¶
func (k Keeper) GetResult(ctx sdk.Context, caller sdk.AccAddress, contractAddr sdk.AccAddress) string
func (Keeper) SetContractState ¶
func (k Keeper) SetContractState(ctx sdk.Context, contractAddr sdk.AccAddress, fromAddr sdk.AccAddress, resultHash []byte) bool
type MsgContractDeploy ¶
type MsgContractDeploy struct { From sdk.AccAddress CID sdk.AccAddress Targets []sdk.AccAddress // only Targets can call contract DataSources []sdk.AccAddress Code []byte CodeHash []byte State []byte // TODO Fee sdk.Coins }
MsgContractDeploy defines a ContractDeploy message
func NewMsgContractDeploy ¶
func NewMsgContractDeploy(from sdk.AccAddress, CID sdk.AccAddress, targets []sdk.AccAddress, dataSources []sdk.AccAddress, code []byte, codeHash []byte) MsgContractDeploy
NewMsgContractDeploy is a constructor function for MsgTransfer
func (MsgContractDeploy) GetSignBytes ¶
func (msg MsgContractDeploy) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgContractDeploy) GetSigners ¶
func (msg MsgContractDeploy) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgContractDeploy) Route ¶
func (msg MsgContractDeploy) Route() string
Route should return the name of the module
func (MsgContractDeploy) Type ¶
func (msg MsgContractDeploy) Type() string
Type should return the action
func (MsgContractDeploy) ValidateBasic ¶
func (msg MsgContractDeploy) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgContractExec ¶
type MsgContractExec struct { From sdk.AccAddress CID sdk.AccAddress State []byte // TODO RequestParam types.RequestParam // TODO Proof []byte // TODO ResultHash []byte Fee sdk.Coins }
MsgContractExec defines a contractExec message
func NewMsgContractExec ¶
func NewMsgContractExec(from sdk.AccAddress, state []byte, proof []byte, resultHash []byte, req types.RequestParam) MsgContractExec
NewMsgContractDeploy is a constructor function for MsgTransfer
func (MsgContractExec) GetSignBytes ¶
func (msg MsgContractExec) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgContractExec) GetSigners ¶
func (msg MsgContractExec) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgContractExec) Route ¶
func (msg MsgContractExec) Route() string
Route should return the name of the module
func (MsgContractExec) Type ¶
func (msg MsgContractExec) Type() string
Type should return the action
func (MsgContractExec) ValidateBasic ¶
func (msg MsgContractExec) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgTransfer ¶
type MsgTransfer struct { From sdk.AccAddress To sdk.AccAddress Value sdk.Coins // State []byte // TODO Fee sdk.Coins }
MsgTransfer defines a transfer message
func NewMsgTransfer ¶
func NewMsgTransfer(from sdk.AccAddress, to sdk.AccAddress, value sdk.Coins) MsgTransfer
NewMsgTransfer is a constructor function for MsgTransfer
func (MsgTransfer) GetSignBytes ¶
func (msg MsgTransfer) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgTransfer) GetSigners ¶
func (msg MsgTransfer) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgTransfer) Route ¶
func (msg MsgTransfer) Route() string
Route should return the name of the module
func (MsgTransfer) ValidateBasic ¶
func (msg MsgTransfer) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type QueryResContractCode ¶
type QueryResContractCode struct {
Value string `json:"value"`
}
Query Result Payload for a
func (QueryResContractCode) String ¶
func (r QueryResContractCode) String() string
implement fmt.Stringer