Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kbhat1 committed Oct 29, 2024
1 parent 8545953 commit 468f8dc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions baseapp/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/testutil"
"github.com/cosmos/cosmos-sdk/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

Expand Down Expand Up @@ -200,3 +201,27 @@ func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) {
panic(err)
}
}
func TestHandleQueryStore_NonQueryableMultistore(t *testing.T) {
logger := defaultLogger()
db := dbm.NewMemDB()
name := t.Name()
app := NewBaseApp(name, logger, db, nil, nil, &testutil.TestAppOpts{})

// Mock a non-queryable cms
mockCMS := &mockNonQueryableMultiStore{}
app.cms = mockCMS

path := []string{"store", "test"}
req := abci.RequestQuery{
Path: "store/test",
Height: 1,
}

resp := handleQueryStore(app, path, req)
require.True(t, resp.IsErr())
require.Contains(t, resp.Log, "multistore doesn't support queries")
}

type mockNonQueryableMultiStore struct {
types.CommitMultiStore
}

0 comments on commit 468f8dc

Please sign in to comment.