From 935dca67e652c18699b34a0bda1898a1af5a8997 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Tue, 26 Nov 2019 16:09:40 +1100 Subject: [PATCH] ERC1155 Wrapper without chai --- contracts/asset-proxy/src/index.ts | 2 +- contracts/erc1155/package.json | 2 +- contracts/erc1155/src/erc1155_wrapper.ts | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contracts/asset-proxy/src/index.ts b/contracts/asset-proxy/src/index.ts index 03cb1951c3..76e68906e6 100644 --- a/contracts/asset-proxy/src/index.ts +++ b/contracts/asset-proxy/src/index.ts @@ -16,7 +16,7 @@ export { export { ERC20Wrapper } from './erc20_wrapper'; export { ERC721Wrapper } from './erc721_wrapper'; export { ERC1155ProxyWrapper } from './erc1155_proxy_wrapper'; -export { Erc1155Wrapper, ERC1155MintableContract } from '@0x/contracts-erc1155'; +export { ERC1155MintableContract, Erc1155Wrapper } from '@0x/contracts-erc1155'; export { DummyERC20TokenContract } from '@0x/contracts-erc20'; export { DummyERC721TokenContract } from '@0x/contracts-erc721'; export { diff --git a/contracts/erc1155/package.json b/contracts/erc1155/package.json index 2e039e52af..3fe4db52ce 100644 --- a/contracts/erc1155/package.json +++ b/contracts/erc1155/package.json @@ -64,7 +64,6 @@ "@types/mocha": "^5.2.7", "@types/node": "*", "@0x/typescript-typings": "^4.4.0-beta.2", - "@0x/contracts-test-utils": "^3.2.0-beta.3", "ethereum-types": "^2.2.0-beta.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", @@ -82,6 +81,7 @@ }, "dependencies": { "@0x/base-contract": "^5.5.0-beta.3", + "@0x/contracts-test-utils": "^3.2.0-beta.3", "@0x/utils": "^4.6.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", "lodash": "^4.17.11" diff --git a/contracts/erc1155/src/erc1155_wrapper.ts b/contracts/erc1155/src/erc1155_wrapper.ts index 2017ac6b44..b66da0a418 100644 --- a/contracts/erc1155/src/erc1155_wrapper.ts +++ b/contracts/erc1155/src/erc1155_wrapper.ts @@ -1,12 +1,9 @@ import { BigNumber } from '@0x/utils'; -import * as chai from 'chai'; import { LogWithDecodedArgs, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; import { ERC1155MintableContract, ERC1155TransferSingleEventArgs } from './wrappers'; -const expect = chai.expect; - export class Erc1155Wrapper { private readonly _erc1155Contract: ERC1155MintableContract; private readonly _contractOwner: string; @@ -135,7 +132,9 @@ export class Erc1155Wrapper { }); const balances = await this.getBalancesAsync(ownersExtended, tokensExtended); _.each(balances, (balance: BigNumber, i: number) => { - expect(balance, `${ownersExtended[i]}${tokensExtended[i]}`).to.be.bignumber.equal(expectedBalances[i]); + if (!balance.isEqualTo(expectedBalances[i])) { + throw new Error(`${ownersExtended[i]}${tokensExtended[i]} balance not equal ${expectedBalances[i]}`); + } }); } public async isNonFungibleItemAsync(tokenId: BigNumber): Promise {