From 5ad2d9a9dca1f0bed8428643ca061569ca8dec13 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 8 Apr 2024 15:56:16 +0800 Subject: [PATCH] Problem: can't extend abci listeners in streaming manager (#269) Solution: - add API StreamingManager to allow extending the abci listeners, mainly for versiondb support Update CHANGELOG.md Signed-off-by: yihuang cleanup --- CHANGELOG.md | 1 + baseapp/baseapp.go | 4 ++++ server/mock/store.go | 12 ------------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 006a157a4479..021533364551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API in `Context` to use new CoW branched cache store. * [#248](https://github.com/crypto-org-chain/cosmos-sdk/pull/248) Init btree store lazily to save allocations when no content insert into it. * [#252](https://github.com/crypto-org-chain/cosmos-sdk/pull/252) Add `BlockGasWanted` to `Context` to support feemarket module. +* [#269](https://github.com/crypto-org-chain/cosmos-sdk/pull/269) Add `StreamingManager` to baseapp to extend the abci listeners. ### Improvements diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 99bbdcd1d2c7..a084367dba4a 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -1164,6 +1164,10 @@ func (app *BaseApp) TxEncode(tx sdk.Tx) ([]byte, error) { return app.txEncoder(tx) } +func (app *BaseApp) StreamingManager() storetypes.StreamingManager { + return app.streamingManager +} + // Close is called in start cmd to gracefully cleanup resources. func (app *BaseApp) Close() error { var errs []error diff --git a/server/mock/store.go b/server/mock/store.go index 9c756eed4964..a73c57272f42 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -30,14 +30,6 @@ func (ms multiStore) CacheWrap() storetypes.CacheWrap { panic("not implemented") } -func (ms multiStore) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) storetypes.CacheWrap { - panic("not implemented") -} - -func (ms multiStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { - panic("not implemented") -} - func (ms multiStore) TracingEnabled() bool { panic("not implemented") } @@ -182,10 +174,6 @@ func (kv kvStore) CacheWrap() storetypes.CacheWrap { panic("not implemented") } -func (kv kvStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { - panic("not implemented") -} - func (kv kvStore) GetStoreType() storetypes.StoreType { panic("not implemented") }