-
Notifications
You must be signed in to change notification settings - Fork 81
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
rpc/server: be more specific in some sendrawtransaction error cases #1899
Conversation
@@ -1419,15 +1419,15 @@ func (s *Server) submitOracleResponse(ps request.Params) (interface{}, *response | |||
|
|||
func (s *Server) sendrawtransaction(reqParams request.Params) (interface{}, *response.Error) { | |||
if len(reqParams) < 1 { | |||
return nil, response.ErrInvalidParams | |||
return nil, response.NewInvalidParamsError("not enough parameters", 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.
Then maybe we can do the same thing for submitNotaryRequest
and submitBlock
RPC methods?
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.
Makes sense, updated. In general we're already better than C# node with error responses for things like verification failures (thanks to 94430ef), but these decoding/parameter errors need an improvement.
Codecov Report
@@ Coverage Diff @@
## master #1899 +/- ##
==========================================
+ Coverage 82.81% 82.89% +0.07%
==========================================
Files 287 287
Lines 22780 22780
==========================================
+ Hits 18866 18884 +18
+ Misses 2719 2697 -22
- Partials 1195 1199 +4
Continue to review full report at Codecov.
|
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.
Nice changes, these detailed error responces are very helpful for users.
Refs. #1894.