-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IBC Query cmds #7648
Fix IBC Query cmds #7648
Conversation
// 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 height less than or equal to 2 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 | ||
if clientCtx.Height <= 2 { | ||
if height != 0 && height <= 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out, somewhere down the line, a height of 0 is interpreted as latest height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the comment too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, I left the error message as is
Codecov Report
@@ Coverage Diff @@
## master #7648 +/- ##
==========================================
- Coverage 54.20% 54.15% -0.05%
==========================================
Files 454 611 +157
Lines 30638 38556 +7918
==========================================
+ Hits 16606 20881 +4275
- Misses 12392 15543 +3151
- Partials 1640 2132 +492 |
// 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 height less than or equal to 2 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 | ||
if clientCtx.Height <= 2 { | ||
if height != 0 && height <= 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the comment too?
…into colin/fix-q-cmds-7583
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - nice catch, ACK
* fix query * update comment
Description
Tested:
closes: #7583
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes