Documentation ¶
Index ¶
- Constants
- Variables
- func CreateOracleClaimFromMsgNotCosignedClaim(cdc *codec.Codec, msg MsgNotCosignedClaim) (oracle.Claim, error)
- func CreateOracleClaimFromMsgPegClaim(cdc *codec.Codec, msg MsgPegClaim) (oracle.Claim, error)
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type AccountKeeper
- type Cosigner
- type GenesisState
- type MsgConfirmedInvitation
- type MsgNewCosignerInvited
- type MsgNotCosignedClaim
- type MsgNotifyCosigned
- type MsgPeg
- type MsgPegClaim
- type MsgPendingRequestInvitation
- type MsgRecordUnpeg
- type MsgRequestInvitation
- type MsgUnpeg
- type OracleKeeper
- type ParamSubspace
- type Params
- type SlashingKeeper
- type SupplyKeeper
Constants ¶
const ( EventTypeCreateClaim = "create_claim" EventTypeProphecyStatus = "prophecy_status" EventTypePeg = "peg" EventTypeUnpeg = "unpeg" EventTypeInvitation = "request_invitation" AttributeKeyMainchainTxHash = "mainchain_tx_hash" AttributeKeyCosmosReceiver = "cosmos_receiver" AttributeKeyAmount = "amount" AttributeKeyStatus = "status" AttributeKeyClaimType = "claim_type" AttributeKeyMultisigCustodyAddress = "multisig_custody_address" AttributeKeyMultisigAccountAddress = "multisig_address" AttributeKeyCosmosSender = "cosmos_sender" AttributeKeyCosmosAccount = "cosmos_account" AttributeKeyMainchainAddress = "mainchain_address" AttributeKeyNewCosignerPublicKey = "new_cosigner_public_key" AttributeKeyConsumed = "consumed" AttributeKeyTxHash = "tx_hash" AttributeKeyNotCosignedValidators = "not_cosigned_validators" AttributeKeyFirstCosignerAddress = "first_cosigner_address" AttributeValueCategory = ModuleName )
proximax-bridge module event types
const ( // ModuleName is the name of the module ModuleName = "proximaxbridge" // StoreKey to be used when creating the KVStore StoreKey = ModuleName StoreKeyForPeg = ModuleName + "_peg" StoreKeyForUnpeg = ModuleName + "_unpeg" StoreKeyForCosign = ModuleName + "_cosign" StoreKeyForInvite = ModuleName + "_invite" // RouterKey to be used for routing msgs RouterKey = ModuleName QuerierRoute = ModuleName )
const (
DefaultParamspace = ModuleName
)
Default parameter namespace
const ( //TODO: Describe query parameters, update <action> with your query // Query<Action> = "<action>" QueryParams = "parameters" )
Query endpoints supported by the proximax-bridge querier
Variables ¶
var ( ErrInvalidMainchainTxHash = sdkerrors.Register(ModuleName, 1, "invalid mainchain tx hash") ErrInvalidMainchainAddress = sdkerrors.Register(ModuleName, 2, "invalid mainchain address") ErrJSONMarshalling = sdkerrors.Register(ModuleName, 3, "error marshalling JSON for this claim") ErrInvalidClaimType = sdkerrors.Register(ModuleName, 4, "invalid claim type provided") )
TODO: Fill out some custom errors for the module You can see how they are constructed below:
var ( // TODO: Define your keys for the parameter store // KeyParamName = []byte("ParamName") KeyMainchainMultisigAddress = []byte("MainchainMultisigAddress") KeyCosigners = []byte("Cosigners") )
Parameter store keys
var ModuleCdc *codec.Codec
ModuleCdc defines the module codec
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on codec
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the proximax-bridge genesis parameters
Types ¶
type AccountKeeper ¶
type AccountKeeper interface {
GetAccount(sdk.Context, sdk.AccAddress) authexported.Account
}
AccountKeeper defines the expected account keeper
type GenesisState ¶
type GenesisState struct { // TODO: Fill out what is needed by the module for genesis MainchainMultisigAddress string `json:"mainchain_multisig_address"` Cosigners []Cosigner `json:"cosigners"` }
GenesisState - all proximax-bridge state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func NewGenesisState ¶
func NewGenesisState( mainchainMultisigAddress string, cosigners []Cosigner, ) GenesisState
NewGenesisState creates a new GenesisState object
type MsgConfirmedInvitation ¶
type MsgConfirmedInvitation struct { Address sdk.ValAddress `json:"address" yaml:"address"` TxHash string `json:"mainchain_tx_hash" yaml:"mainchain_tx_hash"` }
MsgProximaXTransactionStatus - struct for unjailing jailed validator
func NewMsgConfirmedInvitation ¶
func NewMsgConfirmedInvitation(address sdk.ValAddress, txHash string) MsgConfirmedInvitation
NewMsgRequestInvitation creates a new MsgRequestInvitation instance
func (MsgConfirmedInvitation) GetSignBytes ¶
func (msg MsgConfirmedInvitation) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgConfirmedInvitation) GetSigners ¶
func (msg MsgConfirmedInvitation) GetSigners() []sdk.AccAddress
func (MsgConfirmedInvitation) Type ¶
func (msg MsgConfirmedInvitation) Type() string
func (MsgConfirmedInvitation) ValidateBasic ¶
func (msg MsgConfirmedInvitation) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgNewCosignerInvited ¶
type MsgNewCosignerInvited struct { Address sdk.ValAddress `json:"address" yaml:"address"` TxHash string `json:"mainchain_tx_hash" yaml:"mainchain_tx_hash"` MainchainPublicKey string `json:"mainchain_public_key" yaml:"mainchain_public_key"` }
MsgProximaXTransactionStatus - struct for unjailing jailed validator
func NewMsgNewCosignerInvited ¶
func NewMsgNewCosignerInvited(address sdk.ValAddress, txHash, pubKey string) MsgNewCosignerInvited
NewMsgRequestInvitation creates a new MsgRequestInvitation instance
func (MsgNewCosignerInvited) GetSignBytes ¶
func (msg MsgNewCosignerInvited) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgNewCosignerInvited) GetSigners ¶
func (msg MsgNewCosignerInvited) GetSigners() []sdk.AccAddress
func (MsgNewCosignerInvited) Type ¶
func (msg MsgNewCosignerInvited) Type() string
func (MsgNewCosignerInvited) ValidateBasic ¶
func (msg MsgNewCosignerInvited) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgNotCosignedClaim ¶
type MsgNotCosignedClaim struct { Address sdk.ValAddress `json:"address" yaml:"address"` TxHash string `json:"tx_hash" yaml:"tx_hash"` }
MsgNotCosignedClaim - struct for unjailing jailed validator
func CreateMsgNotCosignedClaimFromOracleString ¶
func CreateMsgNotCosignedClaimFromOracleString(oracleClaimString string) (MsgNotCosignedClaim, error)
CreateOracleClaimFromOracleString converts a JSON string into an OracleClaimContent struct used by this module. In general, it is expected that the oracle module will store claims in this JSON format and so this should be used to convert oracle claims.
func NewMsgNotCosignedClaim ¶
func NewMsgNotCosignedClaim(address sdk.ValAddress, txHash string) MsgNotCosignedClaim
NewMsgNotCosignedClaim creates a new MsgNotCosignedClaim instance
func (MsgNotCosignedClaim) GetSignBytes ¶
func (msg MsgNotCosignedClaim) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgNotCosignedClaim) GetSigners ¶
func (msg MsgNotCosignedClaim) GetSigners() []sdk.AccAddress
func (MsgNotCosignedClaim) Type ¶
func (msg MsgNotCosignedClaim) Type() string
func (MsgNotCosignedClaim) ValidateBasic ¶
func (msg MsgNotCosignedClaim) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgNotifyCosigned ¶
type MsgNotifyCosigned struct { Address sdk.ValAddress `json:"address" yaml:"address"` MainchainTxHash string `json:"mainchain_tx_hash" yaml:"mainchain_tx_hash"` CosignerPublicKey string `json:"cosigner_public_key" yaml:"cosigner_public_key"` }
MsgUnpeg - struct for unjailing jailed validator
func NewMsgNotifyCosigned ¶
func NewMsgNotifyCosigned(address sdk.ValAddress, mainchainTxHash, cosignerPublicKey string) MsgNotifyCosigned
NewMsgUnpeg creates a new MsgUnpeg instance
func (MsgNotifyCosigned) GetSignBytes ¶
func (msg MsgNotifyCosigned) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgNotifyCosigned) GetSigners ¶
func (msg MsgNotifyCosigned) GetSigners() []sdk.AccAddress
func (MsgNotifyCosigned) Type ¶
func (msg MsgNotifyCosigned) Type() string
func (MsgNotifyCosigned) ValidateBasic ¶
func (msg MsgNotifyCosigned) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgPeg ¶
type MsgPeg struct { Address sdk.AccAddress `json:"address" yaml:"address"` MainchainTxHash string `json:"mainchain_tx_hash" yaml:"mainchain_tx_hash"` Amount sdk.Coins `json:"amount" yaml:"amount"` }
MsgUnpeg - struct for unjailing jailed validator
func (MsgPeg) GetSignBytes ¶
GetSignBytes gets the bytes for the message signer to sign on
func (MsgPeg) GetSigners ¶
func (msg MsgPeg) GetSigners() []sdk.AccAddress
func (MsgPeg) ValidateBasic ¶
ValidateBasic validity check for the AnteHandler
type MsgPegClaim ¶
type MsgPegClaim struct { Address sdk.AccAddress `json:"address" yaml:"address"` MainchainTxHash string `json:"mainchain_tx_hash" yaml:"mainchain_tx_hash"` Amount sdk.Coins `json:"amount" yaml:"amount"` Remainning int64 `json:"remaiining" yaml:"remaiining"` ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"` }
MsgPegClaim - struct for unjailing jailed validator
func CreateMsgPegClaimFromOracleString ¶
func CreateMsgPegClaimFromOracleString(oracleClaimString string) (MsgPegClaim, error)
CreateOracleClaimFromOracleString converts a JSON string into an OracleClaimContent struct used by this module. In general, it is expected that the oracle module will store claims in this JSON format and so this should be used to convert oracle claims.
func NewMsgPegClaim ¶
func NewMsgPegClaim(address sdk.AccAddress, mainchainTxHash string, amount sdk.Coins, remaiining int64, validatorAddress sdk.ValAddress) MsgPegClaim
NewMsgPegClaim creates a new MsgPegClaim instance
func (MsgPegClaim) GetSignBytes ¶
func (msg MsgPegClaim) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgPegClaim) GetSigners ¶
func (msg MsgPegClaim) GetSigners() []sdk.AccAddress
func (MsgPegClaim) Type ¶
func (msg MsgPegClaim) Type() string
func (MsgPegClaim) ValidateBasic ¶
func (msg MsgPegClaim) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgPendingRequestInvitation ¶
type MsgPendingRequestInvitation struct { Address sdk.ValAddress `json:"address" yaml:"address"` NewCosignerPublicKey string `json:"new_cosigner_public_key" yaml:"new_cosigner_public_key"` FirstCosignerAddress sdk.ValAddress `json:"first_cosigner_address" yaml:"first_cosigner_address"` FirstCosignerPublicKey string `json:"first_cosigner_public_key" yaml:"first_cosigner_public_key"` TxHash string `json:"tx_hash" yaml:"tx_hash"` }
MsgRequestInvitation - struct for unjailing jailed validator
func NewMsgPendingRequestInvitation ¶
func NewMsgPendingRequestInvitation(address sdk.ValAddress, newCosignerPublicKey string, firstCosignerAddress sdk.ValAddress, firstCosignerPublicKey, txHash string) MsgPendingRequestInvitation
NewMsgRequestInvitation creates a new MsgRequestInvitation instance
func (MsgPendingRequestInvitation) GetSignBytes ¶
func (msg MsgPendingRequestInvitation) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgPendingRequestInvitation) GetSigners ¶
func (msg MsgPendingRequestInvitation) GetSigners() []sdk.AccAddress
func (MsgPendingRequestInvitation) Route ¶
func (msg MsgPendingRequestInvitation) Route() string
nolint
func (MsgPendingRequestInvitation) Type ¶
func (msg MsgPendingRequestInvitation) Type() string
func (MsgPendingRequestInvitation) ValidateBasic ¶
func (msg MsgPendingRequestInvitation) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgRecordUnpeg ¶
type MsgRecordUnpeg struct { Address sdk.AccAddress `json:"address" yaml:"address"` MainchainTxHash string `json:"mainchain_tx_hash" yaml:"mainchain_tx_hash"` Amount sdk.Coins `json:"amount" yaml:"amount"` FirstCosignerPublicKey string `json:"first_cosigner_public_key" yaml:"first_cosigner_public_key"` ValidatorAddress sdk.ValAddress `json:"validator_address" yaml:"validator_address"` }
MsgUnpeg - struct for unjailing jailed validator
func NewMsgRecordUnpeg ¶
func NewMsgRecordUnpeg(address sdk.AccAddress, mainchainTxHash string, amount sdk.Coins, firstCosignerPublicKey string, validatorAddress sdk.ValAddress) MsgRecordUnpeg
NewMsgUnpeg creates a new MsgUnpeg instance
func (MsgRecordUnpeg) GetSignBytes ¶
func (msg MsgRecordUnpeg) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgRecordUnpeg) GetSigners ¶
func (msg MsgRecordUnpeg) GetSigners() []sdk.AccAddress
func (MsgRecordUnpeg) Type ¶
func (msg MsgRecordUnpeg) Type() string
func (MsgRecordUnpeg) ValidateBasic ¶
func (msg MsgRecordUnpeg) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgRequestInvitation ¶
type MsgRequestInvitation struct { Address sdk.ValAddress `json:"address" yaml:"address"` NewCosignerPublicKey string `json:"new_cosigner_public_key" yaml:"new_cosigner_public_key"` FirstCosignerAddress sdk.ValAddress `json:"first_cosigner_address" yaml:"first_cosigner_address"` }
MsgRequestInvitation - struct for unjailing jailed validator
func NewMsgRequestInvitation ¶
func NewMsgRequestInvitation(address sdk.ValAddress, newCosignerPublicKey string, firstCosignerAddress sdk.ValAddress) MsgRequestInvitation
NewMsgRequestInvitation creates a new MsgRequestInvitation instance
func (MsgRequestInvitation) GetSignBytes ¶
func (msg MsgRequestInvitation) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgRequestInvitation) GetSigners ¶
func (msg MsgRequestInvitation) GetSigners() []sdk.AccAddress
func (MsgRequestInvitation) Type ¶
func (msg MsgRequestInvitation) Type() string
func (MsgRequestInvitation) ValidateBasic ¶
func (msg MsgRequestInvitation) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type MsgUnpeg ¶
type MsgUnpeg struct { Address sdk.AccAddress `json:"address" yaml:"address"` MainchainAddress string `json:"mainchain_address" yaml:"mainchain_address"` Amount sdk.Coins `json:"amount" yaml:"amount"` FirstCosignerAddress sdk.ValAddress `json:"first_cosigner_address" yaml:"first_cosigner_address"` }
MsgUnpeg - struct for unjailing jailed validator
func NewMsgUnpeg ¶
func NewMsgUnpeg(address sdk.AccAddress, mainchainAddress string, amount sdk.Coins, firstCosignerAddress sdk.ValAddress) MsgUnpeg
NewMsgUnpeg creates a new MsgUnpeg instance
func (MsgUnpeg) GetSignBytes ¶
GetSignBytes gets the bytes for the message signer to sign on
func (MsgUnpeg) GetSigners ¶
func (msg MsgUnpeg) GetSigners() []sdk.AccAddress
func (MsgUnpeg) ValidateBasic ¶
ValidateBasic validity check for the AnteHandler
type OracleKeeper ¶
type OracleKeeper interface { ProcessClaim(ctx sdk.Context, claim oracle.Claim) (oracle.Status, error) GetProphecy(ctx sdk.Context, id string) (oracle.Prophecy, bool) }
OracleKeeper defines the expected oracle keeper
type ParamSubspace ¶
type ParamSubspace interface { WithKeyTable(table params.KeyTable) params.Subspace Get(ctx sdk.Context, key []byte, ptr interface{}) GetParamSet(ctx sdk.Context, ps params.ParamSet) SetParamSet(ctx sdk.Context, ps params.ParamSet) }
ParamSubspace defines the expected Subspace interfacace
type Params ¶
type Params struct { // TODO: Add your Paramaters to the Paramter struct // KeyParamName string `json:"key_param_name"` MainchainMultisigAddress string `json:"mainchain_address"` Cosigners []Cosigner `json:"cosigners"` }
Params - used for initializing default parameter for proximax-bridge at genesis
func DefaultParams ¶
func DefaultParams() Params
DefaultParams defines the parameters for this module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs - Implements params.ParamSet
type SlashingKeeper ¶
type SupplyKeeper ¶
type SupplyKeeper interface { 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, name string, amt sdk.Coins) error SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI) }
SupplyKeeper defines the expected supply keeper