feat: Emit event when removing executor

- This is not so relevant for security, but it would sabotage our performance if an executor was wrongly removed, so it's worth it to know every time this happens.
This commit is contained in:
TAMARA LIPOWSKI
2025-01-24 11:45:24 -05:00
parent 5214710530
commit 1fabff19c4
3 changed files with 6 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ contract SwapExecutionDispatcherTest is Constants {
SwapExecutionDispatcherExposed dispatcherExposed;
event ExecutorSet(address indexed executor);
event ExecutorRemoved(address indexed executor);
function setUp() public {
uint256 forkBlock = 20673900;
@@ -52,6 +53,9 @@ contract SwapExecutionDispatcherTest is Constants {
function testRemoveExecutor() public {
dispatcherExposed.exposedSetSwapExecutor(DUMMY);
vm.expectEmit();
// Define the event we expect to be emitted at the next step
emit ExecutorRemoved(DUMMY);
dispatcherExposed.exposedRemoveSwapExecutor(DUMMY);
assert(dispatcherExposed.swapExecutors(DUMMY) == false);
}

View File

@@ -14,7 +14,6 @@ contract TychoRouterTest is TychoRouterTestSetup {
bytes32 public constant FUND_RESCUER_ROLE =
0x912e45d663a6f4cc1d0491d8f046e06c616f40352565ea1cdb86a0e1aaefa41b;
event ExecutorSet(address indexed executor);
event CallbackVerifierSet(address indexed callbackVerifier);
event Withdrawal(
address indexed token, uint256 amount, address indexed receiver