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

Do not return an error when block is unavailable due to expiry #5853

Merged
merged 2 commits into from
May 7, 2024

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented May 6, 2024

Closes #5852

#5607 broke the getBlock function in Cadence.

When a block is not available, indicate it via the exists return value, but do not return an error.

blockInfo had no tests, which is why #5607 silently broke the getBlock function.

This PR fixes the bug and adds a test for blockInfo.

@turbolent turbolent requested review from zhangchiqing and a team May 6, 2024 19:13
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 55.52%. Comparing base (b8c5da5) to head (3ba3a7e).
Report is 846 commits behind head on master.

Files Patch % Lines
utils/unittest/fixtures.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5853      +/-   ##
==========================================
+ Coverage   55.41%   55.52%   +0.10%     
==========================================
  Files        1108     1132      +24     
  Lines       86565    89476    +2911     
==========================================
+ Hits        47970    49679    +1709     
- Misses      33958    35021    +1063     
- Partials     4637     4776     +139     
Flag Coverage Δ
unittests 55.52% <33.33%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@zhangchiqing zhangchiqing left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

@zhangchiqing zhangchiqing force-pushed the bastian/5852-fix-getblock branch from 7e3bdd6 to 370614e Compare May 7, 2024 20:12
@zhangchiqing zhangchiqing force-pushed the bastian/5852-fix-getblock branch from 370614e to 3ba3a7e Compare May 7, 2024 20:18
@zhangchiqing zhangchiqing marked this pull request as ready for review May 7, 2024 20:44
@zhangchiqing zhangchiqing enabled auto-merge May 7, 2024 20:45
@zhangchiqing zhangchiqing added this pull request to the merge queue May 7, 2024
Copy link
Member Author

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Thanks for the test @zhangchiqing!

Merged via the queue into master with commit 2828e97 May 7, 2024
55 checks passed
@zhangchiqing zhangchiqing deleted the bastian/5852-fix-getblock branch May 7, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Cadence 1.0 getBlock errors when querying outside of queriable range
4 participants