Skip to content

Commit

Permalink
Add test for incorrect funds provided while minting
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmichalis committed Feb 14, 2024
1 parent ac00ea4 commit 722a0af
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/DynamicTokenURI.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,24 @@ contract DynamicTokenURITest is Test {
extension.mintBatch{value: mintCost}(address(token), 1);
}

function testCannotMintDueToIncorrectFunds() public {
vm.prank(alice);
vm.expectRevert("insufficient or too many funds");
extension.mint{value: mintCost - 1}(address(token));

vm.prank(alice);
vm.expectRevert("insufficient or too many funds");
extension.mint{value: mintCost + 1}(address(token));

vm.prank(alice);
vm.expectRevert("insufficient or too many funds");
extension.mintBatch{value: mintCost - 1}(address(token), 1);

vm.prank(alice);
vm.expectRevert("insufficient or too many funds");
extension.mintBatch{value: mintCost + 1}(address(token), 1);
}

function testSetTokenURIs() public {
// Alice mints a token
vm.prank(alice);
Expand Down

0 comments on commit 722a0af

Please sign in to comment.