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 6611 uncaught type error calling a contract's function with insufficient funds on Polygon #6626

Closed
wants to merge 4 commits into from

Conversation

nicos99
Copy link
Contributor

@nicos99 nicos99 commented Nov 27, 2023

Description

Add a security in the the callback function of "web3-core-methode / buildCall / send" in case there is no error raison data (as it can be seen for insufficient funds on Pologon PoS) to avoid throwing "TypeError: (intermediate value).data is undefined" exception that can't be caught in user side.

Add a new unit test case about this to ensure non-regression.

Fixes issue #6611

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • 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.
  • My changes generate no new warnings.
  • I ran npm run lint with success and extended the tests and types if necessary. --> Increased the function's cyclomatic complexity that was already too high.
  • I ran npm run test:unit with success. --> still 2 failing tests about re-connect
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code. --> Missing script: "test:coverage". I tried npm run test:cov but I don't know how to interpret the result
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network. --> only on Polygon.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

@nicos99
Copy link
Contributor Author

nicos99 commented Nov 30, 2023

Hello, can-you please review this PR ? Maybe starting with you @Muhammad-Altabba ? Thanks 😉

@jdevcs
Copy link
Contributor

jdevcs commented Dec 11, 2023

@nicos99 could you check 4.x for this error , and use that?

@nicos99
Copy link
Contributor Author

nicos99 commented Dec 11, 2023

@nicos99 could you check 4.x for this error , and use that?

@jdevcs There is no issue with 4.x (see discussion with @Muhammad-Altabba in #6611). if I understand correctly my proposed fix will not be merged because there is no desire to release a new 1.x version, correct?

@jdevcs
Copy link
Contributor

jdevcs commented Dec 12, 2023

@nicos99 could you check 4.x for this error , and use that?

@jdevcs There is no issue with 4.x (see discussion with @Muhammad-Altabba in #6611). if I understand correctly my proposed fix will not be merged because there is no desire to release a new 1.x version, correct?

Yes, 1.x will soon retire and its on min support, I'll suggest to migrate to 4.x, and if you need any help in migration let us know. plus share if there is any 4.x feedback for feature requests or bug reports.

@nicos99
Copy link
Contributor Author

nicos99 commented Dec 19, 2023

so let's forget my work...

@nicos99 nicos99 closed this Dec 19, 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.

3 participants