@@ -508,8 +508,17 @@ contract Governance is IGovernance {
508508
509509 /**
510510 * @notice Get the power of an address at a given timestamp.
511- * @dev If the timestamp is the current block timestamp, we return the powerNow.
512- * Otherwise, we return the powerAt the timestamp.
511+ *
512+ * @param _owner The address to get the power of.
513+ * @param _ts The timestamp to get the power at.
514+ * @return The power of the address at the given timestamp.
515+ */
516+ function powerAt (address _owner , Timestamp _ts ) external view override (IGovernance) returns (uint256 ) {
517+ return users[_owner].valueAt (_ts);
518+ }
519+
520+ /**
521+ * @notice Get the power of an address at the current block timestamp.
513522 *
514523 * Note that `powerNow` with the current block timestamp is NOT STABLE.
515524 *
@@ -522,35 +531,32 @@ contract Governance is IGovernance {
522531 * The powerNow at 4 will be different from the powerNow at 2.
523532 *
524533 * @param _owner The address to get the power of.
525- * @param _ts The timestamp to get the power at.
526- * @return The power of the address at the given timestamp.
534+ * @return The power of the address at the current block timestamp.
527535 */
528- function powerAt (address _owner , Timestamp _ts ) external view override (IGovernance) returns (uint256 ) {
529- if (_ts == Timestamp.wrap (block .timestamp )) {
530- return users[_owner].valueNow ();
531- }
532- return users[_owner].valueAt (_ts);
536+ function powerNow (address _owner ) external view override (IGovernance) returns (uint256 ) {
537+ return users[_owner].valueNow ();
533538 }
534539
535540 /**
536541 * @notice Get the total power in Governance at a given timestamp.
537- * @dev If the timestamp is the current block timestamp, we return the powerNow.
538- * Otherwise, we return the powerAt the timestamp.
539- *
540- * Note that `powerNow` with the current block timestamp is NOT STABLE.
541- *
542- * See `powerAt` for more details.
543542 *
544543 * @param _ts The timestamp to get the power at.
545544 * @return The total power at the given timestamp.
546545 */
547546 function totalPowerAt (Timestamp _ts ) external view override (IGovernance) returns (uint256 ) {
548- if (_ts == Timestamp.wrap (block .timestamp )) {
549- return total.valueNow ();
550- }
551547 return total.valueAt (_ts);
552548 }
553549
550+ /**
551+ * @notice Get the total power in Governance at the current block timestamp.
552+ * Note that `powerNow` with the current block timestamp is NOT STABLE.
553+ *
554+ * @return The total power at the current block timestamp.
555+ */
556+ function totalPowerNow () external view override (IGovernance) returns (uint256 ) {
557+ return total.valueNow ();
558+ }
559+
554560 /**
555561 * @notice Check if an address is permitted to hold power in Governance.
556562 *
0 commit comments