types

package
v0.47.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EventTypeInvariant = "invariant"

	AttributeKeyRoute = "route"
)

crisis module event types

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

	StoreKey = ModuleName
)
View Source
const (
	TypeMsgVerifyInvariant = "verify_invariant"
	TypeMsgUpdateParams    = "update_params"
)

Variables

View Source
var (
	ErrNoSender         = sdkerrors.Register(ModuleName, 2, "sender address is empty")
	ErrUnknownInvariant = sdkerrors.Register(ModuleName, 3, "unknown invariant")
)

x/crisis module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ConstantFeeKey = []byte{0x01}
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var ParamStoreKeyConstantFee = []byte("ConstantFee")

ParamStoreKeyConstantFee is the constant fee parameter

Functions

func ParamKeyTable deprecated

func ParamKeyTable() paramtypes.KeyTable

Deprecated: Type declaration for parameters

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers the interfaces types with the Interface Registry.

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the necessary x/crisis interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func ValidateGenesis

func ValidateGenesis(data *GenesisState) error

ValidateGenesis - validate crisis genesis data

Types

type GenesisState

type GenesisState struct {
	// constant_fee is the fee used to verify the invariant in the crisis
	// module.
	ConstantFee types.Coin `protobuf:"bytes,3,opt,name=constant_fee,json=constantFee,proto3" json:"constant_fee"`
}

GenesisState defines the crisis module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState creates a default GenesisState object

func NewGenesisState

func NewGenesisState(constantFee sdk.Coin) *GenesisState

NewGenesisState creates a new GenesisState object

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetConstantFee

func (m *GenesisState) GetConstantFee() types.Coin

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type InvarRoute

type InvarRoute struct {
	ModuleName string
	Route      string
	Invar      sdk.Invariant
}

invariant route

func NewInvarRoute

func NewInvarRoute(moduleName, route string, invar sdk.Invariant) InvarRoute

NewInvarRoute - create an InvarRoute object

func (InvarRoute) FullRoute

func (i InvarRoute) FullRoute() string

get the full invariance route

type MsgClient

type MsgClient interface {
	// VerifyInvariant defines a method to verify a particular invariant.
	VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error)
	// UpdateParams defines a governance operation for updating the x/crisis module
	// parameters. The authority is defined in the keeper.
	//
	// Since: cosmos-sdk 0.47
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	// VerifyInvariant defines a method to verify a particular invariant.
	VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error)
	// UpdateParams defines a governance operation for updating the x/crisis module
	// parameters. The authority is defined in the keeper.
	//
	// Since: cosmos-sdk 0.47
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParams

type MsgUpdateParams struct {
	// authority is the address that controls the module (defaults to x/gov unless overwritten).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// constant_fee defines the x/crisis parameter.
	ConstantFee types.Coin `protobuf:"bytes,2,opt,name=constant_fee,json=constantFee,proto3" json:"constant_fee"`
}

MsgUpdateParams is the Msg/UpdateParams request type.

Since: cosmos-sdk 0.47

func (*MsgUpdateParams) Descriptor

func (*MsgUpdateParams) Descriptor() ([]byte, []int)

func (*MsgUpdateParams) GetAuthority

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetConstantFee

func (m *MsgUpdateParams) GetConstantFee() types.Coin

func (MsgUpdateParams) GetSignBytes

func (msg MsgUpdateParams) GetSignBytes() []byte

GetSignBytes returns the raw bytes for a MsgUpdateParams message that the expected signer needs to sign.

func (MsgUpdateParams) GetSigners

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

GetSigners returns the signer addresses that are expected to sign the result of GetSignBytes.

func (*MsgUpdateParams) Marshal

func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParams) MarshalTo

func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParams) MarshalToSizedBuffer

func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParams) ProtoMessage

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset

func (m *MsgUpdateParams) Reset()

func (MsgUpdateParams) Route

func (msg MsgUpdateParams) Route() string

Route returns the MsgUpdateParams's route.

func (*MsgUpdateParams) Size

func (m *MsgUpdateParams) Size() (n int)

func (*MsgUpdateParams) String

func (m *MsgUpdateParams) String() string

func (MsgUpdateParams) Type

func (msg MsgUpdateParams) Type() string

Type returns the MsgUpdateParams's type.

func (*MsgUpdateParams) Unmarshal

func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error

func (MsgUpdateParams) ValidateBasic

func (msg MsgUpdateParams) ValidateBasic() error

ValidateBasic performs basic MsgUpdateParams message validation.

func (*MsgUpdateParams) XXX_DiscardUnknown

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal

func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParams) XXX_Merge

func (m *MsgUpdateParams) XXX_Merge(src proto.Message)

func (*MsgUpdateParams) XXX_Size

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal

func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error

type MsgUpdateParamsResponse

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

Since: cosmos-sdk 0.47

func (*MsgUpdateParamsResponse) Descriptor

func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int)

func (*MsgUpdateParamsResponse) Marshal

func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParamsResponse) MarshalTo

func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer

func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) ProtoMessage

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size

func (m *MsgUpdateParamsResponse) Size() (n int)

func (*MsgUpdateParamsResponse) String

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal

func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal

func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParamsResponse) XXX_Merge

func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message)

func (*MsgUpdateParamsResponse) XXX_Size

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal

func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error

type MsgVerifyInvariant

