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

Resolve issues with some fields in eth_getBlock #432

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

Ivo-Yankov
Copy link
Collaborator

@Ivo-Yankov Ivo-Yankov commented Aug 8, 2022

Description:
Fix issues with values returned from getBlocks: timestamp and gasLimit.

  • Changes timestamp logic to be always the start of the period, returned by the mirror node at /api/v1/blocks/:hashOrNumber
  • Changes gasLimit to be hardcoded as 15000000
  • Returns the gas_used field from /api/v1/blocks/:hashOrNumber as gasUsed instead of calculating the gas sum of all contract results in the block.

Related issue(s):

Fixes an issue, described in a comment in 414#issuecomment-1207980112

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2022

Codecov Report

Merging #432 (f19619f) into main (4b403c9) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

❗ Current head f19619f differs from pull request most recent head ec5eb3d. Consider uploading reports for the commit ec5eb3d to get more accurate results

@@            Coverage Diff             @@
##             main     #432      +/-   ##
==========================================
- Coverage   76.23%   76.12%   -0.11%     
==========================================
  Files          11       11              
  Lines         913      909       -4     
  Branches      144      142       -2     
==========================================
- Hits          696      692       -4     
  Misses        165      165              
  Partials       52       52              
Impacted Files Coverage Δ
packages/relay/src/lib/eth.ts 84.10% <100.00%> (-0.14%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Ivo-Yankov Ivo-Yankov self-assigned this Aug 8, 2022
@Ivo-Yankov Ivo-Yankov added bug Something isn't working limechain P1 dev tools Features enabling dev tool integration enhancement New feature or request and removed bug Something isn't working labels Aug 8, 2022
@Ivo-Yankov Ivo-Yankov added this to the 0.6.0 milestone Aug 8, 2022
@Ivo-Yankov Ivo-Yankov marked this pull request as ready for review August 8, 2022 14:47
Nana-EC
Nana-EC previously approved these changes Aug 8, 2022
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG

Daniel-K-Ivanov
Daniel-K-Ivanov previously approved these changes Aug 9, 2022
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Nana-EC
Nana-EC previously approved these changes Aug 9, 2022
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG

# Conflicts:
#	packages/relay/src/lib/eth.ts
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Ivo-Yankov Ivo-Yankov merged commit 76b75e8 into main Aug 10, 2022
@Ivo-Yankov Ivo-Yankov deleted the 414-get-block-incorrect-values branch August 10, 2022 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev tools Features enabling dev tool integration enhancement New feature or request limechain P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants