From d0d9d7f7b7746aea29a1bb300427b85a15e03923 Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Sun, 4 Aug 2024 21:55:34 -0400 Subject: [PATCH 1/2] eoa cant subscribe --- .../PositionManager.notifier.t.sol | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/position-managers/PositionManager.notifier.t.sol b/test/position-managers/PositionManager.notifier.t.sol index 06dd5d25..3f8c7024 100644 --- a/test/position-managers/PositionManager.notifier.t.sol +++ b/test/position-managers/PositionManager.notifier.t.sol @@ -292,6 +292,20 @@ contract PositionManagerNotifierTest is Test, PosmTestSetup, GasSnapshot { lpm.unsubscribe(tokenId, config, ZERO_BYTES); } + function test_subscribe_revertsOnEOA() public { + uint256 tokenId = lpm.nextTokenId(); + address subEOA = makeAddr("SUBSCRIBER"); + mint(config, 100e18, alice, ZERO_BYTES); + + // approve this contract to operate on alices liq + vm.startPrank(alice); + lpm.approve(address(this), tokenId); + vm.stopPrank(); + + vm.expectRevert(); + lpm.subscribe(tokenId, config, subEOA, ZERO_BYTES); + } + function test_subscribe_withData() public { uint256 tokenId = lpm.nextTokenId(); mint(config, 100e18, alice, ZERO_BYTES); From 9bbd3d0f9fa098a8a6645fa50e9c924fc363aa4e Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Wed, 4 Dec 2024 14:57:16 -0500 Subject: [PATCH 2/2] update test --- test/position-managers/PositionManager.notifier.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/position-managers/PositionManager.notifier.t.sol b/test/position-managers/PositionManager.notifier.t.sol index cab0d0a9..f3869989 100644 --- a/test/position-managers/PositionManager.notifier.t.sol +++ b/test/position-managers/PositionManager.notifier.t.sol @@ -503,7 +503,7 @@ contract PositionManagerNotifierTest is Test, PosmTestSetup, GasSnapshot { vm.stopPrank(); vm.expectRevert(); - lpm.subscribe(tokenId, config, subEOA, ZERO_BYTES); + lpm.subscribe(tokenId, subEOA, ZERO_BYTES); } function test_subscribe_withData() public {