-
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
APIs missing error when querying using invalid proposalId #3078
Comments
I guess the REST endpoint needs some love here. |
Reproduced via test case: diff --git a/client/lcd/lcd_test.go b/client/lcd/lcd_test.go
index 164edb0f..82367e89 100644
--- a/client/lcd/lcd_test.go
+++ b/client/lcd/lcd_test.go
@@ -740,4 +740,8 @@ func TestProposalsQuery(t *testing.T) {
require.Len(t, votes, 2)
require.True(t, addrs[0].String() == votes[0].Voter.String() || addrs[0].String() == votes[1].Voter.String())
require.True(t, addrs[1].String() == votes[0].Voter.String() || addrs[1].String() == votes[1].Voter.String())
+
+ // Test query votes on non-existent proposal
+ votes = getVotes(t, port, 99)
+ require.Len(t, votes, 0)
} The test pass, no error is returned. CC'ing who touched the code last: @sunnya97 |
I think this overlaps with #3091. In that PR, I now return an error IF the proposal is inactive (votes/deposits removed from state). BUT, if the proposal is still active and there are no votes/deposits, it still returns |
Work nicely now |
Summary of Bug
I tried to query the SDK using a non existent proposalId, and the reply was
null
instead of the proper error body with message.Steps to Reproduce
Run a local testnet (fresh)
Fetch https://localhost:9070/gov/proposals/3/votes
get
null
as replyFor Admin Use
The text was updated successfully, but these errors were encountered: