ante

package
v21.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseFeeMarketDecorator = true

UseFeeMarketDecorator to make the integration testing easier: we can switch off its ante and post decorators with this flag

Functions

func NewAnteHandler

func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error)

func SetExpeditedProposalsEnabled

func SetExpeditedProposalsEnabled(val bool)

SetExpeditedProposalsEnabled toggles the expedited proposals decorator on/off. Should only be used in testing - this is to allow simtests to pass.

func SetMinStakedTokens

func SetMinStakedTokens(tokens math.LegacyDec)

SetMinStakedTokens sets the minimum amount of staked tokens required to vote Should only be used in testing

Types

type GovExpeditedProposalsDecorator

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

Check if the proposal is whitelisted for expedited voting.

func NewGovExpeditedProposalsDecorator

func NewGovExpeditedProposalsDecorator(cdc codec.BinaryCodec) GovExpeditedProposalsDecorator

func (GovExpeditedProposalsDecorator) AnteHandle

func (g GovExpeditedProposalsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

AnteHandle checks if the proposal is whitelisted for expedited voting. Only proposals submitted using "gaiad tx gov submit-proposal" can be expedited. Legacy proposals submitted using "gaiad tx gov submit-legacy-proposal" cannot be marked as expedited.

type GovVoteDecorator

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

func NewGovVoteDecorator

func NewGovVoteDecorator(cdc codec.BinaryCodec, stakingKeeper *stakingkeeper.Keeper) GovVoteDecorator

func (GovVoteDecorator) AnteHandle

func (g GovVoteDecorator) AnteHandle(
	ctx sdk.Context, tx sdk.Tx,
	simulate bool, next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

func (GovVoteDecorator) ValidateVoteMsgs

func (g GovVoteDecorator) ValidateVoteMsgs(ctx sdk.Context, msgs []sdk.Msg) error

ValidateVoteMsgs checks if a voter has enough stake to vote

type HandlerOptions

type HandlerOptions struct {
	ExtensionOptionChecker ante.ExtensionOptionChecker
	FeegrantKeeper         ante.FeegrantKeeper
	SignModeHandler        *txsigning.HandlerMap
	SigGasConsumer         func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error

	AccountKeeper         feemarketante.AccountKeeper
	BankKeeper            feemarketante.BankKeeper
	Codec                 codec.BinaryCodec
	IBCkeeper             *ibckeeper.Keeper
	StakingKeeper         *stakingkeeper.Keeper
	FeeMarketKeeper       *feemarketkeeper.Keeper
	TxFeeChecker          ante.TxFeeChecker
	TXCounterStoreService corestoretypes.KVStoreService
	WasmConfig            *wasmtypes.WasmConfig
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

Jump to

Keyboard shortcuts

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