Skip to content

Commit

Permalink
Merge pull request #1007 from iov-one/tm_upgrade
Browse files Browse the repository at this point in the history
Upgrade tendermint version
  • Loading branch information
alpe authored Oct 2, 2019
2 parents de864ca + 3d74f0f commit 5a0ccd2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 558 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## HEAD
## 0.21.2
- Upgrade tendermint dependency to v0.31.9
## 0.21.1
- Let AntispamFeeDecorator handle empty product fee.
## 0.21.0
Expand Down
19 changes: 10 additions & 9 deletions cmd/bnscli/cmd_cash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func TestCmdWithFeeHappyPathDefaultAmount(t *testing.T) {
}

type abciQueryRequest struct {
ID string `json:"id"`
Method string `json:"method"`
Params struct {
Data string `json:"data"` // hex-encoded
Expand Down Expand Up @@ -203,7 +204,7 @@ func newCashConfTendermintServer(
assert.Nil(t, err)

if bytes.Equal(raw, []byte("_c:cash")) {
io.WriteString(w, tmResponse(t, raw, &conf))
io.WriteString(w, tmResponse(t, raw, &conf, req.ID))
return
}

Expand All @@ -216,9 +217,9 @@ func newCashConfTendermintServer(
Pkg: pkg,
Version: 1,
}
io.WriteString(w, tmResponse(t, raw, schema))
io.WriteString(w, tmResponse(t, raw, schema, req.ID))
} else {
io.WriteString(w, tmEmptyResponse(t))
io.WriteString(w, tmEmptyResponse(t, req.ID))
}
return
}
Expand All @@ -227,14 +228,14 @@ func newCashConfTendermintServer(
path := string(raw[len("msgfee:"):])
fee, ok := msgfees[path]
if !ok {
io.WriteString(w, tmEmptyResponse(t))
io.WriteString(w, tmEmptyResponse(t, req.ID))
return
}
io.WriteString(w, tmResponse(t, raw, &msgfee.MsgFee{
Metadata: &weave.Metadata{Schema: 1},
MsgPath: path,
Fee: fee,
}))
}, req.ID))
return
}

Expand All @@ -244,7 +245,7 @@ func newCashConfTendermintServer(

// tmResponse returns a tenderming HTTP response for a configuration query.
// Returned response does not contain "key" or "height" information.
func tmResponse(t testing.TB, key []byte, payload interface{ Marshal() ([]byte, error) }) string {
func tmResponse(t testing.TB, key []byte, payload interface{ Marshal() ([]byte, error) }, clientID string) string {
value, err := payload.Marshal()
assert.Nil(t, err)

Expand All @@ -260,7 +261,7 @@ func tmResponse(t testing.TB, key []byte, payload interface{ Marshal() ([]byte,

return `{
"jsonrpc": "2.0",
"id": "",
"id": "` + clientID + `",
"result": {
"response": {
"key": "` + encKey + `",
Expand All @@ -270,14 +271,14 @@ func tmResponse(t testing.TB, key []byte, payload interface{ Marshal() ([]byte,
}`
}

func tmEmptyResponse(t testing.TB) string {
func tmEmptyResponse(t testing.TB, clientID string) string {
set, err := (&app.ResultSet{}).Marshal()
assert.Nil(t, err)
enc := base64.StdEncoding.EncodeToString(set)

return `{
"jsonrpc": "2.0",
"id": "",
"id": "` + clientID + `",
"result": {
"response": {
"key": "` + enc + `",
Expand Down
Loading

0 comments on commit 5a0ccd2

Please sign in to comment.