Skip to content

Commit

Permalink
test mint botched
Browse files Browse the repository at this point in the history
  • Loading branch information
Astodialo committed Nov 4, 2024
1 parent f97ce9f commit a59568b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/Bread.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,23 @@ contract BreadTest is Test {
assertGt(daiBefore, daiAfter);
assertGt(breadAfter, breadBefore);
assertEq(breadAfter, daiBefore - daiAfter);

// mint to another
uint256 daiBeforeAdmin = dai.balanceOf(admin);
uint256 breadBeforeAdmin = bread.balanceOf(admin);

vm.prank(admin);
dai.approve(address(bread), daiBeforeAdmin / 10);
bread.mint(daiBeforeAdmin / 10, signer);

uint256 daiAfterAdmin = dai.balanceOf(admin);
uint256 breadAfterAdmin = bread.balanceOf(admin);
uint256 breadFinal = bread.balanceOf(signer);

assertEq(breadBeforeAdmin, 0);
assertEq(breadBeforeAdmin, breadAfterAdmin);
assertGt(daiBeforeAdmin, daiAfterAdmin);
assertGt(breadFinal, breadAfter);
assertEq(breadFinal, breadAfter + (daiBeforeAdmin - daiAfterAdmin));
}
}

0 comments on commit a59568b

Please sign in to comment.