types

package
v0.0.0-...-1237470 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeValueCategory = ModuleName

	EventTypeCreateCrossChainTx = "make_from_cosmos_proof"
	AttributeKeyStatus          = "status"
	AttributeKeyFromAddress     = "from_address"
	AttributeKeyFromContract    = "from_contract"
	AttributeKeyToChainId       = "to_chain_id"
	AttributeCrossChainId       = "cross_chainId"
	AttributeKeyTxParamHash     = "make_tx_param_hash"
	AttributeKeyMakeTxParam     = "make_tx_param"

	EventTypeVerifyToCosmosProof                        = "verify_to_cosmos_proof"
	AttributeKeyMerkleValueTxHash                       = "merkle_value:txhash"
	AttributeKeyMerkleValueMakeTxParamTxHash            = "merkle_value:make_tx_param:txhash"
	AttributeKeyMerkleValueMakeTxParamToContractAddress = "merkle_value:make_tx_param:to_contract_address"
	AttributeKeyFromChainId                             = "from_chain_id"
)

Minting module event types

View Source
const (
	// module name
	ModuleName = "ccm"

	// default paramspace for params keeper
	DefaultParamspace = ModuleName

	// StoreKey is the default store key for mint
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the minting store.
	QuerierRoute = StoreKey

	// RouterKey is the message route for gov
	RouterKey = ModuleName

	// Query endpoints supported by the minting querier
	QueryParameters = "parameters"

	QueryIfContainContract = "if_contain_contract"
)

nolint

View Source
const (
	TypeMsgProcessCrossChainTx = "process_cross_chain_tx"
	TypeMsgCreateCoins         = "create_coins"
)

Governance message types and routes

View Source
const (
	QueryModuleBalance = "module_balance"
)

Variables

View Source
var (
	ErrMarshalSpecificType     = sdkerrors.Register(ModuleName, 1, "ErrMarshalSpecificType")
	ErrUnmarshalSpecificType   = sdkerrors.Register(ModuleName, 2, "ErrUnmarshalSpecificType")
	ErrProcessCrossChainTxType = sdkerrors.Register(ModuleName, 3, "ErrProcessCrossChainTxType")
	ErrVerifyToCosmosTxType    = sdkerrors.Register(ModuleName, 4, "ErrVerifyToCosmosTxType")

	ErrMsgProcessCrossChainTxType = sdkerrors.Register(ModuleName, 5, "ErrMsgProcessCrossChainTxType")
	ErrMsgCreateCrossChainTxType  = sdkerrors.Register(ModuleName, 6, "ErrMsgCreateCrossChainTxType")
	ErrGetModuleBalanceType       = sdkerrors.Register(ModuleName, 7, "ErrGetModuleBalanceType")
)
View Source
var (
	KeyCurrentChainIdForPolyChain = []byte("ChainIdForPolyChain")
)

Parameter store keys

View Source
var ModuleCdc *codec.Codec

generic sealed codec to be used throughout this module

View Source
var OperatorKey = []byte{0x00}

the one key to use for the keeper store

Functions

func ErrGetModuleBalance

func ErrGetModuleBalance(reason string) error

func ErrMarshalSpecificTypeFail

func ErrMarshalSpecificTypeFail(o interface{}, err error) error

func ErrMsgCreateCrossChainTx

func ErrMsgCreateCrossChainTx(reason string) error

func ErrMsgProcessCrossChainTx

func ErrMsgProcessCrossChainTx(reason string) error

func ErrProcessCrossChainTx

func ErrProcessCrossChainTx(reason string) error

func ErrUnmarshalSpecificTypeFail

func ErrUnmarshalSpecificTypeFail(o interface{}, err error) error

func ErrVerifyToCosmosTx

func ErrVerifyToCosmosTx(reason string) error

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for ccm module.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the provided genesis state to ensure the expected invariants holds.

Types

type GenesisState

type GenesisState struct {
	Params Params `json:"params" yaml:"params"` // inflation params
}

GenesisState - minter state

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState creates a default GenesisState object

func NewGenesisState

func NewGenesisState(params Params) GenesisState

NewGenesisState creates a new GenesisState object

type HeaderSyncKeeper

type HeaderSyncKeeper interface {
	ProcessHeader(ctx sdk.Context, header *polytype.Header, headerProof []byte, curHeader *polytype.Header) error
	GetConsensusPeers(ctx sdk.Context, chainId uint64) (*hs.ConsensusPeers, error)
}

SupplyKeeper defines the expected supply keeper

