From 52f8f0637f34ebca023214300f88dc0e221993c2 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 28 Mar 2023 10:18:44 +0200 Subject: [PATCH] dont panic if no paramstore is set --- baseapp/baseapp.go | 2 +- server/mock/app_test.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index a83d372ec738..cba39a846944 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -436,7 +436,7 @@ func (app *BaseApp) setState(mode runTxMode, header cmtproto.Header) { // ParamStore. If the BaseApp has no ParamStore defined, nil is returned. func (app *BaseApp) GetConsensusParams(ctx sdk.Context) cmtproto.ConsensusParams { if app.paramStore == nil { - panic("param store not set") + return cmtproto.ConsensusParams{} } cp, err := app.paramStore.Get(ctx) diff --git a/server/mock/app_test.go b/server/mock/app_test.go index c3fcd15b4ec7..c40dbf67b7c4 100644 --- a/server/mock/app_test.go +++ b/server/mock/app_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" - "cosmossdk.io/log" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" )