Skip to content

Commit

Permalink
feat(core): add TxValidator interface (#19950)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Apr 4, 2024
1 parent 6c66267 commit edd1c71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/appmodule/v2/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 13 additions & 0 deletions core/appmodule/v2/tx_validator.go
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit edd1c71

Please sign in to comment.