type MsgCreateCrossChainTx

type MsgCreateCrossChainTx struct {
	ToChainID         uint64
	ToContractAddress []byte
	Method            string
	Args              []byte
}

func NewMsgCreateCrossChainTx

func NewMsgCreateCrossChainTx(toChainId uint64, toContractAddr []byte, method string, args []byte) MsgCreateCrossChainTx

func (MsgCreateCrossChainTx) GetSignBytes

func (msg MsgCreateCrossChainTx) GetSignBytes() []byte

Implements Msg.

func (MsgCreateCrossChainTx) GetSigners

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

Implements Msg.

func (MsgCreateCrossChainTx) Route

func (msg MsgCreateCrossChainTx) Route() string

nolint

func (MsgCreateCrossChainTx) String

func (msg MsgCreateCrossChainTx) String() string

func (MsgCreateCrossChainTx) Type

func (msg MsgCreateCrossChainTx) Type() string

func (MsgCreateCrossChainTx) ValidateBasic

func (msg MsgCreateCrossChainTx) ValidateBasic() error

Implements Msg.

type MsgProcessCrossChainTx

type MsgProcessCrossChainTx struct {
	Submitter   sdk.AccAddress // transaction submitter
	FromChainId uint64         // the poly chain id
	Proof       string         // the audit path of cross chain transaction where the root is Header.CrossStateRoot
	Header      string         // the header of height where the cross chain transaction appears
	HeaderProof string         // the audit path of Header where the reliable root is CurHeader.BlockRoot
	CurHeader   string         // any header within current consensus epoch
}

func NewMsgProcessCrossChainTx

func NewMsgProcessCrossChainTx(submitter sdk.AccAddress, fromChainId uint64, proof, header, headerProof, curHeader string) MsgProcessCrossChainTx

func (MsgProcessCrossChainTx) GetSignBytes

func (msg MsgProcessCrossChainTx) GetSignBytes() []byte

Implements Msg.

func (MsgProcessCrossChainTx) GetSigners

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

Implements Msg.

func (MsgProcessCrossChainTx) Route

func (msg MsgProcessCrossChainTx) Route() string

nolint

func (MsgProcessCrossChainTx) String

func (msg MsgProcessCrossChainTx) String() string

func (MsgProcessCrossChainTx) Type

func (msg MsgProcessCrossChainTx) Type() string

func (MsgProcessCrossChainTx) ValidateBasic

func (msg MsgProcessCrossChainTx) ValidateBasic() error

Implements Msg.

type Params

type Params struct {
	ChainIdInPolyNet uint64 `json:"chain_id_in_poly_net" yaml:"chain_id_in_poly_net"` // chain id of current cosmos chain for cross chain in poly chain network
}

func DefaultParams

func DefaultParams() Params

default ccm module parameters

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

Implements params.ParamSet

func (Params) String

func (p Params) String() string

func (Params) Validate

func (p Params) Validate() error

validate params

type QueryCcmParams

type QueryCcmParams struct {
}

func NewQueryCcmParams

func NewQueryCcmParams() QueryCcmParams

type QueryContainToContractParam

type QueryContainToContractParam struct {
	KeyStore       string
	ToContractAddr []byte
	FromChainId    uint64
}

QueryBalanceParams defines the params for querying an account balance.

func NewQueryContainToContractParam

func NewQueryContainToContractParam(keystore string, toContractAddr []byte, fromChainId uint64) QueryContainToContractParam

type QueryContainToContractRes

type QueryContainToContractRes struct {
	KeyStore string
	Exist    bool
	Info     string
}

func (QueryContainToContractRes) String

func (this QueryContainToContractRes) String() string

type QueryModuleBalanceParam

type QueryModuleBalanceParam struct {
	ModuleName string
}

func NewQueryModuleBalanceParam

func NewQueryModuleBalanceParam(moduleName string) QueryModuleBalanceParam

type SupplyKeeper

type SupplyKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI
	// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
	SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI)

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	SetSupply(ctx sdk.Context, supply supplyexported.SupplyI)
	GetSupply(ctx sdk.Context) (supply supplyexported.SupplyI)
}

SupplyKeeper defines the expected supply keeper

type UnlockKeeper

type UnlockKeeper interface {
	Unlock(ctx sdk.Context, fromChainId uint64, fromContractAddr sdk.AccAddress, toContractAddr []byte, argsBs []byte) error
	ContainToContractAddr(ctx sdk.Context, toContractAddr []byte, fromChainId uint64) bool
}

Jump to

Keyboard shortcuts

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