diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 695115729d..3fad3d7de4 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -16,6 +16,35 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +func TestMountStores(t *testing.T) { + app := NewBaseApp(t.Name()) + + // make some cap keys + capKey1 := sdk.NewKVStoreKey("key1") + capKey2 := sdk.NewKVStoreKey("key2") + + // no stores are mounted + assert.Panics(t, func() { app.LoadLatestVersion(capKey1) }) + + app.MountStoresIAVL(capKey1, capKey2) + + // both stores are mounted + err := app.LoadLatestVersion(capKey1) + assert.Nil(t, err) + err = app.LoadLatestVersion(capKey2) + assert.Nil(t, err) +} + +func TestLoadVersion(t *testing.T) { + // TODO +} + +func TestInitStater(t *testing.T) { + // TODO +} + +//---------------------- + // A mock transaction to update a validator's voting power. type testUpdatePowerTx struct { Addr []byte @@ -33,7 +62,7 @@ func (tx testUpdatePowerTx) GetSigners() []crypto.Address { return ni func (tx testUpdatePowerTx) GetFeePayer() crypto.Address { return nil } func (tx testUpdatePowerTx) GetSignatures() []sdk.StdSignature { return nil } -func TestBasic(t *testing.T) { +func TestExecution(t *testing.T) { // Create app. app := NewBaseApp(t.Name()) diff --git a/baseapp/router.go b/baseapp/router.go index 2f27d7a544..b6b56792bd 100644 --- a/baseapp/router.go +++ b/baseapp/router.go @@ -6,12 +6,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// Router - TODO add description +// Router provides handlers for each transaction type. type Router interface { AddRoute(r string, h sdk.Handler) Route(path string) (h sdk.Handler) } +// map a transaction type to a handler type route struct { r string h sdk.Handler diff --git a/types/store.go b/types/store.go index 872c380901..b552f8cb02 100644 --- a/types/store.go +++ b/types/store.go @@ -61,7 +61,8 @@ type CommitMultiStore interface { Committer MultiStore - // Mount a store of type. + // Mount a store of type using the given db. + // If db == nil, the new store will use the CommitMultiStore db. MountStoreWithDB(key StoreKey, typ StoreType, db dbm.DB) // Panics on a nil key.