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

bug: combination of vm.expectRevert and (failing) deployCode does not work #4589

Open
fubhy opened this issue Mar 17, 2023 · 1 comment
Open
Labels
A-testing Area: testing C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug

Comments

@fubhy
Copy link
Contributor

fubhy commented Mar 17, 2023

Component

Forge

Describe the feature you would like

It's currently not possible to pair a deployCode with vm.expectRevert. It also doesn't work to use testFail in this case.

We are forced to use deployCode to get around version constraints (our tests are solc 0.8.17 and some of our code is 0.6.12). We'd like to test some validation constraints in the constructor of one of our (old) contracts.

Additional context

One workaround would be to create a mock factory contract and use deployCode on that one and then deploy the tested contract through that mock factory ... but that seems a bit unwieldy.

@fubhy fubhy added the T-feature Type: feature label Mar 17, 2023
@gakonst gakonst added this to Foundry Mar 17, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 17, 2023
@elshan-eth
Copy link

We have problems with this too

@zerosnacks zerosnacks added A-testing Area: testing Cmd-forge-test Command: forge test C-forge Command: forge labels Jul 1, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy added T-bug Type: bug and removed T-feature Type: feature labels Oct 15, 2024
@zerosnacks zerosnacks changed the title Add support for combination of vm.expectRevert and (failing) deployCode bug: combination of vm.expectRevert and (failing) deployCode does not work Oct 15, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: testing C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug
Projects
Archived in project
Development

No branches or pull requests

4 participants