From b6a133cc641617bd1099ec00c62a749f548316b7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 27 Feb 2018 13:51:12 -0800 Subject: Improve an error message when an inorrect number of constructor params is passed --- packages/contracts/test/exchange/core.ts | 8 ++++---- packages/contracts/test/exchange/helpers.ts | 6 +++--- packages/contracts/test/exchange/wrapper.ts | 6 +++--- packages/contracts/test/token_transfer_proxy/transfer_from.ts | 2 +- packages/contracts/test/unlimited_allowance_token.ts | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'packages/contracts/test') diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 303d745aa..ad5b3a083 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -56,9 +56,9 @@ describe('Exchange', () => { maker = accounts[0]; [tokenOwner, taker, feeRecipient] = accounts; const [repInstance, dgdInstance, zrxInstance] = await Promise.all([ - deployer.deployAsync(ContractName.DummyToken), - deployer.deployAsync(ContractName.DummyToken), - deployer.deployAsync(ContractName.DummyToken), + deployer.deployAsync(ContractName.DummyToken, []), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), ]); rep = new DummyTokenContract(web3Wrapper, repInstance.abi, repInstance.address); dgd = new DummyTokenContract(web3Wrapper, dgdInstance.abi, dgdInstance.address); @@ -128,7 +128,7 @@ describe('Exchange', () => { await blockchainLifecycle.revertAsync(); }); describe('internal functions', () => { - it('should include transferViaTokenTransferProxy', () => { + it.only('should include transferViaTokenTransferProxy', () => { expect((exchange as any).transferViaTokenTransferProxy).to.be.undefined(); }); diff --git a/packages/contracts/test/exchange/helpers.ts b/packages/contracts/test/exchange/helpers.ts index 9869c2155..625234729 100644 --- a/packages/contracts/test/exchange/helpers.ts +++ b/packages/contracts/test/exchange/helpers.ts @@ -39,9 +39,9 @@ describe('Exchange', () => { const tokenRegistry = await deployer.deployAsync(ContractName.TokenRegistry); const tokenTransferProxy = await deployer.deployAsync(ContractName.TokenTransferProxy); const [rep, dgd, zrx] = await Promise.all([ - deployer.deployAsync(ContractName.DummyToken), - deployer.deployAsync(ContractName.DummyToken), - deployer.deployAsync(ContractName.DummyToken), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), ]); const exchangeInstance = await deployer.deployAsync(ContractName.Exchange, [ zrx.address, diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts index 4ea40cb59..239f13a4f 100644 --- a/packages/contracts/test/exchange/wrapper.ts +++ b/packages/contracts/test/exchange/wrapper.ts @@ -56,9 +56,9 @@ describe('Exchange', () => { tokenOwner = accounts[0]; [maker, taker, feeRecipient] = accounts; const [repInstance, dgdInstance, zrxInstance] = await Promise.all([ - deployer.deployAsync(ContractName.DummyToken), - deployer.deployAsync(ContractName.DummyToken), - deployer.deployAsync(ContractName.DummyToken), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), ]); rep = new DummyTokenContract(web3Wrapper, repInstance.abi, repInstance.address); dgd = new DummyTokenContract(web3Wrapper, dgdInstance.abi, dgdInstance.address); diff --git a/packages/contracts/test/token_transfer_proxy/transfer_from.ts b/packages/contracts/test/token_transfer_proxy/transfer_from.ts index 6b86a0e97..a77590288 100644 --- a/packages/contracts/test/token_transfer_proxy/transfer_from.ts +++ b/packages/contracts/test/token_transfer_proxy/transfer_from.ts @@ -38,7 +38,7 @@ describe('TokenTransferProxy', () => { tokenTransferProxyInstance.abi, tokenTransferProxyInstance.address, ); - const repInstance = await deployer.deployAsync(ContractName.DummyToken); + const repInstance = await deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS); rep = new DummyTokenContract(web3Wrapper, repInstance.abi, repInstance.address); dmyBalances = new Balances([rep], [accounts[0], accounts[1]]); diff --git a/packages/contracts/test/unlimited_allowance_token.ts b/packages/contracts/test/unlimited_allowance_token.ts index 03eb581ad..553178d80 100644 --- a/packages/contracts/test/unlimited_allowance_token.ts +++ b/packages/contracts/test/unlimited_allowance_token.ts @@ -34,7 +34,7 @@ describe('UnlimitedAllowanceToken', () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); owner = accounts[0]; spender = accounts[1]; - const tokenInstance = await deployer.deployAsync(ContractName.DummyToken); + const tokenInstance = await deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS); token = new DummyTokenContract(web3Wrapper, tokenInstance.abi, tokenInstance.address); await token.mint.sendTransactionAsync(MAX_MINT_VALUE, { from: owner }); tokenAddress = token.address; -- cgit v1.2.3 From 8b6cc95c1b69fe8372f25168714a5fd683dd2e26 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 27 Feb 2018 14:42:39 -0800 Subject: Fix a typo --- packages/contracts/test/exchange/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/contracts/test') diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index ad5b3a083..09f796663 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -56,7 +56,7 @@ describe('Exchange', () => { maker = accounts[0]; [tokenOwner, taker, feeRecipient] = accounts; const [repInstance, dgdInstance, zrxInstance] = await Promise.all([ - deployer.deployAsync(ContractName.DummyToken, []), + deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), deployer.deployAsync(ContractName.DummyToken, constants.DUMMY_TOKEN_ARGS), ]); -- cgit v1.2.3 From bab8c1eeff287a5dd90754c3391fd702d974d9d6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 27 Feb 2018 14:43:29 -0800 Subject: Remove only --- packages/contracts/test/exchange/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/contracts/test') diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 09f796663..710d6fe94 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -128,7 +128,7 @@ describe('Exchange', () => { await blockchainLifecycle.revertAsync(); }); describe('internal functions', () => { - it.only('should include transferViaTokenTransferProxy', () => { + it('should include transferViaTokenTransferProxy', () => { expect((exchange as any).transferViaTokenTransferProxy).to.be.undefined(); }); -- cgit v1.2.3