Skip to content

Commit

Permalink
Migrate functionality from setProtocolFeeController to testPoolManage…
Browse files Browse the repository at this point in the history
…rFeeControllerSet (#354)

* finish porting functionality from setProtocolFeeController

* specify emitting contract in expect statement
  • Loading branch information
smatthewenglish authored Sep 11, 2023
1 parent e112589 commit bc94eb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 0 additions & 11 deletions test/PoolManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,6 @@ describe('PoolManager', () => {
expect(((await waffle.provider.getCode(manager.address)).length - 2) / 2).to.matchSnapshot()
})

describe('#setProtocolFeeController', () => {
it('allows the owner to set a fee controller', async () => {
expect(await manager.protocolFeeController()).to.be.eq(ADDRESS_ZERO)
await expect(manager.setProtocolFeeController(feeControllerTest.address)).to.emit(
manager,
'ProtocolFeeControllerUpdated'
)
expect(await manager.protocolFeeController()).to.be.eq(feeControllerTest.address)
})
})

describe('#take', () => {
it('fails if no liquidity', async () => {
await tokens.currency0.connect(wallet).transfer(ADDRESS_ZERO, constants.MaxUint256.div(2))
Expand Down
3 changes: 3 additions & 0 deletions test/foundry-tests/PoolManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155
using CurrencyLibrary for Currency;

event LockAcquired();
event ProtocolFeeControllerUpdated(address protocolFeeController);
event Initialize(
PoolId indexed poolId,
Currency indexed currency0,
Expand Down Expand Up @@ -340,6 +341,8 @@ contract PoolManagerTest is Test, Deployers, TokenFixture, GasSnapshot, IERC1155

function testPoolManagerFeeControllerSet() public {
assertEq(address(manager.protocolFeeController()), address(0));
vm.expectEmit(false, false, false, true, address(manager));
emit ProtocolFeeControllerUpdated(address(protocolFeeController));
manager.setProtocolFeeController(protocolFeeController);
assertEq(address(manager.protocolFeeController()), address(protocolFeeController));
}
Expand Down

0 comments on commit bc94eb0

Please sign in to comment.