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

feat(v1): book pass #924

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: several updates on expect cheatcodes
Evalir committed Jun 16, 2023
commit 4ae90690264638f4cc527922495be5a0823f7d05
2 changes: 1 addition & 1 deletion src/cheatcodes/expect-call.md
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ function expectCall(

### Description

Expects that a call to a specified address `where`, where the call data either strictly or loosely matches `data`. The cheatcode can be called in two ways:
Expects that a call to a specified address `where`, where the call data either strictly or loosely matches `data`, in the next call's subcalls. The cheatcode can be called in two ways:

- If no `count` parameter is specified, the call will be expected to be made at least the amount of times the cheatcode was called. For the same calldata, you cannot call the cheatcode with no `count` and then pass in a `count` parameter.
- If `count` is specified, the call will be expected to be made strictly `count` times. For the same calldata, the `count` value cannot be overwritten with another cheatcode call, nor it can be increment by calling the cheatcode without a `count` parameter.
4 changes: 2 additions & 2 deletions src/cheatcodes/expect-revert.md
Original file line number Diff line number Diff line change
@@ -18,9 +18,9 @@ function expectRevert(bytes calldata message) external;

If the **next call** does not revert with the expected data `message`, then `expectRevert` will.

After calling `expectRevert`, calls to other cheatcodes before the reverting call are ignored.
After calling `expectRevert`, calls to other cheatcodes before the reverting call are ignored. However, using other `expect` cheatcodes with `expectRevert` is forbidden and will cause the test to fail.

This means, for example, we can call [`prank`](./prank.md) immediately before the reverting call.
This means, for example, we can call [`prank`](./prank.md) immediately before the reverting call, but we cannot call [`expectEmit`](./expect-emit.md) immediately before the reverting call.

There are 3 signatures: