From e4ec1a651f6c05ed4a56352e47c97ea5b1b3f304 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Tue, 14 Feb 2017 17:21:21 -0500 Subject: [PATCH] Query: LastHeight -> Height :) --- cmd/commands/query.go | 10 +++++----- demo/start.sh | 7 ++----- glide.lock | 5 ++--- glide.yaml | 4 ++-- plugins/ibc/ibc.go | 3 ++- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/cmd/commands/query.go b/cmd/commands/query.go index 33e616c64d..f0ac1ff58a 100644 --- a/cmd/commands/query.go +++ b/cmd/commands/query.go @@ -92,13 +92,13 @@ func cmdQuery(c *cli.Context) error { val := resp.Value proof := resp.Proof - lastHeight := resp.LastHeight + height := resp.Height fmt.Println(string(wire.JSONBytes(struct { - Value []byte `json:"value"` - Proof []byte `json:"proof"` - LastHeight uint64 `json:"last_height"` - }{val, proof, lastHeight}))) + Value []byte `json:"value"` + Proof []byte `json:"proof"` + Height uint64 `json:"height"` + }{val, proof, height}))) return nil } diff --git a/demo/start.sh b/demo/start.sh index b404a33c01..2ab83166c6 100644 --- a/demo/start.sh +++ b/demo/start.sh @@ -82,14 +82,14 @@ echo "... querying for packet data" echo "" # query for the packet data and proof QUERY_RESULT=$(basecoin query ibc,egress,$CHAIN_ID1,$CHAIN_ID2,1) -LAST_HEIGHT=$(echo $QUERY_RESULT | jq .last_height) +HEIGHT=$(echo $QUERY_RESULT | jq .height) PACKET=$(echo $QUERY_RESULT | jq .value) PROOF=$(echo $QUERY_RESULT | jq .proof) PACKET=$(removeQuotes $PACKET) PROOF=$(removeQuotes $PROOF) echo "" echo "QUERY_RESULT: $QUERY_RESULT" -echo "LAST_HEIGHT: $LAST_HEIGHT" +echo "HEIGHT: $HEIGHT" echo "PACKET: $PACKET" echo "PROOF: $PROOF" @@ -102,9 +102,6 @@ sleep 5 waitForBlock localhost:46657 waitForBlock localhost:36657 -# we need the header at height H=LAST_HEIGHT + 1 -HEIGHT=$(($LAST_HEIGHT + 1)) - echo "" echo "... querying for block data" echo "" diff --git a/glide.lock b/glide.lock index f87f437b8c..be56206ed2 100644 --- a/glide.lock +++ b/glide.lock @@ -154,15 +154,14 @@ imports: - transport testImports: - name: github.com/davecgh/go-spew - version: 346938d642f2ec3594ed81d874461961cd0faa76 + version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 subpackages: - spew - name: github.com/pmezard/go-difflib - version: 792786c7400a136282c1664665ae0a8db921c6c2 + version: d8ed2627bdf02c080bf22230dbb337003b7aba2d subpackages: - difflib - name: github.com/stretchr/testify version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 subpackages: - assert - - require diff --git a/glide.yaml b/glide.yaml index 570a80e24b..3229227306 100644 --- a/glide.yaml +++ b/glide.yaml @@ -13,9 +13,9 @@ import: - package: github.com/tendermint/go-wire version: develop - package: github.com/tendermint/merkleeyes - version: last_height + version: develop - package: github.com/tendermint/tendermint - version: last_height + version: rpc-commit - package: github.com/tendermint/abci version: develop - package: github.com/gorilla/websocket diff --git a/plugins/ibc/ibc.go b/plugins/ibc/ibc.go index 53913b438c..25f5a6da86 100644 --- a/plugins/ibc/ibc.go +++ b/plugins/ibc/ibc.go @@ -433,11 +433,12 @@ func verifyCommit(chainState BlockchainState, header *tm.Header, commit *tm.Comm chainID := chainState.ChainID vals := chainState.Validators valSet := tm.NewValidatorSet(vals) + blockID := commit.Precommits[0].BlockID // XXX: incorrect // NOTE: Currently this only works with the exact same validator set. // Not this, but perhaps "ValidatorSet.VerifyCommitAny" should expose // the functionality to verify commits even after validator changes. - blockID, err := valSet.VerifyCommitReturnBlockID(chainID, header.Height, commit) + err := valSet.VerifyCommit(chainID, blockID, header.Height, commit) if err != nil { return err }