Skip to content

Commit 8de392f

Browse files
committed
Clean up the mess left by forge fmt
1 parent f439da1 commit 8de392f

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

test/FlexVotingDelegatable.t.sol

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,25 +148,22 @@ abstract contract Delegation is FlexVotingClientTest {
148148
vm.assume(_delegatorC.addr != _delegate.addr);
149149
vm.assume(_delegatorD.addr != _delegate.addr);
150150

151-
_delegatorA.weight = uint208(bound(_delegatorA.weight, 1, MAX_VOTES - 4));
152-
_delegatorB.weight = uint208(bound(_delegatorB.weight, 1, MAX_VOTES - _delegatorA.weight - 3));
153-
_delegatorC.weight =
154-
uint208(bound(_delegatorC.weight, 1, MAX_VOTES - _delegatorA.weight - _delegatorB.weight - 2));
155-
_delegatorD.weight = uint208(
156-
bound(
157-
_delegatorD.weight,
158-
1,
159-
MAX_VOTES - _delegatorA.weight - _delegatorB.weight - _delegatorC.weight - 1
160-
)
161-
);
162-
_delegate.weight = uint208(
163-
bound(
164-
_delegate.weight,
165-
1,
166-
MAX_VOTES - _delegatorA.weight - _delegatorB.weight - _delegatorC.weight
167-
- _delegatorD.weight
168-
)
169-
);
151+
vm.label(_delegatorA.addr, "delegatorA");
152+
vm.label(_delegatorB.addr, "delegatorB");
153+
vm.label(_delegatorC.addr, "delegatorC");
154+
vm.label(_delegatorD.addr, "delegatorD");
155+
vm.label(_delegate.addr, "delegate");
156+
157+
uint256 _remaining = uint256(MAX_VOTES) - 4;
158+
_delegatorA.weight = uint208(bound(_delegatorA.weight, 1, _remaining));
159+
_remaining -= _delegatorA.weight - 1;
160+
_delegatorB.weight = uint208(bound(_delegatorB.weight, 1, _remaining));
161+
_remaining -= _delegatorB.weight - 1;
162+
_delegatorC.weight = uint208(bound(_delegatorC.weight, 1, _remaining));
163+
_remaining -= _delegatorC.weight - 1;
164+
_delegatorD.weight = uint208(bound(_delegatorD.weight, 1, _remaining));
165+
_remaining -= _delegatorD.weight - 1;
166+
_delegate.weight = uint208(bound(_delegate.weight, 1, _remaining));
170167

171168
GCS.VoteType _voteType = _randVoteType(_supportType);
172169

0 commit comments

Comments
 (0)