From 99d8d4b14d37af6428a04731cbe775b10bc30475 Mon Sep 17 00:00:00 2001 From: yuandu Date: Mon, 9 Oct 2023 09:59:55 +0800 Subject: [PATCH] refine custom base option function --- app/app.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/app.go b/app/app.go index 1a0e56670..7323b53b4 100644 --- a/app/app.go +++ b/app/app.go @@ -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, @@ -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()) + } +}