tcp

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinTransferFee       = 1
	MinContractDeployFee = 10
	MinContractExecFee   = 1
)
View Source
const (
	TypeMsgContractDeploy  = "tcp_deploy"
	RouteMsgContractDeploy = "tcp"

	TypeMsgContractExec  = "tcp_exec"
	RouteMsgContractExec = "tcp"
)

message type and route constants

View Source
const (
	QueryContractCode = "code"
)

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "tcp" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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 NewKeeper

func NewKeeper(coinKeeper bank.Keeper, storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

NewKeeper creates new instances of the tcp Keeper

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 (k Keeper) GetContractAccountsIterator(ctx sdk.Context) sdk.Iterator

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) Type

func (msg MsgTransfer) Type() string

Type should return the action

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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