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

Fix getBlock and getBlocks RPC commands to return blocks and transactions properly #1716

Merged
merged 5 commits into from
May 13, 2021

Conversation

someone235
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented May 13, 2021

Codecov Report

Merging #1716 (73cfc9b) into v0.10.2-dev (79cf0d6) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

❗ Current head 73cfc9b differs from pull request most recent head 0d8589a. Consider uploading reports for the commit 0d8589a to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##           v0.10.2-dev    #1716      +/-   ##
===============================================
- Coverage        59.43%   59.37%   -0.06%     
===============================================
  Files              551      551              
  Lines            21943    21962      +19     
===============================================
  Hits             13041    13041              
- Misses            6825     6844      +19     
  Partials          2077     2077              
Impacted Files Coverage Δ
app/rpc/rpccontext/verbosedata.go 63.38% <0.00%> (ø)
app/rpc/rpchandlers/get_block.go 0.00% <0.00%> (ø)
app/rpc/rpchandlers/get_blocks.go 29.41% <0.00%> (-1.84%) ⬇️
domain/consensus/consensus.go 64.14% <0.00%> (-3.79%) ⬇️

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 79cf0d6...0d8589a. Read the comment docs.

if errors.Is(err, database.ErrNotFound) {
header, err := s.blockHeaderStore.BlockHeader(s.databaseContext, stagingArea, blockHash)
if err != nil {
if errors.Is(err, database.ErrNotFound) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of building a pyramid, please exit out of the function when err is not ErrNotFound.

@someone235 someone235 force-pushed the fix-get-block-to-return-transactions branch from ec25a15 to f7f80b2 Compare May 13, 2021 12:20
@someone235 someone235 force-pushed the fix-get-block-to-return-transactions branch from f7f80b2 to 0d8589a Compare May 13, 2021 12:34
@stasatdaglabs stasatdaglabs merged commit 50fd86e into v0.10.2-dev May 13, 2021
@stasatdaglabs stasatdaglabs deleted the fix-get-block-to-return-transactions branch May 13, 2021 12:45
stasatdaglabs pushed a commit that referenced this pull request May 13, 2021
…ions properly (#1716)

* Fix getBlock RPC command to return transactions

* Fix getBlocks RPC command to return transactions and blocks

* Add GetBlockEvenIfHeaderOnly and use it for getBlock and getBlocks

* Implement GetBlockEvenIfHeaderOnly for fakeRelayInvsContext

* Use less nested code

(cherry picked from commit 50fd86e)
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.

None yet

2 participants