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

Support cheatable state in contract constructors #254

Closed
Arcticae opened this issue Jul 24, 2023 · 2 comments · Fixed by #503
Closed

Support cheatable state in contract constructors #254

Arcticae opened this issue Jul 24, 2023 · 2 comments · Fixed by #503
Assignees
Labels

Comments

@Arcticae
Copy link
Contributor

To what component is your bug related to?

Forge

Feature Request

We should allow mocking the constructor block info (and not only) state.
This should include roll, warp etc.
The process will include breaking up the deploy into smaller functions and using lower-level ones instead of transaction-level blockifier logic, to allow modifying execution context.

@MaksymilianDemitraszek
Copy link
Contributor

blocked by #305 or #395 as it cannot be tested rn

@MaksymilianDemitraszek MaksymilianDemitraszek removed their assignment Aug 3, 2023
@Arcticae Arcticae self-assigned this Aug 8, 2023
@Arcticae
Copy link
Contributor Author

Arcticae commented Aug 8, 2023

Consider #137 when implementing

@piotmag769 piotmag769 mentioned this issue Aug 8, 2023
5 tasks
@Arcticae Arcticae removed the blocked label Aug 18, 2023
@Arcticae Arcticae moved this from TODO to In Progress in Starknet foundry Aug 18, 2023
github-merge-queue bot pushed a commit that referenced this issue Aug 24, 2023
<!-- Reference any GitHub issues resolved by this PR -->

Closes #254 

## Introduced changes

<!-- A brief description of the changes -->
- Use `call_contract` instead of invoking transaction in deploy
- Catch all deploy syscalls, so that cheating should work for all depths
- Clone deploy logic from blockifier + redirect constructor execution to
our cheatable execution

## Checklist

<!-- Make sure all of these are complete -->
- [x] Add test for checking deploy cheating for call depth > 1
- [x] Linked relevant issue
- [x] Updated relevant documentation
- [x] Added relevant tests
- [x] Performed self-review of the code
- [x] Added changes to `CHANGELOG.md`
@github-project-automation github-project-automation bot moved this from In Progress to Done in Starknet foundry Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants