Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 996dc89

Browse files
committed
Emit event when whitelist changed
1 parent d2a1ef9 commit 996dc89

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

contracts/handlers/FeeHandlerRouter.sol

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ contract FeeHandlerRouter is IFeeHandler, AccessControl {
1818
// whitelisted address => is whitelisted
1919
mapping(address => bool) public _whitelist;
2020

21-
event FeeChanged(
22-
uint256 newFee
21+
event WhitelistChanged(
22+
address whitelistAddress,
23+
bool isWhitelisted
2324
);
2425

2526
error IncorrectFeeSupplied(uint256);
@@ -66,6 +67,8 @@ contract FeeHandlerRouter is IFeeHandler, AccessControl {
6667
*/
6768
function adminSetWhitelist(address whitelistAddress, bool isWhitelisted) external onlyAdmin {
6869
_whitelist[whitelistAddress] = isWhitelisted;
70+
71+
emit WhitelistChanged(whitelistAddress, isWhitelisted);
6972
}
7073

7174

test/feeRouter/feeRouter.js

Whitespace-only changes.

test/handlers/fee/handlerRouter.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ contract("FeeHandlerRouter", async (accounts) => {
9494
false
9595
);
9696

97-
await FeeHandlerRouterInstance.adminSetWhitelist(
97+
const whitelistTx = await FeeHandlerRouterInstance.adminSetWhitelist(
9898
whitelistAddress,
9999
true
100100
);
@@ -104,6 +104,12 @@ contract("FeeHandlerRouter", async (accounts) => {
104104
),
105105
true
106106
);
107+
TruffleAssert.eventEmitted(whitelistTx, "WhitelistChanged", (event) => {
108+
return (
109+
event.whitelistAddress === whitelistAddress &&
110+
event.isWhitelisted === true
111+
);
112+
});
107113
});
108114

109115
it("should require admin role to set whitelist address", async () => {

0 commit comments

Comments
 (0)