Skip to content

Commit

Permalink
fix broken mock test
Browse files Browse the repository at this point in the history
  • Loading branch information
rigelrozanski committed Mar 1, 2018
1 parent 0469358 commit 889551d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions mock/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
17 changes: 9 additions & 8 deletions mock/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions mock/tx.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint
package mock

import (
Expand Down

0 comments on commit 889551d

Please sign in to comment.