fix broken mock test

This commit is contained in:
rigelrozanski 2018-03-01 03:40:39 +00:00
parent 0469358286
commit 889551dbbd
3 changed files with 12 additions and 8 deletions

View File

@ -70,11 +70,13 @@ func KVStoreHandler(storeKey sdk.StoreKey) sdk.Handler {
}
}
// basic KV structure
type KV struct {
Key string `json:"key"`
Value string `json:"value"`
}
// What Genesis JSON is formatted as
type GenesisJSON struct {
Values []KV `json:"values"`
}

View File

@ -25,16 +25,17 @@ func TestInitApp(t *testing.T) {
require.NoError(t, err)
req := abci.RequestInitChain{AppStateBytes: opts}
app.InitChain(req)
app.Commit()
// XXX test failing
// // make sure we can query these values
//query := abci.RequestQuery{
//Path: "/main/key",
//Data: []byte("foo"),
//}
//qres := app.Query(query)
//require.Equal(t, uint32(0), qres.Code, qres.Log)
//assert.Equal(t, []byte("bar"), qres.Value)
// make sure we can query these values
query := abci.RequestQuery{
Path: "/main/key",
Data: []byte("foo"),
}
qres := app.Query(query)
require.Equal(t, uint32(0), qres.Code, qres.Log)
assert.Equal(t, []byte("bar"), qres.Value)
}
// TextDeliverTx ensures we can write a tx

View File

@ -1,3 +1,4 @@
//nolint
package mock
import (