Skip to content

Commit

Permalink
test: deploy dummy injector and register upkeep
Browse files Browse the repository at this point in the history
  • Loading branch information
gosuto-inzasheru committed Dec 2, 2024
1 parent 4eed574 commit fe6efd6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions foundry_test/BaseFixture.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,26 @@ contract BaseFixture is Test {
assert(factory.implementation() == address(injector));
}

function _deployDummyInjectorAndRegisterUpkeep() internal returns (address injectorDeployed_) {
KEEPER_ADDRESSES[0] = KEEPER;

// check: event emitted
vm.expectEmit(false, true, true, true); // @note topic0 is not checked
emit InjectorCreated(address(0), KEEPER_ADDRESSES, USDT, OWNER);

injectorDeployed_ =
factory.createInjector(KEEPER_ADDRESSES, MIN_WAIT_PERIOD_SECONDS, USDT, MAX_INJECTION_AMOUNT, OWNER, true);
}

function _deployDummyInjector() internal returns (address injectorDeployed_) {
KEEPER_ADDRESSES[0] = KEEPER;

// check: event emitted
vm.expectEmit(false, true, true, true); // @note topic0 is not checkeds
vm.expectEmit(false, true, true, true); // @note topic0 is not checked
emit InjectorCreated(address(0), KEEPER_ADDRESSES, USDT, OWNER);

injectorDeployed_ =
factory.createInjector(KEEPER_ADDRESSES, MIN_WAIT_PERIOD_SECONDS, USDT, MAX_INJECTION_AMOUNT, OWNER);
factory.createInjector(KEEPER_ADDRESSES, MIN_WAIT_PERIOD_SECONDS, USDT, MAX_INJECTION_AMOUNT, OWNER, false);
}

function _enableInjectorAsDistributor(address _injector) internal {
Expand Down

0 comments on commit fe6efd6

Please sign in to comment.