Change behavior of ceilDiv(0, 0) and improve test coverage (#4348)

This commit is contained in:
Ernesto García
2023-06-14 14:21:42 -06:00
committed by GitHub
parent ac5480e7ca
commit 2477534260
10 changed files with 178 additions and 2 deletions

View File

@ -479,6 +479,14 @@ function shouldBehaveLikeERC1155([minter, firstTokenHolder, secondTokenHolder, m
);
});
it('reverts when transferring from zero address', async function () {
await expectRevertCustomError(
this.token.$_safeBatchTransferFrom(ZERO_ADDRESS, multiTokenHolder, [firstTokenId], [firstAmount], '0x'),
'ERC1155InvalidSender',
[ZERO_ADDRESS],
);
});
function batchTransferWasSuccessful({ operator, from, ids, values }) {
it('debits transferred balances from sender', async function () {
const newBalances = await this.token.balanceOfBatch(new Array(ids.length).fill(from), ids);