feat(core): add TxValidator interface (#19950)

This commit is contained in:
Julien Robert
2024-04-04 10:56:32 +00:00
committed by GitHub
parent 6c6626712e
commit edd1c71072
2 changed files with 15 additions and 2 deletions
+2 -2
View File
@@ -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
View 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
}