Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
comments and insert return fn
Browse files Browse the repository at this point in the history
  • Loading branch information
dd0sxx committed Dec 15, 2023
1 parent 4eaf6a1 commit 0d50295
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/lib/PeriodPctCheckpoints.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {LlamaUtils} from "src/lib/LlamaUtils.sol";
* @dev This library defines the `History` struct, for checkpointing values as they change at different points in
* time, and later looking up past values by block timestamp.
*
* To create a history of checkpoints define a variable type `PolicyholderCheckpoints.History` in your contract, and store a new
* To create a history of checkpoints define a variable type `PeriodPctCheckpoints.History` in your contract, and store a new
* checkpoint for the current transaction timestamp using the {push} function.
*
* @dev This was created by modifying then running the OpenZeppelin `Checkpoints.js` script, which generated a version
Expand Down Expand Up @@ -126,7 +126,7 @@ library PeriodPctCheckpoints {
uint16 delayPeriodPct,
uint16 castingPeriodPct,
uint16 submissionPeriodPct
) private returns (uint16, uint16, uint16) {
) private {
uint256 pos = self.length;

if (pos > 0) {
Expand All @@ -145,10 +145,8 @@ library PeriodPctCheckpoints {
} else {
self.push(Checkpoint({timestamp: timestamp, delayPeriodPct: delayPeriodPct, castingPeriodPct: castingPeriodPct, submissionPeriodPct: submissionPeriodPct}));
}
return (delayPeriodPct, castingPeriodPct, submissionPeriodPct);
} else {
self.push(Checkpoint({timestamp: timestamp, delayPeriodPct: delayPeriodPct, castingPeriodPct: castingPeriodPct, submissionPeriodPct: submissionPeriodPct}));
return (delayPeriodPct, castingPeriodPct, submissionPeriodPct);
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/lib/QuorumCheckpoints.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ library QuorumCheckpoints {
uint48 timestamp,
uint16 voteQuorumPct,
uint16 vetoQuorumPct
) private returns (uint16, uint16) {
) private {
uint256 pos = self.length;

if (pos > 0) {
Expand All @@ -141,10 +141,8 @@ library QuorumCheckpoints {
} else {
self.push(Checkpoint({timestamp: timestamp, voteQuorumPct: voteQuorumPct, vetoQuorumPct: vetoQuorumPct}));
}
return (last.vetoQuorumPct, vetoQuorumPct);
} else {
self.push(Checkpoint({timestamp: timestamp, voteQuorumPct: voteQuorumPct, vetoQuorumPct: vetoQuorumPct}));
return (0, vetoQuorumPct);
}
}

Expand Down

0 comments on commit 0d50295

Please sign in to comment.