decorators

package
v21.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxChangeRate = "0.05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgChangeRateDecorator

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

MsgChangeRateDecorator defines the AnteHandler that filters & prevents messages that create validators and exceed the max change rate of 5%.

func NewChangeRateDecorator

func NewChangeRateDecorator(sk *stakingkeeper.Keeper) MsgChangeRateDecorator

Create new Change Rate Decorator

func (MsgChangeRateDecorator) AnteHandle

func (mcr MsgChangeRateDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

The AnteHandle checks for transactions that exceed the max change rate of 5% on the creation of a validator.

type MsgFilterDecorator

type MsgFilterDecorator struct{}

MsgFilterDecorator defines an AnteHandler decorator for the v9 upgrade that provide height-gated message filtering acceptance.

func (MsgFilterDecorator) AnteHandle

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

AnteHandle performs an AnteHandler check that returns an error if the tx contains a message that is blocked. Right now, we block MsgTimeoutOnClose due to incorrect behavior that could occur if a packet is re-enabled.

Jump to

Keyboard shortcuts

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