feat: Emit events when setting executors/verifiers
This commit is contained in:
@@ -35,6 +35,8 @@ contract TychoRouter is
|
||||
event Withdrawal(
|
||||
address indexed token, uint256 amount, address indexed receiver
|
||||
);
|
||||
event ExecutorSet(address indexed executor);
|
||||
event CallbackVerifierSet(address indexed callbackVerifier);
|
||||
|
||||
constructor(address _permit2) {
|
||||
permit2 = IAllowanceTransfer(_permit2);
|
||||
@@ -91,6 +93,7 @@ contract TychoRouter is
|
||||
{
|
||||
if (target.code.length == 0) revert TychoRouter__NonContractExecutor();
|
||||
swapExecutors[target] = true;
|
||||
emit ExecutorSet(target);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,6 +117,7 @@ contract TychoRouter is
|
||||
{
|
||||
if (target.code.length == 0) revert TychoRouter__NonContractVerifier();
|
||||
callbackVerifiers[target] = true;
|
||||
emit CallbackVerifierSet(target);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,9 @@ contract TychoRouterTest is TychoRouterTestTemplate {
|
||||
bytes32 public constant FUND_RESCUER_ROLE =
|
||||
0x912e45d663a6f4cc1d0491d8f046e06c616f40352565ea1cdb86a0e1aaefa41b;
|
||||
|
||||
event ExecutorSet(address indexed executor);
|
||||
event CallbackVerifierSet(address indexed callbackVerifier);
|
||||
|
||||
function setupTychoRouter() public {
|
||||
deployTychoRouter();
|
||||
}
|
||||
@@ -23,6 +26,10 @@ contract TychoRouterTest is TychoRouterTestTemplate {
|
||||
deployDummyContract();
|
||||
|
||||
vm.startPrank(executorSetter);
|
||||
vm.expectEmit();
|
||||
// Define the event we expect to be emitted at the next step
|
||||
emit ExecutorSet(DUMMY);
|
||||
|
||||
tychoRouter.setSwapExecutor(DUMMY);
|
||||
vm.stopPrank();
|
||||
|
||||
@@ -82,6 +89,10 @@ contract TychoRouterTest is TychoRouterTestTemplate {
|
||||
deployDummyContract();
|
||||
|
||||
vm.startPrank(executorSetter);
|
||||
vm.expectEmit();
|
||||
// Define the event we expect to be emitted at the next step
|
||||
emit CallbackVerifierSet(DUMMY);
|
||||
|
||||
tychoRouter.setCallbackVerifier(DUMMY);
|
||||
vm.stopPrank();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user