Skip to content

eoa cant subscribe #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/position-managers/PositionManager.notifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,20 @@ contract PositionManagerNotifierTest is Test, PosmTestSetup {
lpm.unsubscribe(tokenId);
}

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);
IERC721(address(lpm)).approve(address(this), tokenId);
vm.stopPrank();

vm.expectRevert();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to vm.expectRevert(INotifier.NoCodeSubscriber.selector); ?

lpm.subscribe(tokenId, subEOA, ZERO_BYTES);
}

function test_subscribe_withData() public {
uint256 tokenId = lpm.nextTokenId();
mint(config, 100e18, alice, ZERO_BYTES);
Expand Down
Loading