Skip to content

Commit a9e7d5b

Browse files
authored
fix: correct panic messages and enforce sealing check in SetStreamingManager (#23951)
1 parent 9f8a03f commit a9e7d5b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
8686

8787
### Improvements
8888

89+
* (baseapp) [#23951](https://github.com/cosmos/cosmos-sdk/pull/23951) Corrected panic messages in `SetCMS` and `SetCheckTxHandler`, and enforced `sealed` check in `SetStreamingManager` for consistency with other setters.
8990
* [#23470](https://github.com/cosmos/cosmos-sdk/pull/23470) Converge to use of one single sign mode type and signer data:
9091
* Use api's signmode throughout the SDK to align with `cosmossdk.io/tx`. This allows developer not to juggle between sign mode types
9192
* Deprecate `authsigning.SignerData` in favor of txsigning.SignerData and replace its usage

baseapp/options.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (app *BaseApp) SetDB(db corestore.KVStoreWithBatch) {
182182

183183
func (app *BaseApp) SetCMS(cms storetypes.CommitMultiStore) {
184184
if app.sealed {
185-
panic("SetEndBlocker() on sealed BaseApp")
185+
panic("SetCMS() on sealed BaseApp")
186186
}
187187

188188
app.cms = cms
@@ -375,7 +375,7 @@ func (app *BaseApp) SetPrepareProposal(handler sdk.PrepareProposalHandler) {
375375
// SetCheckTxHandler sets the checkTx function for the BaseApp.
376376
func (app *BaseApp) SetCheckTxHandler(handler sdk.CheckTxHandler) {
377377
if app.sealed {
378-
panic("SetCheckTx() on sealed BaseApp")
378+
panic("SetCheckTxHandler() on sealed BaseApp")
379379
}
380380

381381
app.checkTxHandler = handler
@@ -408,6 +408,9 @@ func (app *BaseApp) SetStoreMetrics(gatherer metrics.StoreMetrics) {
408408

409409
// SetStreamingManager sets the streaming manager for the BaseApp.
410410
func (app *BaseApp) SetStreamingManager(manager storetypes.StreamingManager) {
411+
if app.sealed {
412+
panic("SetStreamingManager() on sealed BaseApp")
413+
}
411414
app.streamingManager = manager
412415
}
413416

0 commit comments

Comments
 (0)