add tests to show mounting multiple stores is broken. see #532
This commit is contained in:
+25
-2
@@ -145,11 +145,15 @@ func TestInfo(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestInitChainer(t *testing.T) {
|
||||
app := newBaseApp(t.Name())
|
||||
logger := defaultLogger()
|
||||
db := dbm.NewMemDB()
|
||||
name := t.Name()
|
||||
app := NewBaseApp(name, logger, db)
|
||||
|
||||
// make a cap key and mount the store
|
||||
capKey := sdk.NewKVStoreKey("main")
|
||||
app.MountStoresIAVL(capKey)
|
||||
capKey2 := sdk.NewKVStoreKey("key2")
|
||||
app.MountStoresIAVL(capKey, capKey2)
|
||||
err := app.LoadLatestVersion(capKey) // needed to make stores non-nil
|
||||
assert.Nil(t, err)
|
||||
|
||||
@@ -178,6 +182,25 @@ func TestInitChainer(t *testing.T) {
|
||||
app.Commit()
|
||||
res = app.Query(query)
|
||||
assert.Equal(t, value, res.Value)
|
||||
|
||||
// reload app
|
||||
app = NewBaseApp(name, logger, db)
|
||||
capKey = sdk.NewKVStoreKey("main")
|
||||
capKey2 = sdk.NewKVStoreKey("key2")
|
||||
app.MountStoresIAVL(capKey, capKey2)
|
||||
err = app.LoadLatestVersion(capKey) // needed to make stores non-nil
|
||||
assert.Nil(t, err)
|
||||
app.SetInitChainer(initChainer)
|
||||
|
||||
// ensure we can still query after reloading
|
||||
res = app.Query(query)
|
||||
assert.Equal(t, value, res.Value)
|
||||
|
||||
// commit and ensure we can still query
|
||||
app.BeginBlock(abci.RequestBeginBlock{})
|
||||
app.Commit()
|
||||
res = app.Query(query)
|
||||
assert.Equal(t, value, res.Value)
|
||||
}
|
||||
|
||||
// Test that successive CheckTx can see each others' effects
|
||||
|
||||
Reference in New Issue
Block a user