-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
R4R: Tx Query return values #3642
Conversation
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.
@jackzampolin did you test this locally? It fails CI on a nil pointer exception.
Do we have a cli test for this? |
Moving back to WIP pending fixed tests and added test coverage for this |
Codecov Report
@@ Coverage Diff @@
## develop #3642 +/- ##
===========================================
- Coverage 61.32% 61.27% -0.05%
===========================================
Files 186 186
Lines 13998 14002 +4
===========================================
- Hits 8584 8580 -4
- Misses 4870 4878 +8
Partials 544 544 |
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.
Needs PENDING.md
, otherwise LGTM.
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.
missing pending log entry, but otherwise LGTM 👍
@@ -26,18 +27,18 @@ func QueryTxCmd(cdc *codec.Codec) *cobra.Command { | |||
Short: "Matches this txhash over all committed blocks", | |||
Args: cobra.ExactArgs(1), | |||
RunE: func(cmd *cobra.Command, args []string) error { | |||
// find the key to look up the account | |||
hashHexStr := args[0] |
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.
why delete?
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.
Because it's only used in one place.
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.
But it add meaning! Otherwise, you'd have to guess what it is
client/tx/query.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if err = ValidateTxResult(cliCtx, res); !cliCtx.TrustNode && err != nil { |
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.
This does not equal to what was before. Before we didn't execute ValidateTxResult
if TrustNode
== true.
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.
good catch.
err = res.Proof.Validate(check.Header.DataHash) | ||
if err != nil { | ||
return err | ||
if !cliCtx.TrustNode { |
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.
if cliCtx.TrustNode {
return nil
}
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.
this code does this. Slightly confused what you mean here? If we trust the node, we don't want to validate the results.
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.
I meant instead of wrapping big chunk of code into if condition, you can return early!
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
Fixes: #3639
cc @alexanderbez @alessio