Skip to content

Commit

Permalink
Add getter for gauge types in stakeless gauge checkpointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Ignacio Ubeira committed Aug 1, 2023
1 parent ea262dc commit b602ca0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/interfaces/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- Moved `GaugeType` from `IGaugeAdder` to `IL2GaugeCheckpointer`, and adjusted types to accept new networks.
- Refactored `IL2GaugeCheckpointer` to `StakelessGaugeCheckpointer`.
- Removed `isSupportedGaugeType` from interface.
- Added `getRoundedDownBlockTimestamp` to interface.
- Added `getRoundedDownBlockTimestamp` and `getGaugeTypes` to interface.
- Bumped minimum compiler version from `0.7.0` to `0.7.1` in `BalancerErrors`.
- `IVersion` moved from `pool-utils` to `solidity-utils`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ interface IStakelessGaugeCheckpointer {
*/
function getGaugeAdder() external view returns (IGaugeAdder);

/**
* @notice Returns gauge types available in the checkpointer.
*/
function getGaugeTypes() external view returns (string[] memory);

/**
* @notice Adds an array of gauges from the given type. This is a permissioned function.
* @dev Gauges added will be considered when performing checkpoints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ contract StakelessGaugeCheckpointer is IStakelessGaugeCheckpointer, ReentrancyGu
return _gaugeAdder;
}

/// @inheritdoc IStakelessGaugeCheckpointer
function getGaugeTypes() external view override returns (string[] memory) {
return _gaugeAdder.getGaugeTypes();
}

/// @inheritdoc IStakelessGaugeCheckpointer
function addGaugesWithVerifiedType(string memory gaugeType, IStakelessGauge[] calldata gauges)
external
Expand Down
5 changes: 5 additions & 0 deletions pkg/liquidity-mining/test/StakelessGaugeCheckpointer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ describe('StakelessGaugeCheckpointer', () => {
(await currentWeekTimestamp()).sub(WEEK)
);
});

it('returns gauge types', async () => {
const gaugeTypesInAdder = await gaugeAdder.getGaugeTypes();
expect(await stakelessGaugeCheckpointer.getGaugeTypes()).to.be.deep.eq(gaugeTypesInAdder);
});
});

GAUGE_TYPES.forEach((gaugeType) => {
Expand Down

0 comments on commit b602ca0

Please sign in to comment.