Documentation ¶
Index ¶
- Constants
- Variables
- func ErrGetModuleBalance(reason string) error
- func ErrMarshalSpecificTypeFail(o interface{}, err error) error
- func ErrMsgCreateCrossChainTx(reason string) error
- func ErrMsgProcessCrossChainTx(reason string) error
- func ErrProcessCrossChainTx(reason string) error
- func ErrUnmarshalSpecificTypeFail(o interface{}, err error) error
- func ErrVerifyToCosmosTx(reason string) error
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type GenesisState
- type HeaderSyncKeeper
- type MsgCreateCrossChainTx
- func (msg MsgCreateCrossChainTx) GetSignBytes() []byte
- func (msg MsgCreateCrossChainTx) GetSigners() []sdk.AccAddress
- func (msg MsgCreateCrossChainTx) Route() string
- func (msg MsgCreateCrossChainTx) String() string
- func (msg MsgCreateCrossChainTx) Type() string
- func (msg MsgCreateCrossChainTx) ValidateBasic() error
- type MsgProcessCrossChainTx
- func (msg MsgProcessCrossChainTx) GetSignBytes() []byte
- func (msg MsgProcessCrossChainTx) GetSigners() []sdk.AccAddress
- func (msg MsgProcessCrossChainTx) Route() string
- func (msg MsgProcessCrossChainTx) String() string
- func (msg MsgProcessCrossChainTx) Type() string
- func (msg MsgProcessCrossChainTx) ValidateBasic() error
- type Params
- type QueryCcmParams
- type QueryContainToContractParam
- type QueryContainToContractRes
- type QueryModuleBalanceParam
- type SupplyKeeper
- type UnlockKeeper
Constants ¶
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
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
const ( TypeMsgProcessCrossChainTx = "process_cross_chain_tx" TypeMsgCreateCoins = "create_coins" )
Governance message types and routes
const (
QueryModuleBalance = "module_balance"
)
Variables ¶
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") )
var (
KeyCurrentChainIdForPolyChain = []byte("ChainIdForPolyChain")
)
Parameter store keys
var ModuleCdc *codec.Codec
generic sealed codec to be used throughout this module
var OperatorKey = []byte{0x00}
the one key to use for the keeper store
Functions ¶
func ErrGetModuleBalance ¶
func ErrProcessCrossChainTx ¶
func ErrVerifyToCosmosTx ¶
func RegisterCodec ¶
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) 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) 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 (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
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 ¶
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