Skip to content

Commit 9b4da71

Browse files
committed
fix tests
1 parent cdf0482 commit 9b4da71

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
* `expectRevert` expects a revert in the next call.
4848
* If a revert is triggered by library code itself (vs by a call), `expectRevert` will thus not _see_ that.
4949
* Possible mitigations:
50+
* - if available, use an overloaded variant which allows to explicitly specify the sender
5051
* - avoid higher-level library methods which can themselves trigger reverts in tests where this is an issue
5152
* - wrap the method invocation into an external helper method which you then invoke with `this.helperMethod()`,
5253
* which makes it an external call
@@ -1462,6 +1463,9 @@ library SuperTokenV1Library {
14621463
* @param pool The Superfluid Pool address.
14631464
* @param requestedAmount The amount of tokens to distribute.
14641465
* @return actualAmount The amount actually distributed, which is equal or smaller than `requestedAmount`
1466+
* NOTE: in foundry tests, you may unexpectedly get `GDA_DISTRIBUTE_FOR_OTHERS_NOT_ALLOWED` reverts
1467+
* because of the use of `address(this)` as the `from` argument. You can work around this by using
1468+
* `distribute(token, from, pool, requestedAmount)` instead.
14651469
*/
14661470
function distribute(ISuperToken token, ISuperfluidPool pool, uint256 requestedAmount)
14671471
internal
@@ -1517,6 +1521,9 @@ library SuperTokenV1Library {
15171521
* @param requestedFlowRate The flow rate of tokens to distribute.
15181522
* @return actualFlowRate The flowrate actually set, which is equal or smaller than `requestedFlowRate`,
15191523
* depending on pool state - see IGeneralDistributionAgreement.estimateFlowDistributionActualFlowRate().
1524+
* NOTE: in foundry tests, you may unexpectedly get `GDA_DISTRIBUTE_FOR_OTHERS_NOT_ALLOWED` reverts
1525+
* because of the use of `address(this)` as the `from` argument. You can work around this by using
1526+
* `distributeFlow(token, from, pool, requestedFlowRate)` instead.
15201527
*/
15211528
function distributeFlow(ISuperToken token, ISuperfluidPool pool, int96 requestedFlowRate)
15221529
internal

packages/ethereum-contracts/contracts/interfaces/agreements/gdav1/IGeneralDistributionAgreementV1.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ abstract contract IGeneralDistributionAgreementV1 is ISuperAgreement {
226226
virtual
227227
returns (bool success, bytes memory newCtx);
228228

229-
/// @notice Lets accounts deny or allow 3rd parties to connect them to pools. The default is to allow.
229+
/// @notice Allows accounts to control whether third parties can connect them to pools. By default, they can.
230230
/// @param allow true to allow (only has an effect if it was previously denied), false to deny
231231
function setConnectPermission(bool allow) external virtual;
232232

packages/ethereum-contracts/test/foundry/FoundrySuperfluidTester.t.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ contract FoundrySuperfluidTester is Test {
128128
address internal constant ivan = address(0x429);
129129
address[] internal TEST_ACCOUNTS = [admin, alice, bob, carol, dan, eve, frank, grace, heidi, ivan];
130130

131+
address internal constant MAX_TESTER_ADDRESS = address(0x4ff);
132+
131133
/// @dev Other account addresses added that aren't testers (pools, super apps, smart contracts)
132134
EnumerableSet.AddressSet internal OTHER_ACCOUNTS;
133135

packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste
950950
) public {
951951
vm.assume(member != address(0));
952952
vm.assume(member != address(freePool));
953+
vm.assume(member != alice); // alice is the test distributor
953954
vm.assume(units > 0);
954955
vm.assume(distributionAmount > 0);
955956
vm.assume(units < distributionAmount);
@@ -992,6 +993,7 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste
992993
function testAutoConnect(address member, uint128 units, uint64 distributionAmount) public {
993994
vm.assume(member != address(0));
994995
vm.assume(member != address(freePool));
996+
vm.assume(member != alice); // alice is the test distributor
995997
vm.assume(units > 0);
996998
vm.assume(units < distributionAmount);
997999

0 commit comments

Comments
 (0)