From f6addb2ac7f8e2e27f72ae9394f65e206ae3c935 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 6 Aug 2023 02:36:05 -0300 Subject: [PATCH] I fix edge case testing transfers to null address. --- test/hooks/BeforeTokenTransfers.t.sol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/hooks/BeforeTokenTransfers.t.sol b/test/hooks/BeforeTokenTransfers.t.sol index a100a18..843428e 100644 --- a/test/hooks/BeforeTokenTransfers.t.sol +++ b/test/hooks/BeforeTokenTransfers.t.sol @@ -48,11 +48,12 @@ contract BeforeTokenTransfersHookTest is DSTest { uint256 startTokenId, uint256 quantity ) public { - vm.assume(quantity > 0); - vm.assume(startTokenId > 0); + _assumeGtZero(quantity); + _assumeGtZero(startTokenId); vm.assume(quantity < 10_000); vm.assume(quantity >= startTokenId); _assumeNotBurn(_firstOwner); + _assumeNotBurn(_secondOwner); // Mint some tokens first erc721Mock.mint(_firstOwner, quantity); @@ -67,6 +68,10 @@ contract BeforeTokenTransfersHookTest is DSTest { vm.assume(_wallet != address(0)); } + function _assumeGtZero(uint256 _num) internal pure { + vm.assume(_num > 0); + } + function _assertNormalTransfer( address _from, address _to,