-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch query tendermint proof helper function
- Loading branch information
1 parent
7075c49
commit 7ba386f
Showing
1 changed file
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,25 +22,23 @@ import ( | |
// at the lastest state available. | ||
// Issue: https://github.com/cosmos/cosmos-sdk/issues/6567 | ||
func QueryTendermintProof(clientCtx client.Context, key []byte) ([]byte, []byte, clienttypes.Height, error) { | ||
height := clientCtx.Height | ||
|
||
// ABCI queries at heights 1, 2 or less than or equal to 0 are not supported. | ||
// Base app does not support queries for height less than or equal to 1. | ||
// Therefore, a query at height 2 would be equivalent to a query at height 3. | ||
// A height of 0 will query with the lastest state. | ||
if height != 0 && height <= 2 { | ||
if clientCtx.Height != 0 && clientCtx.Height <= 2 { | ||
return nil, nil, clienttypes.Height{}, fmt.Errorf("proof queries at height <= 2 are not supported") | ||
} | ||
|
||
// Use the IAVL height if a valid tendermint height is passed in. | ||
// A height of 0 will query with the latest state. | ||
if height != 0 { | ||
height-- | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
colin-axner
Author
Contributor
|
||
if clientCtx.Height != 0 { | ||
clientCtx.Height = clientCtx.Height - 1 | ||
} | ||
|
||
req := abci.RequestQuery{ | ||
Path: fmt.Sprintf("store/%s/key", host.StoreKey), | ||
Height: height, | ||
Height: clientCtx.Height, | ||
Data: key, | ||
Prove: true, | ||
} | ||
|
the fix here would be
height = height -1
right?