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

Add mock_call #385

Merged
merged 49 commits into from
Aug 16, 2023
Merged

Add mock_call #385

merged 49 commits into from
Aug 16, 2023

Conversation

abulenok
Copy link
Contributor

@abulenok abulenok commented Aug 2, 2023

Closes #

Introduced changes

  • Add start_mock_call cheatcode (with tests and docs)
  • Add stop_mock_call cheatcode (with tests and docs)

Breaking changes

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@abulenok abulenok self-assigned this Aug 2, 2023
@abulenok abulenok linked an issue Aug 2, 2023 that may be closed by this pull request
@abulenok abulenok marked this pull request as ready for review August 3, 2023 16:12
@abulenok abulenok requested review from a team August 3, 2023 16:12
@abulenok abulenok requested a review from a team as a code owner August 3, 2023 16:12
@abulenok abulenok requested review from MaksymilianDemitraszek, Arcticae, tkumor3, THenry14, war-in, cptartur and Radinyn and removed request for a team, tkumor3 and THenry14 August 3, 2023 16:12
docs/src/appendix/cheatcodes/start_mock_call.md Outdated Show resolved Hide resolved
crates/cheatable-starknet/src/cheatcodes/mock_call.rs Outdated Show resolved Hide resolved
corelib/src/cheatcodes.cairo Outdated Show resolved Hide resolved
crates/forge/tests/integration/mock_call.rs Outdated Show resolved Hide resolved
crates/forge/tests/integration/mock_call.rs Outdated Show resolved Hide resolved
Copy link
Member

@piotmag769 piotmag769 left a comment

Choose a reason for hiding this comment

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

Can we also add tests for:

  • mocking when contract is not deployed under a given address (just pass contract address that you mocked to a dispatcher)
  • mocking when contract is deployed but does not have a certain function implemented (you can define a contract trait with additional function)

crates/forge/tests/integration/mock_call.rs Show resolved Hide resolved
crates/forge/tests/integration/mock_call.rs Outdated Show resolved Hide resolved
Copy link
Member

@piotmag769 piotmag769 left a comment

Choose a reason for hiding this comment

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

Requesting changes to make sure we do not merge by accident before adjusting tests

@abulenok
Copy link
Contributor Author

@piotmag769 Added tests in 7125bde

@abulenok abulenok requested a review from piotmag769 August 16, 2023 08:03
piotmag769
piotmag769 approved these changes Aug 16, 2023
@abulenok abulenok enabled auto-merge August 16, 2023 15:02
@abulenok abulenok added this pull request to the merge queue Aug 16, 2023
Merged via the queue into master with commit 1981e86 Aug 16, 2023
@abulenok abulenok deleted the 73-mock-call branch August 16, 2023 16:22
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.

Implement MockCall cheat code
6 participants