From e9aec786370e07b5981928cc3071df72f4018ec1 Mon Sep 17 00:00:00 2001 From: Roderik van der Veer Date: Fri, 6 Sep 2024 21:40:48 +0200 Subject: [PATCH] feat: update dependencies --- lib/forge-std/src/StdChains.sol | 4 ++++ lib/forge-std/src/Vm.sol | 18 +++++++++++++++++- lib/forge-std/test/StdChains.t.sol | 2 ++ lib/forge-std/test/Vm.t.sol | 4 ++-- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/forge-std/src/StdChains.sol b/lib/forge-std/src/StdChains.sol index 0fe827e..9ca1b82 100644 --- a/lib/forge-std/src/StdChains.sol +++ b/lib/forge-std/src/StdChains.sol @@ -246,6 +246,10 @@ abstract contract StdChains { setChainWithDefaultRpcUrl( "berachain_bartio_testnet", ChainData("Berachain bArtio Testnet", 80084, "https://bartio.rpc.berachain.com") ); + setChainWithDefaultRpcUrl("flare", ChainData("Flare", 14, "https://flare-api.flare.network/ext/C/rpc")); + setChainWithDefaultRpcUrl( + "flare_coston2", ChainData("Flare Coston2", 114, "https://coston2-api.flare.network/ext/C/rpc") + ); } // set chain info, with priority to chainAlias' rpc url in foundry.toml diff --git a/lib/forge-std/src/Vm.sol b/lib/forge-std/src/Vm.sol index e8ad712..ec495aa 100644 --- a/lib/forge-std/src/Vm.sol +++ b/lib/forge-std/src/Vm.sol @@ -279,6 +279,9 @@ interface VmSafe { pure returns (uint256 privateKey); + /// Derives secp256r1 public key from the provided `privateKey`. + function publicKeyP256(uint256 privateKey) external pure returns (uint256 publicKeyX, uint256 publicKeyY); + /// Adds a private key to the local forge wallet and returns the address. function rememberKey(uint256 privateKey) external returns (address keyAddr); @@ -556,6 +559,9 @@ interface VmSafe { /// Record all the transaction logs. function recordLogs() external; + /// Reset gas metering (i.e. gas usage is set to gas limit). + function resetGasMetering() external; + /// Resumes gas metering (i.e. gas usage is counted again). Noop if already on. function resumeGasMetering() external; @@ -1549,6 +1555,10 @@ interface VmSafe { /// Labels an address in call traces. function label(address account, string calldata newLabel) external; + /// Pauses collection of call traces. Useful in cases when you want to skip tracing of + /// complex calls which are not useful for debugging. + function pauseTracing() external view; + /// Returns a random `address`. function randomAddress() external returns (address); @@ -1558,6 +1568,9 @@ interface VmSafe { /// Returns random uin256 value between the provided range (=min..=max). function randomUint(uint256 min, uint256 max) external returns (uint256); + /// Unpauses collection of call traces. + function resumeTracing() external view; + /// Encodes a `bytes` value to a base64url string. function toBase64URL(bytes calldata data) external pure returns (string memory); @@ -1855,10 +1868,13 @@ interface Vm is VmSafe { /// Same as the previous method, but also checks supplied address against emitting contract. function expectEmit(address emitter) external; + /// Expects an error on next call that starts with the revert data. + function expectPartialRevert(bytes4 revertData) external; + /// Expects an error on next call with any revert data. function expectRevert() external; - /// Expects an error on next call that starts with the revert data. + /// Expects an error on next call that exactly matches the revert data. function expectRevert(bytes4 revertData) external; /// Expects an error on next call that exactly matches the revert data. diff --git a/lib/forge-std/test/StdChains.t.sol b/lib/forge-std/test/StdChains.t.sol index 09059c2..783ba69 100644 --- a/lib/forge-std/test/StdChains.t.sol +++ b/lib/forge-std/test/StdChains.t.sol @@ -80,6 +80,8 @@ contract StdChainsTest is Test { // _testRpc("fraxtal"); // _testRpc("fraxtal_testnet"); // _testRpc("berachain_bartio_testnet"); + // _testRpc("flare"); + // _testRpc("flare_coston2"); // } function test_ChainNoDefault() public { diff --git a/lib/forge-std/test/Vm.t.sol b/lib/forge-std/test/Vm.t.sol index 46b6c8c..91cfceb 100644 --- a/lib/forge-std/test/Vm.t.sol +++ b/lib/forge-std/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(0x5c59cbde), "VmSafe"); - assertEq(type(Vm).interfaceId, bytes4(0x1316b43e), "Vm"); + assertEq(type(VmSafe).interfaceId, bytes4(0x9dd1a1c8), "VmSafe"); + assertEq(type(Vm).interfaceId, bytes4(0x02edefa2), "Vm"); } }