feat(core): add TxValidator interface (#19950)
This commit is contained in:
parent
6c6626712e
commit
edd1c71072
@ -47,10 +47,10 @@ type HasEndBlocker interface {
|
||||
EndBlock(context.Context) error
|
||||
}
|
||||
|
||||
// HasTxValidation is the extension interface that modules should implement to run
|
||||
// HasTxValidator is the extension interface that modules should implement to run
|
||||
// custom logic for validating transactions.
|
||||
// It was previously known as AnteHandler/Decorator.
|
||||
type HasTxValidation[T transaction.Tx] interface {
|
||||
type HasTxValidator[T transaction.Tx] interface {
|
||||
AppModule
|
||||
|
||||
// TxValidator is a method that will be run on each transaction.
|
||||
|
||||
13
core/appmodule/v2/tx_validator.go
Normal file
13
core/appmodule/v2/tx_validator.go
Normal file
@ -0,0 +1,13 @@
|
||||
package appmodule
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/core/transaction"
|
||||
)
|
||||
|
||||
// TxValidator represent the method that a TxValidator should implement.
|
||||
// It was previously known as AnteHandler/Decorator.AnteHandle
|
||||
type TxValidator[T transaction.Tx] interface {
|
||||
ValidateTx(ctx context.Context, tx T) error
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user