crisis

package
v0.34.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 3 Imported by: 2,610

Documentation

Index

Constants

View Source
const (
	// default codespace for crisis module
	DefaultCodespace sdk.CodespaceType = ModuleName

	// CodeInvalidInput is the codetype for invalid input for the crisis module
	CodeInvalidInput sdk.CodeType = 103
)
View Source
const (
	ModuleName = "crisis"
	RouterKey  = ModuleName
)

ModuleName is the module name for this module

View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

Variables

View Source
var MsgCdc *codec.Codec

generic sealed codec to be used throughout module

View Source
var (
	// key for constant fee parameter
	ParamStoreKeyConstantFee = []byte("ConstantFee")
)

Functions

func ErrNilSender added in v0.34.0

func ErrNilSender(codespace sdk.CodespaceType) sdk.Error

ErrNilSender - no sender provided for the input

func ErrUnknownInvariant

func ErrUnknownInvariant(codespace sdk.CodespaceType) sdk.Error

ErrUnknownInvariant - unknown invariant provided

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)

new crisis genesis

func NewHandler

func NewHandler(k Keeper) sdk.Handler

func ParamKeyTable

func ParamKeyTable() params.KeyTable

type declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

func ValidateGenesis added in v0.34.0

func ValidateGenesis(data GenesisState) error

ValidateGenesis - placeholder function

Types

type BankKeeper added in v0.34.0

type BankKeeper interface {
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, sdk.Tags, sdk.Error)
}

expected bank keeper

type DistrKeeper added in v0.34.0

type DistrKeeper interface {
	DistributeFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) sdk.Error
}

expected bank keeper

type FeeCollectionKeeper added in v0.34.0

type FeeCollectionKeeper interface {
	AddCollectedFees(ctx sdk.Context, coins sdk.Coins) sdk.Coins
}

expected fee collection keeper

type GenesisState

type GenesisState struct {
	ConstantFee sdk.Coin `json:"constant_fee"`
}

GenesisState - crisis genesis state

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState creates a default GenesisState object

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

func NewGenesisState

func NewGenesisState(constantFee sdk.Coin) GenesisState

NewGenesisState creates a new GenesisState object

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 added in v0.34.0

func (i InvarRoute) FullRoute() string

get the full invariance route

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper - crisis keeper

func NewKeeper

func NewKeeper(paramSpace params.Subspace,
	distrKeeper DistrKeeper, bankKeeper BankKeeper,
	feeCollectionKeeper FeeCollectionKeeper) Keeper

NewKeeper creates a new Keeper object

func (Keeper) GetConstantFee added in v0.34.0

func (k Keeper) GetConstantFee(ctx sdk.Context) (constantFee sdk.Coin)

GetConstantFee get's the constant fee from the paramSpace

func (*Keeper) RegisterRoute added in v0.34.0

func (k *Keeper) RegisterRoute(moduleName, route string, invar sdk.Invariant)

register routes for the

func (Keeper) Routes added in v0.34.0

func (k Keeper) Routes() []InvarRoute

Routes - return the keeper's invariant routes

func (Keeper) SetConstantFee added in v0.34.0

func (k Keeper) SetConstantFee(ctx sdk.Context, constantFee sdk.Coin)

GetConstantFee set's the constant fee in the paramSpace

type MsgVerifyInvariant

type MsgVerifyInvariant struct {
	Sender              sdk.AccAddress `json:"sender"`
	InvariantModuleName string         `json:"invariant_module_name"`
	InvariantRoute      string         `json:"invariant_route"`
}

MsgVerifyInvariant - message struct to verify a particular invariance

func NewMsgVerifyInvariant

func NewMsgVerifyInvariant(sender sdk.AccAddress, invariantModuleName,
	invariantRoute string) MsgVerifyInvariant

NewMsgVerifyInvariant creates a new MsgVerifyInvariant object

func (MsgVerifyInvariant) FullInvariantRoute added in v0.34.0

func (msg MsgVerifyInvariant) FullInvariantRoute() string

FullInvariantRoute - get the messages full invariant route

func (MsgVerifyInvariant) GetSignBytes added in v0.34.0

func (msg MsgVerifyInvariant) GetSignBytes() []byte

GetSignBytes gets the sign bytes for the msg MsgVerifyInvariant

func (MsgVerifyInvariant) GetSigners added in v0.34.0

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

get the bytes for the message signer to sign on

func (MsgVerifyInvariant) Route added in v0.34.0

func (msg MsgVerifyInvariant) Route() string

nolint

func (MsgVerifyInvariant) Type added in v0.34.0

func (msg MsgVerifyInvariant) Type() string

func (MsgVerifyInvariant) ValidateBasic added in v0.34.0

func (msg MsgVerifyInvariant) ValidateBasic() sdk.Error

quick validity check

Directories

Path Synopsis
cli
nolint
nolint

Jump to

Keyboard shortcuts

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