@@ -2,10 +2,13 @@ package app
22
33import (
44 "context"
5+ "fmt"
56 "time"
67
78 sdk "github.com/cosmos/cosmos-sdk/types"
9+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
810 "github.com/sei-protocol/sei-chain/utils/metrics"
11+ evmtypes "github.com/sei-protocol/sei-chain/x/evm/types"
912 abci "github.com/tendermint/tendermint/abci/types"
1013 "go.opentelemetry.io/otel/attribute"
1114)
@@ -38,6 +41,26 @@ func (app *App) CheckTx(ctx context.Context, req *abci.RequestCheckTx) (*abci.Re
3841 return app .BaseApp .CheckTx (ctx , req )
3942}
4043
44+ func (app * App ) CheckTxWrapped (ctx context.Context , req * abci.RequestCheckTx ) (* abci.ResponseCheckTxV2 , any , error ) {
45+ _ , span := app .GetBaseApp ().TracingInfo .Start ("CheckTxWrapped" )
46+ defer span .End ()
47+ tx , err := app .txDecoder (req .Tx )
48+ if err != nil {
49+ res := sdkerrors .ResponseCheckTx (err , 0 , 0 , false )
50+ return & abci.ResponseCheckTxV2 {ResponseCheckTx : & res }, nil , err
51+ }
52+ res , err := app .BaseApp .CheckTxDecoded (tx , req )
53+ if err != nil {
54+ return res , nil , err
55+ }
56+ if tx != nil && len (tx .GetMsgs ()) > 0 {
57+ if evmMsg , ok := tx .GetMsgs ()[0 ].(* evmtypes.MsgEVMTransaction ); ok {
58+ return res , evmMsg , nil
59+ }
60+ }
61+ return res , nil , nil
62+ }
63+
4164func (app * App ) DeliverTx (ctx sdk.Context , req abci.RequestDeliverTx , tx sdk.Tx , checksum [32 ]byte ) abci.ResponseDeliverTx {
4265 defer metrics .MeasureDeliverTxDuration (time .Now ())
4366 // ensure we carry the initial context from tracer here
@@ -80,3 +103,12 @@ func (app *App) LoadLatest(ctx context.Context, req *abci.RequestLoadLatest) (*a
80103 app .mounter ()
81104 return app .BaseApp .LoadLatest (ctx , req )
82105}
106+
107+ func (app * App ) CheckNonce (ctx context.Context , req any , index int ) (bool , error ) {
108+ sdkCtx := app .GetCheckCtx ()
109+ msg , ok := req .(* evmtypes.MsgEVMTransaction )
110+ if ! ok {
111+ return false , fmt .Errorf ("invalid request type: %T" , req )
112+ }
113+ return app .EvmKeeper .CheckNonce (sdkCtx , msg , index )
114+ }
0 commit comments