Open smol-ninja opened 6 days ago
since these tests would be the same for all getters we should generalize the test that can be applied to all of them
we already have expectRevert_Null
which can be used
we could also declare a function test_Getter(bytes memory callData, bytes memory expectedData);
```solidity function test_RevertGiven_Null() external { bytes memory callData = abi.encodeCall(flow.getSnapshotTime, (nullStreamId)); expectRevert_Null(callData); } function test_NotNull() external { bytes memory callData = abi.encodeCall(flow.getSnapshotTime, (defaultStreamId)); bytes memory returnData = abi.encode(getBlockTimestamp()); test_Getter(callData, returnData); } ```
That's a great idea @andreivladbrg.
Some of the getters in
SablierFlowBase
simply read and return storage values and so do not have their own concrete tests. As a consequence of which, we missed addingnotNull
toisTransferable
function. This was discovered during Cantina audit.To avoid similar errors in the future, we should concrete tests for those getters too.