Simplify ERC721Wrapper.depositFor to save gas (#4048)

This commit is contained in:
Hadrien Croubois
2023-02-17 03:35:43 +01:00
committed by GitHub
parent 5e76b26225
commit d5d9d4bd3d
2 changed files with 12 additions and 45 deletions

View File

@ -242,39 +242,7 @@ contract('ERC721Wrapper', function (accounts) {
);
});
describe('when data length is > 0', function () {
it('reverts with arbitrary data', async function () {
await expectRevert(
this.underlying.methods['safeTransferFrom(address,address,uint256,bytes)'](
initialHolder,
this.token.address,
firstTokenId,
'0x0123',
{
from: initialHolder,
},
),
'ERC721Wrapper: Invalid data format',
);
});
it('reverts with correct data from an untrusted operator', async function () {
await expectRevert(
this.underlying.methods['safeTransferFrom(address,address,uint256,bytes)'](
initialHolder,
this.token.address,
firstTokenId,
anotherAccount,
{
from: initialHolder,
},
),
'ERC721Wrapper: Invalid data format',
);
});
});
it('mints a token to from if no data is specified', async function () {
it('mints a token to from', async function () {
const { tx } = await this.underlying.safeTransferFrom(initialHolder, this.token.address, firstTokenId, {
from: initialHolder,
});