Skip to content

Commit

Permalink
feat: readd getter for backwards compatibility (#129)
Browse files Browse the repository at this point in the history
* feat: readd getter for backwards compatibility

* Update contracts/rewards/interfaces/IRewardsDistributor.sol

Co-authored-by: miguelmtz <[email protected]>

* fix: readd test

Co-authored-by: miguelmtz <[email protected]>
  • Loading branch information
sakulstra and miguelmtzinf authored Nov 28, 2022
1 parent 1145916 commit 0202aab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/rewards/RewardsDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -540,4 +540,9 @@ abstract contract RewardsDistributor is IRewardsDistributor {
function getAssetDecimals(address asset) external view returns (uint8) {
return _assets[asset].decimals;
}

/// @inheritdoc IRewardsDistributor
function getEmissionManager() external view returns (address) {
return EMISSION_MANAGER;
}
}
7 changes: 7 additions & 0 deletions contracts/rewards/interfaces/IRewardsDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,11 @@ interface IRewardsDistributor {
* @return The address of the EmissionManager
*/
function EMISSION_MANAGER() external view returns (address);

/**
* @dev Returns the address of the emission manager.
* Deprecated: This getter is maintained for compatibility purposes. Use the `EMISSION_MANAGER()` function instead.
* @return The address of the EmissionManager
*/
function getEmissionManager() external view returns (address);
}
3 changes: 3 additions & 0 deletions test/rewards/misc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ makeSuite('RewardsController misc tests', (testEnv) => {
await expect((await rewardsController.EMISSION_MANAGER()).toString()).to.be.equal(
peiEmissionManager
);
await expect((await rewardsController.getEmissionManager()).toString()).to.be.equal(
peiEmissionManager
);
});

it('Should return same index while multiple asset index updates', async () => {
Expand Down

0 comments on commit 0202aab

Please sign in to comment.