-
Notifications
You must be signed in to change notification settings - Fork 79
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: update getrawmempool
and getrawtransaction
RPC-calls
#1236
Conversation
pkg/rpc/server/server.go
Outdated
var getVerified bool | ||
if len(reqParams) > 0 { | ||
getVerified = reqParams.Value(0).GetBoolean() | ||
} |
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.
There is no need to check parameters count: getVerified := reqParams.Value(0).GetBoolean()
6afcceb
to
daf44ed
Compare
Codecov Report
@@ Coverage Diff @@
## master #1236 +/- ##
==========================================
- Coverage 66.74% 66.72% -0.02%
==========================================
Files 200 200
Lines 17159 17171 +12
==========================================
+ Hits 11452 11458 +6
- Misses 5092 5098 +6
Partials 615 615
Continue to review full report at Codecov.
|
pkg/rpc/server/server.go
Outdated
@@ -693,9 +693,13 @@ func (s *Server) getrawtransaction(reqParams request.Params) (interface{}, *resp | |||
header, err := s.chain.GetHeader(_header) | |||
if err != nil { | |||
resultsErr = response.NewInvalidParamsError(err.Error(), err) | |||
} else { | |||
results = result.NewTransactionOutputRaw(tx, header, s.chain) | |||
return nil, resultsErr |
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.
return nil, response.NewInvalidParamsError(err.Error(), err)
?
pkg/rpc/server/server.go
Outdated
@@ -463,13 +463,20 @@ func (s *Server) getPeers(_ request.Params) (interface{}, *response.Error) { | |||
return peers, nil | |||
} | |||
|
|||
func (s *Server) getRawMempool(_ request.Params) (interface{}, *response.Error) { | |||
func (s *Server) getRawMempool(reqParams request.Params) (interface{}, *response.Error) { | |||
getVerified := reqParams.Value(0).GetBoolean() |
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.
It's more like verbose
flag, getVerified
looks a bit strange to me.
Closes #1183. Added VMState to transaction output raw.
daf44ed
to
0c424a0
Compare
Closes #1182, closes #1183.