-
Notifications
You must be signed in to change notification settings - Fork 5k
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
web3-eth-contract validation test fail #6474
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
|
Deploying with Cloudflare Pages
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 4.x #6474 +/- ##
=======================================
Coverage 89.65% 89.65%
=======================================
Files 213 213
Lines 8199 8199
Branches 2220 2220
=======================================
Hits 7351 7351
Misses 848 848
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
investigated #6461
const logs = await contractDeployed.getPastEvents('Transfer');
const tokenId = (logs[0] as EventLog)?.returnValues?.tokenId as string;
in this line, logs can sometimes be undefined, creating this error.Fix is to just use receipt and instead of getPastEvents
Why logs were undefined? if tx is mined there should be logs available via getPastEvents, was there issue in tx waiting long in tests and not mined?
I also think that we need to know why the logs were undefined sometime. And I think either the proposed code will still fail in the same occasions where the old code fails. Or, if this would not be the case, then there is another issue that the users will face when using Could you please @luu-alex investigate more on why and when the Many thanks, |
sounds good @Muhammad-Altabba , this PR and i think this one as well was holding up release. I created an issue and will begin investigating. Thanks for the feedback |
@jdevcs im not too sure, i will need to investigate getPastEvents next |
Needs more investigation, it seems to be an issue with getpastevents returning undefined due to a change from validation |
Description
investigated #6461
in this line, logs can sometimes be undefined, creating this error.
Fix is to just use receipt and instead of
getPastEvents
Please 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.