Skip to content

Commit

Permalink
feat: tests for burn
Browse files Browse the repository at this point in the history
  • Loading branch information
capedcrusader21 committed Apr 23, 2024
1 parent 2ffedde commit 71d848b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/land/test/common/ERC721.behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,37 @@ export function shouldCheckForERC721(setupLand, Contract: string) {
.to.emit(LandAsOther, 'Transfer')
.withArgs(other, ZeroAddress, 0);
});

it('should approve operator with approvalForAll to burn quad', async function () {
const {
LandContract,
LandAsAdmin,
LandAsMinter,
LandAsOther,
LandAsOther1,
deployer,
other,
other1,
} = await loadFixture(setupLand);

await LandAsMinter.mintQuad(other, 1, 0, 0, '0x');
await LandAsAdmin.setSuperOperator(deployer, true);
await LandContract.setApprovalForAllFor(other, other1, true);

await expect(LandAsOther1.burnFrom(other, 0))
.to.emit(LandAsOther, 'Transfer')
.withArgs(other, ZeroAddress, 0);
});

it('should revert burning tokens by unauthorized operator', async function () {
const {LandAsMinter, other, LandAsOther1} =
await loadFixture(setupLand);

await LandAsMinter.mintQuad(other, 1, 0, 0, '0x');
await expect(LandAsOther1.burnFrom(other, 0)).to.be.revertedWith(
'UNAUTHORIZED_BURN',
);
});
});

describe('batchTransfer', function () {
Expand Down

1 comment on commit 71d848b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

95.73%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/land/contracts
   Land.sol95.65%92.11%100%100%131, 24, 27
   LandMetadataRegistry.sol100%100%100%100%
   PolygonLand.sol95.95%92.50%100%100%102, 24, 27
packages/land/contracts/common
   ERC721BaseToken.sol87.77%95%70.59%87.83%100, 107, 166, 166, 166, 34, 341–342, 342, 342–343, 345, 347, 43, 51, 60, 68, 77
   LandBaseToken.sol96.23%92.86%97.06%98.31%184, 184, 184, 184, 184, 344, 426, 490, 533, 535–537, 550, 682, 76
   OperatorFiltererUpgradeable.sol91.11%88.89%100%91.30%53–54, 64–65
   WithAdmin.sol96%90%100%100%32
   WithMetadataRegistry.sol100%100%100%100%
   WithOwner.sol100%100%100%100%
   WithRoyalties.sol100%100%100%100%
   WithSuperOperators.sol100%100%100%100%
packages/land/contracts/interfaces
   IERC721MandatoryTokenReceiver.sol100%100%100%100%
   ILandMetadataRegistry.sol100%100%100%100%
   ILandToken.sol100%100%100%100%
   IOperatorFilterRegistry.sol100%100%100%100%
packages/land/contracts/mainnet
   LandBase.sol100%100%100%100%
   LandStorageMixin.sol100%100%100%100%
packages/land/contracts/polygon
   ERC2771Handler.sol57.14%50%66.67%54.55%21–22, 63, 63, 63–64, 66
   PolygonLandBase.sol95%100%95%95%27
   PolygonLandStorageMixin.sol100%100%100%100%
packages/land/contracts/registry
   LandMetadataBase.sol100%100%100%100%

Please sign in to comment.