ante

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagTxFilter        = "tx-filter.allowed-targets"
	FlagInitHeight      = "tx-filter.initial-block-height"
	FlagAllowedContract = "tx-filter.allowed-contracts"
	FlagDisableFilter   = "tx-filter.disable-contract-filter"
)

Variables

This section is empty.

Functions

func DefaultDisableFilter

func DefaultDisableFilter() bool

func DefaultTxFilter

func DefaultTxFilter() []string

func GenAllowedContractMap

func GenAllowedContractMap(contracts []string, isOff bool) map[string]bool

func GenAllowedMsgRegex

func GenAllowedMsgRegex(targets []string) string

func NewAnteHandler

func NewAnteHandler(opts HandlerOptions, appOpts servertypes.AppOptions) (sdk.AnteHandler, error)

Types

type AppOptionsMock

type AppOptionsMock map[string]any

func MakeAppOptionsMock

func MakeAppOptionsMock() AppOptionsMock

func (AppOptionsMock) Get

func (msc AppOptionsMock) Get(key string) any

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCkeeper  *ibckeeper.Keeper
	WasmConfig *wasmtypes.WasmConfig
}

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

type TxFilterDecorator

type TxFilterDecorator struct {
	Options TxFilterOptions
}

TxFilterDecorator blocks the sdk.Msg if it's not registered in tx-filter AllowedTargets

func NewTxFilterDecorator

func NewTxFilterDecorator(opts TxFilterOptions) TxFilterDecorator

func (TxFilterDecorator) AnteHandle

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

func (TxFilterDecorator) CheckIfAllowed

func (tfd TxFilterDecorator) CheckIfAllowed(msgs []sdk.Msg) error

type TxFilterOptions

type TxFilterOptions struct {
	AllowedMsgRegex    string
	InitialBlockHeight int64
	AllowedContract    map[string]bool
}

func NewTxFilterOptions

func NewTxFilterOptions(appOpts servertypes.AppOptions) TxFilterOptions

Jump to

Keyboard shortcuts

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