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

5788 - 4.x getPastEvents error #5819

Merged
merged 4 commits into from
Feb 9, 2023
Merged

5788 - 4.x getPastEvents error #5819

merged 4 commits into from
Feb 9, 2023

Conversation

luu-alex
Copy link
Contributor

@luu-alex luu-alex commented Feb 7, 2023

Description

#5788
The issue when using getPastEvents was when numbers would get passed in for options in fromBlock and toBlock. It would be converted to BigInts from returnFormat, which would fail when being sent as a request.

eth_getlogs requires fromBlock and toBlock to be hexstrings or blockTags. Change in this PR makes it so numbers are turned into hexstrings. Includes testcases

Please include a summary of the changes and be sure to follow our Contribution Guidelines.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist for 1.x:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:cov and my test cases cover all the lines and branches of the added code.
  • I ran npm run build with success.
  • I have tested the built dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.

Checklist for 4.x:

  • I have selected the correct 4.x base branch.
  • Within the description, the feature or issue is discussed in detail or an issue is linked.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added any required tests for the changes I made
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules.
  • I ran yarn successfully
  • I ran yarn lint successfully
  • I ran yarn build:web successfully
  • I ran yarn test:unit successfully
  • I ran yarn test:integration successfully
  • I ran compile:contracts successfully
  • I have tested my code.
  • I have updated the corresponding CHANGELOG.md file in the packages I have edited.

@luu-alex luu-alex changed the base branch from 1.x to 4.x February 7, 2023 20:32
@luu-alex luu-alex closed this Feb 7, 2023
@luu-alex luu-alex reopened this Feb 7, 2023
@github-actions github-actions bot temporarily deployed to Preview: (5788/getPastEvents) February 7, 2023 20:37 Inactive
@cloudflare-pages
Copy link

cloudflare-pages bot commented Feb 7, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: a2dc927
Status: ✅  Deploy successful!
Preview URL: https://bcb0f011.web3-js-docs.pages.dev
Branch Preview URL: https://5788-getpastevents.web3-js-docs.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Feb 7, 2023

Bundle Stats

Hey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Asset Old size New size Diff Diff %
Total 1.18 MB 1.06 MB -121 KB -10.03%
View detailed bundle breakdown

Added

Asset Old size New size Diff Diff %
../lib/eth.exports.d.ts.map 0 358 bytes 358 bytes -
../lib/eth.exports.d.ts 0 321 bytes 321 bytes -
../lib/providers.exports.d.ts.map 0 292 bytes 292 bytes -
../lib/providers.exports.d.ts 0 238 bytes 238 bytes -

Removed

No assets were removed

Bigger

Asset Old size New size Diff Diff %
../lib/index.d.ts 77 bytes 899 bytes 822 bytes 1067.53%
../lib/index.d.ts.map 155 bytes 919 bytes 764 bytes 492.90%

Smaller

Asset Old size New size Diff Diff %
web3.min.js 1.17 MB 1.04 MB -123 KB -10.35%

Unchanged

Asset Old size New size Diff Diff %
../lib/accounts.d.ts 3.42 KB 3.42 KB 0 0.00%
../lib/types.d.ts 1.92 KB 1.92 KB 0 0.00%
../lib/types.d.ts.map 1.75 KB 1.75 KB 0 0.00%
../lib/abi.d.ts 1020 bytes 999 bytes -18 bytes -1.77%
../lib/web3.d.ts 842 bytes 842 bytes 0 0.00%
../lib/web3.d.ts.map 693 bytes 694 bytes 1 bytes 0.14%
../lib/accounts.d.ts.map 528 bytes 528 bytes 0 0.00%
../lib/version.d.ts.map 140 bytes 140 bytes 0 0.00%
../lib/abi.d.ts.map 124 bytes 124 bytes 0 0.00%
../lib/version.d.ts 97 bytes 97 bytes 0 0.00%

@github-actions github-actions bot temporarily deployed to Preview: (5788/getPastEvents) February 7, 2023 21:07 Inactive
@luu-alex luu-alex marked this pull request as ready for review February 8, 2023 15:28
@luu-alex luu-alex changed the title 5788/get past events 5788 - 4.x getPastEvents error Feb 8, 2023
@github-actions github-actions bot temporarily deployed to Preview: (5788/getPastEvents) February 8, 2023 15:40 Inactive
@luu-alex luu-alex requested review from avkos, Muhammad-Altabba, jdevcs, nikoulai and spacesailor24 and removed request for avkos February 8, 2023 19:05
Copy link
Contributor

@jdevcs jdevcs left a comment

Choose a reason for hiding this comment

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

also update in changelog is required before merging.

@jdevcs jdevcs mentioned this pull request Mar 10, 2023
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

4 participants