Skip to content

Commit d4461df

Browse files
authored
docs: fix Cheatcode trait methods count in documentation (#12277)
Clarify methods in `Cheatcode` trait documentation Updated the documentation for the `Cheatcode` trait to include a new method and clarify usage.
1 parent 11165b2 commit d4461df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/dev/cheatcodes.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,13 @@ Multiple attributes can be specified by separating them with commas, e.g. `#[che
128128
### `Cheatcode` trait
129129

130130
This trait defines the interface that all cheatcode implementations must implement.
131-
There are two methods that can be implemented:
131+
There are three methods that can be implemented:
132132

133-
- `apply`: implemented when the cheatcode is pure and does not need to access EVM data
134-
- `apply_stateful`: implemented when the cheatcode needs to access EVM data
135-
- `apply_full`: implemented when the cheatcode needs to access EVM data and the EVM executor itself, for example to recursively call back into the EVM to execute an arbitrary transaction
133+
| Method | Purpose | When to use |
134+
|--------|---------|-------------|
135+
| `apply` | Pure cheatcodes that don't need EVM data access | For simple state manipulations |
136+
| `apply_stateful` | Cheatcodes that need EVM data access | For operations requiring current EVM state |
137+
| `apply_full` | Cheatcodes that need EVM executor access | For operations requiring recursive EVM calls |
136138

137139
Only one of these methods can be implemented.
138140

0 commit comments

Comments
 (0)