-
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
Return account queries with height #4536
Return account queries with height #4536
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4536 +/- ##
=======================================
Coverage 53.49% 53.49%
=======================================
Files 256 256
Lines 16165 16165
=======================================
Hits 8648 8648
Misses 6870 6870
Partials 647 647 |
Codecov Report
@@ Coverage Diff @@
## master #4536 +/- ##
=========================================
+ Coverage 53.49% 53.5% +<.01%
=========================================
Files 256 256
Lines 16165 16169 +4
=========================================
+ Hits 8648 8651 +3
- Misses 6870 6871 +1
Partials 647 647 |
Very good @colin-axner - how do you intend to test it? |
@alessio I was planning on manually testing via initializing a rest-server and doing some queries on either mainnet or a testnet, but I don't have access to any nodes at the moment. Also it doesn't look like there are any good places in the codebase to add a test for this? |
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.
ACK generally idea, but the logic needs to change slightly and we should add a LCD test 👍
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.
Thanks @colin-axner -- left a few more minor bits of feedback, but this looks great.
@@ -233,9 +243,10 @@ func (ctx CLIContext) verifyProof(queryPath string, resp abci.ResponseQuery) err | |||
|
|||
// queryStore performs a query from a Tendermint node with the provided a store | |||
// name and path. | |||
func (ctx CLIContext) queryStore(key cmn.HexBytes, storeName, endPath string) ([]byte, error) { | |||
func (ctx CLIContext) queryStore(key cmn.HexBytes, storeName, endPath string) ([]byte, int64, error) { |
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 the LCD test be contained in this module or would it need to be a separate package like in gaia? |
ohhhhh since we moved LCD tests to gaia, this might be difficult to do. I wouldn't worry too much about testing then since all we're really doing is adding an extra return value. |
@@ -12,6 +12,13 @@ import ( | |||
"github.com/cosmos/cosmos-sdk/x/auth/types" | |||
) | |||
|
|||
// AccountWithHeight wraps the embedded Account | |||
// with the height it was queried at |
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.
// with the height it was queried at | |
// with the height it was queried at. |
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.
ACK -- just one minor nitpick. Thanks @colin-axner!
// QueryWithData performs a query to a Tendermint node with the provided path | ||
// and a data payload. It returns the result and height of the query upon success | ||
// or an error if the query fails. | ||
func (ctx CLIContext) QueryWithData(path string, data []byte) ([]byte, int64, error) { |
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.
Hmmm, looks like QueryWithData
is identical to Query
! How about we simply remove QueryWithData
?
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.
LGTM
closes: #4542
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added a relevant changelog entry:
clog add [section] [stanza] [message]
rereviewed
Files changed
in the github PR explorerFor Admin Use: