ante

package
v0.54.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTxFeeWithValidatorMinGasPrices

func CheckTxFeeWithValidatorMinGasPrices(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error)

CheckTxFeeWithValidatorMinGasPrices implements the default fee logic, where the minimum price per unit of gas is fixed and set by each validator, can the tx priority is computed from the gas price.

func NewAnteHandler

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

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.

func SetExpeditedProposalsEnabled added in v0.50.0

func SetExpeditedProposalsEnabled(val bool)

SetExpeditedProposalsEnabled toggles the expedited proposals decorator on/off. Should only be used in testing - It ensures that simtests tests pass.

func SetMinStakedTokens added in v0.50.0

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

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

Check if the proposal is whitelisted for expedited voting.

func NewGovExpeditedProposalsDecorator added in v0.50.0

func NewGovExpeditedProposalsDecorator(cdc codec.BinaryCodec) GovExpeditedProposalsDecorator

func (GovExpeditedProposalsDecorator) AnteHandle added in v0.50.0

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

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

func NewGovVoteDecorator added in v0.50.0

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

func (GovVoteDecorator) AnteHandle added in v0.50.0

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

func (GovVoteDecorator) ValidateVoteMsgs added in v0.50.0

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 {
	ante.HandlerOptions

	Cdc             codec.BinaryCodec
	IBCKeeper       *ibckeeper.Keeper
	StakingKeeper   *stakingkeeper.Keeper
	ConsumerKeeper  ibcconsumerkeeper.Keeper
	BankKeeper      bankkeeper.Keeper
	ParameterKeeper parameterkeeper.Keeper
}

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

type MinCommissionDecorator

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

func (MinCommissionDecorator) AnteHandle

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

func (MinCommissionDecorator) CalculateDelegateProjectedVotingPower

func (min MinCommissionDecorator) CalculateDelegateProjectedVotingPower(ctx sdk.Context, validator stakingtypes.ValidatorI, delegateAmount sdkmath.LegacyDec) sdkmath.LegacyDec

Returns the projected voting power as a percentage (not a fraction)

func (MinCommissionDecorator) CalculateRedelegateProjectedVotingPower

func (min MinCommissionDecorator) CalculateRedelegateProjectedVotingPower(ctx sdk.Context, validator stakingtypes.ValidatorI, delegateAmount sdkmath.LegacyDec) sdkmath.LegacyDec

Returns the projected voting power as a percentage (not a fraction)

func (MinCommissionDecorator) CalculateValidatorProjectedVotingPower

func (min MinCommissionDecorator) CalculateValidatorProjectedVotingPower(ctx sdk.Context, delegateAmount sdkmath.LegacyDec) sdkmath.LegacyDec

Returns the projected voting power as a percentage (not a fraction)

type VestedAnteHandlerDecorator added in v0.51.0

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

CustomAnteHandlerDecorator checks for the use of vested tokens in various operations

func NewVestedAnteHandlerDecorator added in v0.51.0

func NewVestedAnteHandlerDecorator(ak authante.AccountKeeper, bk bankkeeper.Keeper) VestedAnteHandlerDecorator

func (VestedAnteHandlerDecorator) AnteHandle added in v0.51.0

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

Jump to

Keyboard shortcuts

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