Skip to content

Commit

Permalink
checks unhappy auth for poi mints
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Adolf <[email protected]>
  • Loading branch information
elmariachi111 committed Nov 26, 2024
1 parent a1e6173 commit cf62367
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/IPNFT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ contract IPNFTTest is IPNFTMintHelper {

vm.startPrank(deployer);
ipnft.setAuthorizer(new SignedMintAuthorizer(deployer));
vm.stopPrank();

vm.startPrank(alice);

(uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPk, authMessageHash);
bytes memory authorization = abi.encodePacked(r, s, v);

vm.startPrank(alice);
vm.expectRevert(IPNFT.Unauthorized.selector);
ipnft.mintReservation{ value: MINTING_FEE }(alice, tokenId, ipfsUri, DEFAULT_SYMBOL, bytes("abcde"));

vm.expectEmit(true, true, false, true);
emit IPNFTMinted(alice, tokenId, ipfsUri, DEFAULT_SYMBOL);
ipnft.mintReservation{ value: MINTING_FEE }(alice, tokenId, ipfsUri, DEFAULT_SYMBOL, authorization);
Expand Down

0 comments on commit cf62367

Please sign in to comment.