-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
6355 - allow data to be used in contract methods. #6377
Conversation
Deploying with
|
Latest commit: |
4c1d30c
|
Status: | ✅ Deploy successful! |
Preview URL: | https://5533f738.web3-js-docs.pages.dev |
Branch Preview URL: | https://6355.web3-js-docs.pages.dev |
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
|
add `{fillInputAndData: true,}` to `eth_call` on method_wrappers
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 4.x #6377 +/- ##
==========================================
+ Coverage 89.11% 89.15% +0.04%
==========================================
Files 199 199
Lines 7723 7752 +29
Branches 2128 2144 +16
==========================================
+ Hits 6882 6911 +29
Misses 841 841
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Updated PR to include web3config contractDataInputFill to web3context option to allow users to pass encodedAbi through data, input or for both properties |
@@ -37,6 +37,7 @@ export interface Web3ConfigOptions { | |||
transactionConfirmationPollingInterval?: number; | |||
blockHeaderTimeout: number; | |||
maxListenersWarningThreshold: number; | |||
contractDataInputFill: 'data' | 'input' | 'both' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luu-alex This config is specific for contract package only, so imo should be in contract package only instead of in web3_config class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting it in web3_config class will allow users to only create this option once for all new contracts instantiated. If this was only in the contracts package, users with multiple contracts will need to define this option for every contract instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
However, there are a few questions that I hope to answer and modify before merging.
Thanks,
docs/docs/guides/smart_contracts/deploying_and_interacting_with_smart_contracts.md
Outdated
Show resolved
Hide resolved
hey @luu-alex will we have a tagged version with this fix oooooor ? |
@moshmage hey, sorry didnt get to u sooner. This will be included in the next release which will be a minor version update. In the meantime you can use the dev branch which includes all the latest merges https://www.npmjs.com/package/web3?activeTab=versions latest dev version is 4.1.2-dev.e4ba45c.0 . As well updated docs for this |
Description
Fixing issues related to the merge about transaction data/input. As well contains community PR #6378
Should fix these issues #6355 #6400
After removing transactions to contain both input and data, this affected our contracts. contract methods were defaulting to sending only input in the calls which caused some people issues that required their methods to be sent with the data property. If they tried to use data in their contract options, this would error due to our typings only accepting input.
This PR:
contractDataInputFill
to web3context option to allow users to pass encodedAbi throughdata
,input
or for both propertiesPlease include a summary of the changes and be sure to follow our Contribution Guidelines.
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.