From 0d502952a6c9674215df5fc62bf457bc5a544ab0 Mon Sep 17 00:00:00 2001 From: dd0sxx Date: Fri, 15 Dec 2023 00:21:55 -0500 Subject: [PATCH] comments and insert return fn --- src/lib/PeriodPctCheckpoints.sol | 6 ++---- src/lib/QuorumCheckpoints.sol | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib/PeriodPctCheckpoints.sol b/src/lib/PeriodPctCheckpoints.sol index 857c2fd..0f39fa7 100644 --- a/src/lib/PeriodPctCheckpoints.sol +++ b/src/lib/PeriodPctCheckpoints.sol @@ -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 @@ -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) { @@ -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); } } diff --git a/src/lib/QuorumCheckpoints.sol b/src/lib/QuorumCheckpoints.sol index a1ad1ad..10bc65e 100644 --- a/src/lib/QuorumCheckpoints.sol +++ b/src/lib/QuorumCheckpoints.sol @@ -123,7 +123,7 @@ library QuorumCheckpoints { uint48 timestamp, uint16 voteQuorumPct, uint16 vetoQuorumPct - ) private returns (uint16, uint16) { + ) private { uint256 pos = self.length; if (pos > 0) { @@ -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); } }