From b5b1558ef375adde0892343e4caed0ad18b6a045 Mon Sep 17 00:00:00 2001 From: Narayan Prusty Date: Wed, 23 Aug 2023 13:30:21 +0100 Subject: [PATCH 1/2] fix: include reward token in event --- contracts/Comptroller.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/Comptroller.sol b/contracts/Comptroller.sol index 5a61268fd..89b1632cf 100644 --- a/contracts/Comptroller.sol +++ b/contracts/Comptroller.sol @@ -86,7 +86,7 @@ contract Comptroller is event NewSupplyCap(VToken indexed vToken, uint256 newSupplyCap); /// @notice Emitted when a rewards distributor is added - event NewRewardsDistributor(address indexed rewardsDistributor); + event NewRewardsDistributor(address indexed rewardsDistributor, address indexed rewardToken); /// @notice Emitted when a market is supported event MarketSupported(VToken vToken); @@ -977,7 +977,7 @@ contract Comptroller is _rewardsDistributor.initializeMarket(address(allMarkets[i])); } - emit NewRewardsDistributor(address(_rewardsDistributor)); + emit NewRewardsDistributor(address(_rewardsDistributor), address(_rewardsDistributor.rewardToken())); } /** From 83c1c3b5a52c383241373dce676bab4c3b9e3fb5 Mon Sep 17 00:00:00 2001 From: Narayan Prusty Date: Wed, 23 Aug 2023 18:01:16 +0100 Subject: [PATCH 2/2] fix: fixed tests --- tests/hardhat/Rewards.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hardhat/Rewards.ts b/tests/hardhat/Rewards.ts index a2a55118a..bf4e9b218 100644 --- a/tests/hardhat/Rewards.ts +++ b/tests/hardhat/Rewards.ts @@ -256,7 +256,7 @@ describe("Rewards: Tests", async function () { await expect(comptrollerProxy.addRewardsDistributor(rewardsDistributor.address)) .to.emit(comptrollerProxy, "NewRewardsDistributor") - .withArgs(rewardsDistributor.address); + .withArgs(rewardsDistributor.address, xvs.address); }); it("Emits event correctly", async () => { @@ -270,7 +270,7 @@ describe("Rewards: Tests", async function () { await expect(comptrollerProxy.addRewardsDistributor(rewardsDistributor.address)) .to.emit(comptrollerProxy, "NewRewardsDistributor") - .withArgs(rewardsDistributor.address); + .withArgs(rewardsDistributor.address, mockWBTC.address); }); it("Claim XVS", async () => {