small test and some comments

This commit is contained in:
Ethan Buchman
2018-02-17 16:32:30 -05:00
parent 1555c4876e
commit 1698e4e2d8
3 changed files with 34 additions and 3 deletions
+30 -1
View File
@@ -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())
+2 -1
View File
@@ -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