Skip to content

Commit

Permalink
refine custom base option function
Browse files Browse the repository at this point in the history
  • Loading branch information
taramakage committed Oct 9, 2023
1 parent 3de5405 commit 99d8d4b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,7 @@ func NewIrisApp(
interfaceRegistry := encodingConfig.InterfaceRegistry

// Setup Mempool
baseAppOptions = append(baseAppOptions, func(app *baseapp.BaseApp) {
memPool := mempool.NoOpMempool{}
app.SetMempool(memPool)
handler := baseapp.NewDefaultProposalHandler(memPool, app)
app.SetPrepareProposal(handler.PrepareProposalHandler())
app.SetProcessProposal(handler.ProcessProposalHandler())
})
baseAppOptions = append(baseAppOptions, NoOpMempoolOption())

bApp := baseapp.NewBaseApp(
iristypes.AppName,
Expand Down Expand Up @@ -957,3 +951,13 @@ func initParamsKeeper(

return paramsKeeper
}

func NoOpMempoolOption() func(*baseapp.BaseApp) {
return func(app *baseapp.BaseApp) {
memPool := mempool.NoOpMempool{}
app.SetMempool(memPool)
handler := baseapp.NewDefaultProposalHandler(memPool, app)
app.SetPrepareProposal(handler.PrepareProposalHandler())
app.SetProcessProposal(handler.ProcessProposalHandler())
}
}

0 comments on commit 99d8d4b

Please sign in to comment.