From 7d1278270c321f2f6f408d827ab581caa2dba692 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:46:51 +0000 Subject: [PATCH] feat(baseapp): expose `Mempool` (backport #17954) (#18010) Co-authored-by: Devon Bear Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + baseapp/baseapp.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f045160edf..8eca4b873b9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (baseapp) [#17954](https://github.com/cosmos/cosmos-sdk/issues/17954) Add `Mempool()` method on `BaseApp` to allow access to the mempool. * (x/gov) [#17780](https://github.com/cosmos/cosmos-sdk/pull/17780) Recover panics and turn them into errors when executing x/gov proposals. ### Bug Fixes diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 7c82ff493dee..c2ce465ca9ca 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -351,6 +351,11 @@ func (app *BaseApp) LastBlockHeight() int64 { return app.cms.LastCommitID().Version } +// Mempool returns the Mempool of the app. +func (app *BaseApp) Mempool() mempool.Mempool { + return app.mempool +} + // Init initializes the app. It seals the app, preventing any // further modifications. In addition, it validates the app against // the earlier provided settings. Returns an error if validation fails.