Skip to content

Commit

Permalink
feat(Vm): add new cheatcodes
Browse files Browse the repository at this point in the history
Includes:
- `getArtifactPathBy{,Deployed}Code`
- `parseTomlType`
- `expect{,Partial}Revert(..., address)`
- `skip(bool, string)`
- `random{Bool,Bytes,Int}`

I've also split the `interfaceId` test into two so that you can get both
values to update at once.
  • Loading branch information
DaniPopes committed Sep 26, 2024
1 parent 28724ea commit 4efc617
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 13 deletions.
68 changes: 61 additions & 7 deletions src/Vm.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions test/Vm.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ pragma solidity >=0.8.0 <0.9.0;
import {Test} from "../src/Test.sol";
import {Vm, VmSafe} from "../src/Vm.sol";

// These tests ensure that functions are never accidentally removed from a Vm interface, or
// inadvertently moved between Vm and VmSafe. This test must be updated each time a function is
// added to or removed from Vm or VmSafe.
contract VmTest is Test {
// This test ensures that functions are never accidentally removed from a Vm interface, or
// inadvertently moved between Vm and VmSafe. This test must be updated each time a function is
// added to or removed from Vm or VmSafe.
function test_interfaceId() public pure {
assertEq(type(VmSafe).interfaceId, bytes4(0x74d42398), "VmSafe");
assertEq(type(Vm).interfaceId, bytes4(0xaf15a283), "Vm");
function test_VmInterfaceId() public pure {
assertEq(type(Vm).interfaceId, bytes4(0xa561dbe8), "Vm");
}

function test_VmSafeInterfaceId() public pure {
assertEq(type(VmSafe).interfaceId, bytes4(0x681d10d4), "VmSafe");
}
}

0 comments on commit 4efc617

Please sign in to comment.