Skip to content

Commit

Permalink
dont mount multiple stores while its broken
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuchman committed Mar 1, 2018
1 parent 2047abc commit cba7379
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ BUG FIXES

* [baseapp] Fix panic on app restart
* [baseapp] InitChain does not call Commit
* [basecoin] Remove IBCStore because mounting multiple stores is currently broken

## 0.10.0 (February 20, 2017)

Expand Down
12 changes: 7 additions & 5 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ func TestInitChainer(t *testing.T) {
name := t.Name()
app := NewBaseApp(name, logger, db)

// make a cap key and mount the store
// make cap keys and mount the stores
// NOTE/TODO: mounting multiple stores is broken
// see https://github.com/cosmos/cosmos-sdk/issues/532
capKey := sdk.NewKVStoreKey("main")
capKey2 := sdk.NewKVStoreKey("key2")
app.MountStoresIAVL(capKey, capKey2)
// capKey2 := sdk.NewKVStoreKey("key2")
app.MountStoresIAVL(capKey) // , capKey2)
err := app.LoadLatestVersion(capKey) // needed to make stores non-nil
assert.Nil(t, err)

Expand Down Expand Up @@ -186,8 +188,8 @@ func TestInitChainer(t *testing.T) {
// reload app
app = NewBaseApp(name, logger, db)
capKey = sdk.NewKVStoreKey("main")
capKey2 = sdk.NewKVStoreKey("key2")
app.MountStoresIAVL(capKey, capKey2)
// capKey2 = sdk.NewKVStoreKey("key2") // TODO
app.MountStoresIAVL(capKey) //, capKey2)
err = app.LoadLatestVersion(capKey) // needed to make stores non-nil
assert.Nil(t, err)
app.SetInitChainer(initChainer)
Expand Down
4 changes: 3 additions & 1 deletion examples/basecoin/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ func NewBasecoinApp(logger log.Logger, db dbm.DB) *BasecoinApp {
// initialize BaseApp
app.SetTxDecoder(app.txDecoder)
app.SetInitChainer(app.initChainer)
app.MountStoresIAVL(app.capKeyMainStore, app.capKeyIBCStore)
// TODO: mounting multiple stores is broken
// https://github.com/cosmos/cosmos-sdk/issues/532
app.MountStoresIAVL(app.capKeyMainStore) // , app.capKeyIBCStore)
app.SetAnteHandler(auth.NewAnteHandler(app.accountMapper))
err := app.LoadLatestVersion(app.capKeyMainStore)
if err != nil {
Expand Down

0 comments on commit cba7379

Please sign in to comment.