Skip to content

Commit

Permalink
deep bignumber comparison removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniket-Engg committed Jan 3, 2019
1 parent ed4d72a commit 230b272
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions test/token/ERC721/ERC721.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ const { ZERO_ADDRESS } = require('../../helpers/constants');
const send = require('../../helpers/send');

const ERC721ReceiverMock = artifacts.require('ERC721ReceiverMock.sol');
const { BigNumber } = require('../../helpers/setup');
require('../../helpers/setup');

function shouldBehaveLikeERC721 (
creator,
minter,
[owner, approved, anotherApproved, operator, anyone]
) {
const firstTokenId = new BigNumber(1);
const secondTokenId = new BigNumber(2);
const unknownTokenId = new BigNumber(3);
const firstTokenId = 1;
const secondTokenId = 2;
const unknownTokenId = 3;
const RECEIVER_MAGIC_VALUE = '0x150b7a02';

describe('like an ERC721', function () {
Expand Down Expand Up @@ -173,7 +173,7 @@ function shouldBehaveLikeERC721 (
const tokensListed = await Promise.all(
[0, 1].map(i => this.token.tokenOfOwnerByIndex(owner, i))
);
tokensListed.should.have.deep.members([firstTokenId, secondTokenId]);
tokensListed.map(t => t.toNumber()).should.have.members([firstTokenId, secondTokenId]);
});
});

Expand Down
14 changes: 7 additions & 7 deletions test/token/ERC721/ERC721Full.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ contract('ERC721Full', function ([
]) {
const name = 'Non Fungible Token';
const symbol = 'NFT';
const firstTokenId = new BigNumber(100);
const secondTokenId = new BigNumber(200);
const thirdTokenId = new BigNumber(300);
const nonExistentTokenId = new BigNumber(999);
const firstTokenId = 100;
const secondTokenId = 200;
const thirdTokenId = 300;
const nonExistentTokenId = 999;

const minter = creator;

Expand Down Expand Up @@ -149,7 +149,7 @@ contract('ERC721Full', function ([
const tokensListed = await Promise.all(
[0, 1].map(i => this.token.tokenOfOwnerByIndex(another, i))
);
tokensListed.should.have.deep.members([firstTokenId, secondTokenId]);
tokensListed.map(t => t.toNumber()).should.have.members([firstTokenId, secondTokenId]);
});

it('returns empty collection for original owner', async function () {
Expand All @@ -164,7 +164,7 @@ contract('ERC721Full', function ([
const tokensListed = await Promise.all(
[0, 1].map(i => this.token.tokenByIndex(i))
);
tokensListed.should.have.deep.members([firstTokenId, secondTokenId]);
tokensListed.map(t => t.toNumber()).should.have.members([firstTokenId, secondTokenId]);
});

it('should revert if index is greater than supply', async function () {
Expand All @@ -188,7 +188,7 @@ contract('ERC721Full', function ([
const expectedTokens = [firstTokenId, secondTokenId, newTokenId, anotherNewTokenId].filter(
x => (x !== tokenId)
);
tokensListed.should.have.deep.members(expectedTokens);
tokensListed.map(t => t.toNumber()).should.have.members(expectedTokens);
});
});
});
Expand Down

0 comments on commit 230b272

Please sign in to comment.