types

package
v0.0.0-...-32383df Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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
)
View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const (
	//TODO: Describe query parameters, update <action> with your query
	// Query<Action>    = "<action>"
	QueryParams = "parameters"
)

Query endpoints supported by the proximax-bridge querier

Variables

View Source
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:

View Source
var (
	// TODO: Define your keys for the parameter store
	// KeyParamName          = []byte("ParamName")
	KeyMainchainMultisigAddress = []byte("MainchainMultisigAddress")
	KeyCosigners                = []byte("Cosigners")
)

Parameter store keys

View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func CreateOracleClaimFromMsgNotCosignedClaim

func CreateOracleClaimFromMsgNotCosignedClaim(cdc *codec.Codec, msg MsgNotCosignedClaim) (oracle.Claim, error)

func CreateOracleClaimFromMsgPegClaim

func CreateOracleClaimFromMsgPegClaim(cdc *codec.Codec, msg MsgPegClaim) (oracle.Claim, error)

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for proximax-bridge module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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 Cosigner

type Cosigner struct {
	ValidatorAddress   string `json:"validator_address"`
	MainchainPublicKey string `json:"mainchain_public_key"`
}

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

func (msg MsgConfirmedInvitation) Route() string

nolint

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

func (msg MsgNewCosignerInvited) Route() string

nolint

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

func (msg MsgNotCosignedClaim) Route() string

nolint

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

func (msg MsgNotifyCosigned) Route() string

nolint

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 NewMsgPeg

func NewMsgPeg(address sdk.AccAddress, mainchainTxHash string, amount sdk.Coins) MsgPeg

NewMsgUnpeg creates a new MsgUnpeg instance

func (MsgPeg) GetSignBytes

func (msg MsgPeg) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgPeg) GetSigners

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

func (MsgPeg) Route

func (msg MsgPeg) Route() string

nolint

func (MsgPeg) Type

func (msg MsgPeg) Type() string

func (MsgPeg) ValidateBasic

func (msg MsgPeg) ValidateBasic() error

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

func (msg MsgPegClaim) Route() string

nolint

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 (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) Route

func (msg MsgRecordUnpeg) Route() string

nolint

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

func (msg MsgRequestInvitation) Route() string

nolint

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

func (msg MsgUnpeg) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgUnpeg) GetSigners

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

func (MsgUnpeg) Route

func (msg MsgUnpeg) Route() string

nolint

func (MsgUnpeg) Type

func (msg MsgUnpeg) Type() string

func (MsgUnpeg) ValidateBasic

func (msg MsgUnpeg) ValidateBasic() error

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 NewParams

func NewParams(mainchainMultisigAddress string, cosigners []Cosigner) Params

NewParams creates a new Params object

func (*Params) ParamSetPairs

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

ParamSetPairs - Implements params.ParamSet

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

type SlashingKeeper

type SlashingKeeper interface {
	Slash(ctx sdk.Context, consAddr sdk.ConsAddress, fraction sdk.Dec, power int64, distributionHeight int64)
}

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

Jump to

Keyboard shortcuts

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