type MsgVerifyInvariant struct {
	// sender is the account address of private key to send coins to fee collector account.
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// name of the invariant module.
	InvariantModuleName string `protobuf:"bytes,2,opt,name=invariant_module_name,json=invariantModuleName,proto3" json:"invariant_module_name,omitempty"`
	// invariant_route is the msg's invariant route.
	InvariantRoute string `protobuf:"bytes,3,opt,name=invariant_route,json=invariantRoute,proto3" json:"invariant_route,omitempty"`
}

MsgVerifyInvariant represents a message to verify a particular invariance.

func NewMsgVerifyInvariant

func NewMsgVerifyInvariant(sender sdk.AccAddress, invModeName, invRoute string) *MsgVerifyInvariant

NewMsgVerifyInvariant creates a new MsgVerifyInvariant object

func (*MsgVerifyInvariant) Descriptor

func (*MsgVerifyInvariant) Descriptor() ([]byte, []int)

func (MsgVerifyInvariant) FullInvariantRoute

func (msg MsgVerifyInvariant) FullInvariantRoute() string

FullInvariantRoute - get the messages full invariant route

func (MsgVerifyInvariant) GetSignBytes

func (msg MsgVerifyInvariant) GetSignBytes() []byte

GetSignBytes gets the sign bytes for the msg MsgVerifyInvariant

func (MsgVerifyInvariant) GetSigners

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

get the bytes for the message signer to sign on

func (*MsgVerifyInvariant) Marshal

func (m *MsgVerifyInvariant) Marshal() (dAtA []byte, err error)

func (*MsgVerifyInvariant) MarshalTo

func (m *MsgVerifyInvariant) MarshalTo(dAtA []byte) (int, error)

func (*MsgVerifyInvariant) MarshalToSizedBuffer

func (m *MsgVerifyInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgVerifyInvariant) ProtoMessage

func (*MsgVerifyInvariant) ProtoMessage()

func (*MsgVerifyInvariant) Reset

func (m *MsgVerifyInvariant) Reset()

func (MsgVerifyInvariant) Route

func (msg MsgVerifyInvariant) Route() string

Route returns the MsgVerifyInvariant's route.

func (*MsgVerifyInvariant) Size

func (m *MsgVerifyInvariant) Size() (n int)

func (*MsgVerifyInvariant) String

func (m *MsgVerifyInvariant) String() string

func (MsgVerifyInvariant) Type

func (msg MsgVerifyInvariant) Type() string

Type returns the MsgVerifyInvariant's type.

func (*MsgVerifyInvariant) Unmarshal

func (m *MsgVerifyInvariant) Unmarshal(dAtA []byte) error

func (MsgVerifyInvariant) ValidateBasic

func (msg MsgVerifyInvariant) ValidateBasic() error

quick validity check

func (*MsgVerifyInvariant) XXX_DiscardUnknown

func (m *MsgVerifyInvariant) XXX_DiscardUnknown()

func (*MsgVerifyInvariant) XXX_Marshal

func (m *MsgVerifyInvariant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgVerifyInvariant) XXX_Merge

func (m *MsgVerifyInvariant) XXX_Merge(src proto.Message)

func (*MsgVerifyInvariant) XXX_Size

func (m *MsgVerifyInvariant) XXX_Size() int

func (*MsgVerifyInvariant) XXX_Unmarshal

func (m *MsgVerifyInvariant) XXX_Unmarshal(b []byte) error

type MsgVerifyInvariantResponse

type MsgVerifyInvariantResponse struct {
}

MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type.

func (*MsgVerifyInvariantResponse) Descriptor

func (*MsgVerifyInvariantResponse) Descriptor() ([]byte, []int)

func (*MsgVerifyInvariantResponse) Marshal

func (m *MsgVerifyInvariantResponse) Marshal() (dAtA []byte, err error)

func (*MsgVerifyInvariantResponse) MarshalTo

func (m *MsgVerifyInvariantResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgVerifyInvariantResponse) MarshalToSizedBuffer

func (m *MsgVerifyInvariantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgVerifyInvariantResponse) ProtoMessage

func (*MsgVerifyInvariantResponse) ProtoMessage()

func (*MsgVerifyInvariantResponse) Reset

func (m *MsgVerifyInvariantResponse) Reset()

func (*MsgVerifyInvariantResponse) Size

func (m *MsgVerifyInvariantResponse) Size() (n int)

func (*MsgVerifyInvariantResponse) String

func (m *MsgVerifyInvariantResponse) String() string

func (*MsgVerifyInvariantResponse) Unmarshal

func (m *MsgVerifyInvariantResponse) Unmarshal(dAtA []byte) error

func (*MsgVerifyInvariantResponse) XXX_DiscardUnknown

func (m *MsgVerifyInvariantResponse) XXX_DiscardUnknown()

func (*MsgVerifyInvariantResponse) XXX_Marshal

func (m *MsgVerifyInvariantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgVerifyInvariantResponse) XXX_Merge

func (m *MsgVerifyInvariantResponse) XXX_Merge(src proto.Message)

func (*MsgVerifyInvariantResponse) XXX_Size

func (m *MsgVerifyInvariantResponse) XXX_Size() int

func (*MsgVerifyInvariantResponse) XXX_Unmarshal

func (m *MsgVerifyInvariantResponse) XXX_Unmarshal(b []byte) error

type SupplyKeeper

type SupplyKeeper interface {
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

SupplyKeeper defines the expected supply keeper (noalias)

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdateParams

func (*UnimplementedMsgServer) VerifyInvariant

Jump to

Keyboard shortcuts

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