Skip to content

Commit

Permalink
[ETHEREUM-CONTRACTS] don't claim as a side effect of updateMemberUnit…
Browse files Browse the repository at this point in the history
…s() (#1883)

* don't claim as a side effect of updateMemberUnits()

* less wrong

* fix surgery & adjust test
  • Loading branch information
d10r authored Mar 13, 2024
1 parent b67c96a commit 766630b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,7 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {

// update pool's disconnected units
if (!GDA.isMemberConnected(ISuperfluidPool(address(this)), memberAddr)) {
// trigger the side effect of claiming all if not connected
// @note claiming is a bit surprising here given the function name
int256 claimedAmount = _claimAll(memberAddr, time);

// update pool's disconnected units
_shiftDisconnectedUnits(wrappedUnits - mu.m.owned_units, Value.wrap(claimedAmount), t);
_shiftDisconnectedUnits(wrappedUnits - mu.m.owned_units, Value.wrap(0), t);
}

// update pool member's units
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1617,11 +1617,11 @@ contract FoundrySuperfluidTester is Test {

assertEq(pool_.getUnits(member_), newUnits_, "GDAv1.t: Members' units incorrectly set");

// Assert that pending balance is claimed if user is disconnected
// Assert that pending balance didn't change if user is disconnected
if (!isConnected) {
(int256 balanceAfter,,,) = poolSuperToken.realtimeBalanceOfNow(member_);
assertEq(
balanceAfter, balanceBefore + claimableBalance, "_helperUpdateMemberUnits: Pending balance not claimed"
balanceAfter, balanceBefore, "_helperUpdateMemberUnits: Pending balance changed"
);
}

Expand Down

0 comments on commit 766630b

Please sign in to comment.