Merge PR #1926: RootMultiStore test helper bugfix

* Add reload modification to test
* Modify test helper function to prefix store dbs
This commit is contained in:
Jeremiah Andrews 2018-08-08 03:27:05 -07:00 committed by Christopher Goes
parent 7fb626f548
commit f653bed8c9
1 changed files with 8 additions and 3 deletions

View File

@ -133,6 +133,11 @@ func TestMultiStoreQuery(t *testing.T) {
cid = multi.Commit()
ver := cid.Version
// Reload multistore from database
multi = newMultiStoreWithMounts(db)
err = multi.LoadLatestVersion()
require.Nil(t, err)
// Test bad path.
query := abci.RequestQuery{Path: "/key", Data: k, Height: ver}
qres := multi.Query(query)
@ -173,11 +178,11 @@ func TestMultiStoreQuery(t *testing.T) {
func newMultiStoreWithMounts(db dbm.DB) *rootMultiStore {
store := NewCommitMultiStore(db)
store.MountStoreWithDB(
sdk.NewKVStoreKey("store1"), sdk.StoreTypeIAVL, db)
sdk.NewKVStoreKey("store1"), sdk.StoreTypeIAVL, nil)
store.MountStoreWithDB(
sdk.NewKVStoreKey("store2"), sdk.StoreTypeIAVL, db)
sdk.NewKVStoreKey("store2"), sdk.StoreTypeIAVL, nil)
store.MountStoreWithDB(
sdk.NewKVStoreKey("store3"), sdk.StoreTypeIAVL, db)
sdk.NewKVStoreKey("store3"), sdk.StoreTypeIAVL, nil)
return store
}