Return account queries with height#4536
Return account queries with height#4536alexanderbez merged 4 commits intocosmos:masterfrom colin-axner:colin/account_height_queries
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? |
alexanderbez
left a comment
There was a problem hiding this comment.
ACK generally idea, but the logic needs to change slightly and we should add a LCD test 👍
alexanderbez
left a comment
There was a problem hiding this comment.
Thanks @colin-axner -- left a few more minor bits of feedback, but this looks great.
| // 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) { |
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. |
| ) | ||
|
|
||
| // AccountWithHeight wraps the embedded Account | ||
| // with the height it was queried at |
There was a problem hiding this comment.
| // with the height it was queried at | |
| // with the height it was queried at. |
alexanderbez
left a comment
There was a problem hiding this comment.
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.
Hmmm, looks like QueryWithData is identical to Query! How about we simply remove QueryWithData?
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 changedin the github PR explorerFor Admin Use: