-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[DRAFT] Allow smart contract methods to accept parameters when ABI was provided not as const
#6636
Conversation
Bundle StatsHey 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
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 4.x #6636 +/- ##
==========================================
- Coverage 91.46% 90.25% -1.21%
==========================================
Files 214 214
Lines 8155 8087 -68
Branches 2193 2162 -31
==========================================
- Hits 7459 7299 -160
- Misses 696 788 +92
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Deploying with
|
Latest commit: |
e37be00
|
Status: | ✅ Deploy successful! |
Preview URL: | https://4452029e.web3-js-docs.pages.dev |
Branch Preview URL: | https://6275-fix-web3ethcontractmeth.web3-js-docs.pages.dev |
…not-accept-to-insert-any-parameters
as const
…not-accept-to-insert-any-parameters
…not-accept-to-insert-any-parameters
…not-accept-to-insert-any-parameters
Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
…not-accept-to-insert-any-parameters
This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Description
Fixes #6275
If the developer provided an ABI from a file but without having
as const
, if he provided the ABI without saving it to a ts file first (with theas const
), or if he provided an empty ABI, the user can callcontract.methods.ANY_METHOD_NAM()
but cannot pass any parameter to his called methods. Meaning he can call only methods that does not accept parameter or he need to do something like:(contract.methods.transfer as any)('0xe4beef667408b99053dc147ed19592ada0d77f59', 12)
This MR will fix that.
Type of change
Checklist:
npm run lint
with success and extended the tests and types if necessary.npm run test:unit
with success.npm run test:coverage
and my test cases cover all the lines and branches of the added code.npm run build
and testeddist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.