Implement tokensByIndex extension

- Remove restrictions from mock mint and burn calls
This commit is contained in:
Santiago Palladino
2018-03-09 12:58:16 -03:00
parent d726c79e5f
commit 54a1d2eacc
8 changed files with 184 additions and 60 deletions

View File

@ -40,13 +40,6 @@ export default function shouldMintAndBurnERC721Token (accounts) {
balance.should.be.bignumber.equal(1);
});
it('adjusts owner tokens by index', async function () {
if (!this.token.tokensOfOwnerByIndex) return;
const token = await this.tokensOfOwnerByIndex(to, 0);
token.should.be.equal(tokenId);
});
it('emits a transfer event', async function () {
logs.length.should.be.equal(1);
logs[0].event.should.be.eq('Transfer');
@ -86,13 +79,6 @@ export default function shouldMintAndBurnERC721Token (accounts) {
balance.should.be.bignumber.equal(1);
});
it('removes that token from the token list of the owner', async function () {
if (!this.token.tokensOfOwnerByIndex) return;
const token = await this.tokensOfOwnerByIndex(sender, 0);
token.should.not.be.equal(tokenId);
});
it('emits a burn event', async function () {
logs.length.should.be.equal(1);
logs[0].event.should.be.eq('Transfer');
@ -126,12 +112,6 @@ export default function shouldMintAndBurnERC721Token (accounts) {
});
});
describe('when the msg.sender does not own given token', function () {
it('reverts', async function () {
await assertRevert(this.token.burn(tokenId, { from: accounts[1] }));
});
});
describe('when the given token ID was not tracked by this contract', function () {
it('reverts', async function () {
await assertRevert(this.token.burn(unknownTokenId, { from: creator }));