Skip to content

Commit

Permalink
nil guard on mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed Sep 12, 2022
1 parent a7729b6 commit 709d9f5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"fmt"
"strings"

"github.com/cosmos/gogoproto/proto"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/gogoproto/proto"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/snapshots"
"github.com/cosmos/cosmos-sdk/store"
Expand Down Expand Up @@ -53,7 +54,7 @@ type BaseApp struct { //nolint: maligned
interfaceRegistry codectypes.InterfaceRegistry
txDecoder sdk.TxDecoder // unmarshal []byte into sdk.Tx

mempool sdk.Mempool
mempool sdk.Mempool // application side mempool
anteHandler sdk.AnteHandler // ante handler for fee and auth
postHandler sdk.AnteHandler // post handler, optional, e.g. for tips
initChainer sdk.InitChainer // initialize state with validators and state blob
Expand Down Expand Up @@ -666,8 +667,8 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
anteEvents = events.ToABCIEvents()
}

if mode == runTxModeCheck {
// TODO add the tx to the mempool
// TODO remove nil check when implemented
if mode == runTxModeCheck && app.mempool != nil {
err = app.mempool.Insert(ctx, tx.(sdk.MempoolTx))
if err != nil {
return gInfo, nil, anteEvents, priority, err
Expand Down

0 comments on commit 709d9f5

Please sign in to comment.