Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Feb 2, 2024
1 parent b679127 commit 192caf0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 0 additions & 4 deletions contracts/mocks/ERC721ASpotMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ contract ERC721ASpotMock is StartTokenIdHelper, SequentialUpToHelper, ERC721AQue
_safeMintSpot(to, tokenId);
}

function getOwnershipAt(uint256 index) public view returns (TokenOwnership memory) {
return _ownershipAt(index);
}

function totalSpotMinted() public view returns (uint256) {
return _totalSpotMinted();
}
Expand Down
20 changes: 14 additions & 6 deletions test/extensions/ERC721ASpot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,30 +231,38 @@ describe('ERC721ASpot', function () {
expect(await this.erc721aSpot.totalBurned()).to.eq(7);
});

it('affects _exists', async function () {
expect(await this.erc721aSpot.exists(0)).to.eq(false);
expect(await this.erc721aSpot.exists(9)).to.eq(false);
expect(await this.erc721aSpot.exists(10)).to.eq(true);

expect(await this.erc721aSpot.exists(20)).to.eq(true);

await this.erc721aSpot.connect(this.addr1).burn(20);
expect(await this.erc721aSpot.exists(20)).to.eq(false);

this.erc721aSpot.safeMintSpot(this.owner.address, 20);
expect(await this.erc721aSpot.exists(20)).to.eq(true);
});

it('forwards extraData after burn and re-mint', async function () {
await this.erc721aSpot.setExtraDataAt(20, 123);
let explicitOwnership = await this.erc721aSpot.explicitOwnershipOf(20);
expect(await this.erc721aSpot.exists(20)).to.eq(true);
expect(explicitOwnership.addr).to.eq(this.addr1.address);
expect(explicitOwnership.burned).to.eq(false);
expect(explicitOwnership.extraData).to.eq(123);
expect(await this.erc721aSpot.exists(20)).to.eq(true);

await this.erc721aSpot.connect(this.addr1).burn(20);
expect(await this.erc721aSpot.exists(20)).to.eq(false);
explicitOwnership = await this.erc721aSpot.explicitOwnershipOf(20);
expect(explicitOwnership.addr).to.eq(this.addr1.address);
expect(explicitOwnership.burned).to.eq(true);
expect(explicitOwnership.extraData).to.eq(123);
expect(await this.erc721aSpot.exists(20)).to.eq(false);

this.erc721aSpot.safeMintSpot(this.owner.address, 20);
expect(await this.erc721aSpot.exists(20)).to.eq(true);
explicitOwnership = await this.erc721aSpot.explicitOwnershipOf(20);
expect(explicitOwnership.addr).to.eq(this.owner.address);
expect(explicitOwnership.burned).to.eq(false);
expect(explicitOwnership.extraData).to.eq(123);
expect(await this.erc721aSpot.exists(20)).to.eq(true);
});
});
});
Expand Down

0 comments on commit 192caf0

Please sign in to comment.