Skip to content
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

Merged
merged 3 commits into from
Jul 29, 2020

Conversation

AnnaShaleva
Copy link
Member

Closes #1182, closes #1183.

@AnnaShaleva AnnaShaleva self-assigned this Jul 27, 2020
Comment on lines 467 to 470
var getVerified bool
if len(reqParams) > 0 {
getVerified = reqParams.Value(0).GetBoolean()
}
Copy link
Contributor

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()

@codecov
Copy link

codecov bot commented Jul 28, 2020

Codecov Report

Merging #1236 into master will decrease coverage by 0.01%.
The diff coverage is 69.84%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
pkg/rpc/server/server.go 78.75% <50.00%> (-0.52%) ⬇️
pkg/vm/vm.go 88.56% <66.66%> (ø)
pkg/vm/state.go 88.88% <87.50%> (ø)
pkg/core/blockchain.go 69.52% <100.00%> (ø)
pkg/core/state/notification_event.go 82.75% <100.00%> (ø)
pkg/rpc/response/result/application_log.go 100.00% <100.00%> (ø)
pkg/rpc/response/result/tx_raw_output.go 78.37% <100.00%> (+1.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9adb3a0...0c424a0. Read the comment docs.

@@ -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
Copy link
Member

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)?

@@ -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()
Copy link
Member

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.

@fyrchik fyrchik merged commit b187dfe into master Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpc: add VMState to getrawtransaction rpc: adjust getrawmempool RPC-call
3 participants