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: avoid panic when using smock #429

Merged
merged 18 commits into from
May 3, 2024
Merged

fix: avoid panic when using smock #429

merged 18 commits into from
May 3, 2024

Conversation

agostbiro
Copy link
Member

smock.fake makes EDR panic with the current released version due to a mismatch between TypeScript and Rust types. In TS the return type of the call override callback is Promise<T>, but in Rust we expect T which causes a panic.

This PR fixes the conversion issue and adds a test for it.

Copy link

changeset-bot bot commented May 2, 2024

🦋 Changeset detected

Latest commit: cd96964

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/edr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@agostbiro agostbiro self-assigned this May 2, 2024
@agostbiro agostbiro linked an issue May 2, 2024 that may be closed by this pull request
@agostbiro agostbiro changed the title fix: avoid smock fake panic fix: avoid panic when using smock May 2, 2024
"test": "pnpm tsc && mocha --recursive \"test/**/*.ts\"",
"testNoBuild": "pnpm tsc && mocha --recursive \"test/**/*.ts\"",
"pretestArtifact": "pnpm install && pnpm tsc && npx hardhat compile",
"testArtifact": "mocha --recursive \"test/**/*.ts\" --timeout 60000",
Copy link
Member Author

Choose a reason for hiding this comment

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

timeout 60000, because these tests are ran with QEMU in the CI which is slow

@agostbiro agostbiro requested review from Wodann and fvictorio May 2, 2024 15:19
@agostbiro agostbiro merged commit 3dfd1a5 into main May 3, 2024
32 checks passed
@agostbiro agostbiro deleted the edr/fix-smock-panic branch May 3, 2024 14:52
agostbiro added a commit that referenced this pull request May 6, 2024
@Wodann Wodann added this to the EDR v0.3.8 milestone May 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

smock.fake makes EDR panic
3 participants