Skip to content

Commit 6093a2c

Browse files
committed
feat(10027-cheatcode-mutability-tags): getrecordedlogs and getwallets are external view
1 parent 4ce6d1a commit 6093a2c

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

crates/cheatcodes/assets/cheatcodes.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cheatcodes/spec/src/vm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ interface Vm {
914914

915915
/// Gets all the recorded logs.
916916
#[cheatcode(group = Evm, safety = Safe)]
917-
function getRecordedLogs() external returns (Log[] memory logs);
917+
function getRecordedLogs() external view returns (Log[] memory logs);
918918

919919
// -------- Gas Metering --------
920920

@@ -2249,7 +2249,7 @@ interface Vm {
22492249

22502250
/// Returns addresses of available unlocked wallets in the script environment.
22512251
#[cheatcode(group = Scripting)]
2252-
function getWallets() external returns (address[] memory wallets);
2252+
function getWallets() external view returns (address[] memory wallets);
22532253

22542254
// ======== Utilities ========
22552255

crates/forge/tests/cli/script.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,7 @@ forgetest_init!(can_get_script_wallets, |prj, cmd| {
22592259
import "forge-std/Script.sol";
22602260
22612261
interface Vm {
2262-
function getWallets() external returns (address[] memory wallets);
2262+
function getWallets() external view returns (address[] memory wallets);
22632263
}
22642264
22652265
contract WalletScript is Script {
@@ -2575,14 +2575,14 @@ Chain 31337
25752575
25762576
accessList []
25772577
chainId 31337
2578-
gasLimit 228231
2578+
gasLimit 228247
25792579
gasPrice
25802580
input [..]
2581-
maxFeePerBlobGas
2582-
maxFeePerGas
2583-
maxPriorityFeePerGas
2581+
maxFeePerBlobGas
2582+
maxFeePerGas
2583+
maxPriorityFeePerGas
25842584
nonce 0
2585-
to
2585+
to
25862586
type 0
25872587
value 0
25882588
@@ -2591,11 +2591,11 @@ value 0
25912591
accessList []
25922592
chainId 31337
25932593
gasLimit 93856
2594-
gasPrice
2594+
gasPrice
25952595
input 0x7357f5d2000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000000000000000000000000000000000000000001c8
2596-
maxFeePerBlobGas
2597-
maxFeePerGas
2598-
maxPriorityFeePerGas
2596+
maxFeePerBlobGas
2597+
maxFeePerGas
2598+
maxPriorityFeePerGas
25992599
nonce 1
26002600
to 0x5FbDB2315678afecb367f032d93F642f64180aa3
26012601
type 0

docs/dev/cheatcode-mutability-review.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ Mark `view`:
4747
- [x] `getMappingLength`: `getMappingLength(address,bytes32)` _suggested: `view`_
4848
- [x] `getMappingSlotAt`: `getMappingSlotAt(address,bytes32,uint256)` _suggested: `view`_
4949
- [ ] `getNonce_1`: `getNonce(address,uint256,uint256,uint256)`
50-
- [ ] `getRecordedLogs`: `getRecordedLogs()`
51-
- [ ] `getWallets`: `getWallets()`
50+
- [x] `getRecordedLogs`: `getRecordedLogs()` _suggested: `view`_
51+
- [x] `getWallets`: `getWallets()` _suggested: `view`_
5252
- [x] `noAccessList`: `noAccessList()` _suggested: `view`_
5353
- [x] `readCallers`: `readCallers()` _suggested: `view`_
5454

0 commit comments

Comments
 (0)