From 27b56c474b4d205e2505023adbb2dda62ccb76f0 Mon Sep 17 00:00:00 2001 From: David Meister Date: Sun, 14 Jun 2026 23:44:56 +0000 Subject: [PATCH] test V5 sentinel + min sentinels through IFlowV5 re-export IFlowV5.t.sol imported RAIN_FLOW_SENTINEL directly from IFlowV4.sol, so the V5 test never exercised the V5 re-export surface: a drift in the V5 re-export would pass silently. Import the constant from IFlowV5.sol and add a pin for the MIN_FLOW_SENTINELS re-export too, so a change at the V5 boundary fails this test. Closes #419 Co-Authored-By: Claude Opus 4.8 --- test/interface/IFlowV5.t.sol | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/interface/IFlowV5.t.sol b/test/interface/IFlowV5.t.sol index cce81911..c31b851a 100644 --- a/test/interface/IFlowV5.t.sol +++ b/test/interface/IFlowV5.t.sol @@ -4,13 +4,25 @@ pragma solidity =0.8.25; import {Test} from "forge-std/Test.sol"; -import {RAIN_FLOW_SENTINEL} from "../../src/interface/deprecated/v4/IFlowV4.sol"; +import {RAIN_FLOW_SENTINEL, MIN_FLOW_SENTINELS} from "../../src/interface/IFlowV5.sol"; import {Sentinel} from "rain.solmem/lib/LibStackSentinel.sol"; contract IFlowV5Test is Test { + /// `IFlowV5` re-exports `RAIN_FLOW_SENTINEL` from `IFlowV4`. This pins the + /// value through the V5 re-export surface so a change to the V5 re-export + /// (intentional or accidental) is caught here, not silently passed through + /// by importing the V4 constant directly. function testSentinelValue() external { assertEq( 0xfea74d0c9bf4a3c28f0dd0674db22a3d7f8bf259c56af19f4ac1e735b156974f, Sentinel.unwrap(RAIN_FLOW_SENTINEL) ); } + + /// `IFlowV5` also re-exports `MIN_FLOW_SENTINELS`. The three required + /// sentinels (ERC20, ERC721, ERC1155 sections) make this `3`. Pinning it + /// through the V5 interface guards the re-export the same way as the + /// sentinel value above. + function testMinFlowSentinelsValue() external { + assertEq(MIN_FLOW_SENTINELS, 3); + } }