decorators

package
v0.0.0-...-916f257 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyAnte = func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) {
		return ctx, nil
	}
)

Define an empty ante handle

Functions

This section is empty.

Types

type MockTx

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

func NewMockTx

func NewMockTx(msgs ...sdk.Msg) MockTx

func (MockTx) GetMsgs

func (tx MockTx) GetMsgs() []sdk.Msg

func (MockTx) GetMsgsV2

func (tx MockTx) GetMsgsV2() ([]protov2.Message, error)

func (MockTx) ValidateBasic

func (tx MockTx) ValidateBasic() error

type MsgFilterDecorator

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

MsgFilterDecorator is an ante.go decorator template for filtering messages.

func FilterDecorator

func FilterDecorator(blockedMsgTypes ...sdk.Msg) MsgFilterDecorator

FilterDecorator returns a new MsgFilterDecorator. This errors if the transaction contains any of the blocked message types.

Example: - decorators.FilterDecorator(&banktypes.MsgSend{}) This would block any MsgSend messages from being included in a transaction if set in ante.go

func (MsgFilterDecorator) AnteHandle

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

func (MsgFilterDecorator) HasDisallowedMessage

func (mfd MsgFilterDecorator) HasDisallowedMessage(ctx sdk.Context, msgs []sdk.Msg) bool

Jump to

Keyboard shortcuts

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