Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jun1on committed Aug 2, 2024
1 parent 8d99c45 commit b230ee2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
6 changes: 3 additions & 3 deletions src/middleware/BaseMiddlewareFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ abstract contract BaseMiddlewareFactory {

mapping(address => address) private _implementations;

IPoolManager public immutable manager;
IPoolManager public immutable poolManager;

constructor(IPoolManager _manager) {
manager = _manager;
constructor(IPoolManager _poolManager) {
poolManager = _poolManager;
}

function getImplementation(address middleware) external view returns (address implementation) {
Expand Down
31 changes: 0 additions & 31 deletions test/BaseMiddlewareFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,41 +70,10 @@ contract BaseMiddlewareFactoryTest is Test, Deployers {
// second deployment should revert
vm.expectRevert(ZERO_BYTES);
factory.createMiddleware(address(hookscounter), salt);
<<<<<<< HEAD
}

function testRevertOnIncorrectCaller() public {
vm.expectRevert(SafeCallback.NotPoolManager.selector);
=======
}

function testRevertOnIncorrectFlags() public {
HooksCounter hookscounter2 = HooksCounter(address(HOOKSCOUNTER_FLAGS));
vm.etch(address(hookscounter), address(new HooksCounter(manager)).code);
uint160 incorrectFlags = uint160(Hooks.BEFORE_INITIALIZE_FLAG);

(address hookAddress, bytes32 salt) = HookMiner.find(
address(factory),
incorrectFlags,
type(BaseMiddlewareImplementation).creationCode,
abi.encode(address(manager), address(hookscounter2))
);
address implementation = address(hookscounter2);
vm.expectRevert(BaseMiddleware.FlagsMismatch.selector);
factory.createMiddleware(implementation, salt);
}

function testRevertOnIncorrectFlagsMined() public {
HooksCounter hookscounter2 = HooksCounter(address(HOOKSCOUNTER_FLAGS));
vm.etch(address(hookscounter), address(new HooksCounter(manager)).code);
address implementation = address(hookscounter2);
vm.expectRevert(BaseMiddleware.FlagsMismatch.selector);
factory.createMiddleware(implementation, bytes32("who needs to mine a salt?"));
}

function testRevertOnIncorrectCaller() public {
vm.expectRevert(SafeCallback.NotManager.selector);
>>>>>>> origin/base-middleware
hookscounter.afterDonate(address(this), key, 0, 0, ZERO_BYTES);
}

Expand Down

0 comments on commit b230ee2

Please sign in to comment.