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

Use cheatable entrypoint in constructors #503

Merged
merged 11 commits into from
Aug 24, 2023

Conversation

Arcticae
Copy link
Contributor

@Arcticae Arcticae commented Aug 22, 2023

Closes #254

Introduced 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

  • Add test for checking deploy cheating for call depth > 1
  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

# Conflicts:
#	crates/cheatnet/src/cheatcodes/deploy.rs
#	crates/cheatnet/src/conversions.rs
#	crates/cheatnet/src/rpc.rs
#	crates/forge/tests/integration/roll.rs
#	crates/forge/tests/integration/warp.rs
@Arcticae Arcticae marked this pull request as ready for review August 23, 2023 15:35
@Arcticae Arcticae requested review from a team August 23, 2023 15:35
@Arcticae Arcticae requested a review from a team as a code owner August 23, 2023 15:35
@Arcticae Arcticae requested review from Radinyn, abulenok, tkumor3, bartekryba, THenry14 and war-in and removed request for a team, abulenok, tkumor3, bartekryba and THenry14 August 23, 2023 15:35
crates/cheatnet/src/constants.rs Show resolved Hide resolved
crates/cheatnet/src/rpc.rs Outdated Show resolved Hide resolved
docs/src/testing/using-cheatcodes.md Show resolved Hide resolved
@Arcticae Arcticae requested review from Radinyn and war-in August 24, 2023 11:06
@Radinyn Radinyn added this pull request to the merge queue Aug 24, 2023
Merged via the queue into master with commit 5dc877e Aug 24, 2023
@Radinyn Radinyn deleted the 254-constructors-cheatable-state branch August 24, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support cheatable state in contract constructors
3 participants