From b52a00082d1c7639a822147a1e780aa50269c86d Mon Sep 17 00:00:00 2001 From: DhairyaSethi <55102840+DhairyaSethi@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:52:56 +0530 Subject: [PATCH 1/2] feat(cheatcode): promptSecretUint --- src/Vm.sol | 3 +++ test/Vm.t.sol | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Vm.sol b/src/Vm.sol index 6b1f2913..db9c52df 100644 --- a/src/Vm.sol +++ b/src/Vm.sol @@ -555,6 +555,9 @@ interface VmSafe { /// Prompts the user for a hidden string value in the terminal. function promptSecret(string calldata promptText) external returns (string memory input); + /// Prompts the user for hidden uint256 in the terminal (usually pk). + function promptSecretUint(string calldata promptText) external returns (uint256); + /// Prompts the user for uint256 in the terminal. function promptUint(string calldata promptText) external returns (uint256); diff --git a/test/Vm.t.sol b/test/Vm.t.sol index 64242122..6f380ed0 100644 --- a/test/Vm.t.sol +++ b/test/Vm.t.sol @@ -9,7 +9,7 @@ contract VmTest is Test { // 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(0x536a6b28), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0x1c17c241), "VmSafe"); assertEq(type(Vm).interfaceId, bytes4(0xb91a22ba), "Vm"); } } From 1a678dd305da26000335d59fae172bcc148afdb8 Mon Sep 17 00:00:00 2001 From: DhairyaSethi <55102840+DhairyaSethi@users.noreply.github.com> Date: Sat, 8 Jun 2024 13:43:13 +0530 Subject: [PATCH 2/2] fix: vmSafe.interfaceId --- test/Vm.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Vm.t.sol b/test/Vm.t.sol index 6f380ed0..a1c4ed67 100644 --- a/test/Vm.t.sol +++ b/test/Vm.t.sol @@ -9,7 +9,7 @@ contract VmTest is Test { // 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(0x1c17c241), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0x3aa0699f), "VmSafe"); assertEq(type(Vm).interfaceId, bytes4(0xb91a22ba), "Vm"); } }