Query: LastHeight -> Height :)
This commit is contained in:
parent
67cf948f26
commit
e4ec1a651f
|
@ -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})))
|
||||
Height uint64 `json:"height"`
|
||||
}{val, proof, height})))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -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 ""
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue