diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-24 11:27:38 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:44 +0800 |
commit | d1fd4421be0a7639b99b374bf04e57fac4e8a486 (patch) | |
tree | a97d00cbea579864f23803fa391e169814d93f6e /contracts | |
parent | b06f8239e1fe75703f88d34c0d225701406e28c2 (diff) | |
download | dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.tar dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.tar.gz dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.tar.bz2 dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.tar.lz dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.tar.xz dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.tar.zst dexon-sol-tools-d1fd4421be0a7639b99b374bf04e57fac4e8a486.zip |
Use string argument encoding with new encoder
Diffstat (limited to 'contracts')
-rw-r--r-- | contracts/protocol/test/asset_proxy/proxies.ts | 7 | ||||
-rw-r--r-- | contracts/protocol/test/exchange/core.ts | 20 | ||||
-rw-r--r-- | contracts/protocol/test/exchange/internal.ts | 3 |
3 files changed, 11 insertions, 19 deletions
diff --git a/contracts/protocol/test/asset_proxy/proxies.ts b/contracts/protocol/test/asset_proxy/proxies.ts index 650594c12..bbb44f402 100644 --- a/contracts/protocol/test/asset_proxy/proxies.ts +++ b/contracts/protocol/test/asset_proxy/proxies.ts @@ -107,7 +107,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - // Configure ERC721Proxy await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -115,7 +114,6 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - await web3Wrapper.awaitTransactionSuccessAsync( await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, { from: owner, @@ -123,7 +121,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - // Configure MultiAssetProxy await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.addAuthorizedAddress.sendTransactionAsync(authorized, { @@ -131,14 +128,12 @@ describe('Asset Transfer Proxies', () => { }), constants.AWAIT_TRANSACTION_MINED_MS, ); - await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, { from: owner, }), constants.AWAIT_TRANSACTION_MINED_MS, ); - await web3Wrapper.awaitTransactionSuccessAsync( await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, { from: owner, @@ -146,7 +141,6 @@ describe('Asset Transfer Proxies', () => { constants.AWAIT_TRANSACTION_MINED_MS, ); - // Deploy and configure ERC20 tokens const numDummyErc20ToDeploy = 2; [erc20TokenA, erc20TokenB] = await erc20Wrapper.deployDummyTokensAsync( @@ -172,7 +166,6 @@ describe('Asset Transfer Proxies', () => { constants.DUMMY_TOKEN_TOTAL_SUPPLY, ); - await erc20Wrapper.setBalancesAndAllowancesAsync(); await web3Wrapper.awaitTransactionSuccessAsync( await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE), diff --git a/contracts/protocol/test/exchange/core.ts b/contracts/protocol/test/exchange/core.ts index ec0f41f85..700643b79 100644 --- a/contracts/protocol/test/exchange/core.ts +++ b/contracts/protocol/test/exchange/core.ts @@ -1046,7 +1046,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1056,7 +1056,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1067,7 +1067,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Fillable; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and unfilled order', async () => { await exchangeWrapper.cancelOrderAsync(signedOrder, makerAddress); @@ -1077,7 +1077,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for a cancelled and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1089,7 +1089,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Cancelled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and unfilled order', async () => { const currentTimestamp = await getLatestBlockTimestampAsync(); @@ -1101,7 +1101,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and partially filled order', async () => { const takerAssetFillAmount = signedOrder.takerAssetAmount.div(2); @@ -1115,7 +1115,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.Expired; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an expired and fully filled order', async () => { await exchangeWrapper.fillOrderAsync(signedOrder, takerAddress); @@ -1129,7 +1129,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.FullyFilled; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a makerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetAmount: new BigNumber(0) }); @@ -1139,7 +1139,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidMakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); it('should return the correct orderInfo for an order with a takerAssetAmount of 0', async () => { signedOrder = await orderFactory.newSignedOrderAsync({ takerAssetAmount: new BigNumber(0) }); @@ -1149,7 +1149,7 @@ describe('Exchange core', () => { const expectedOrderStatus = OrderStatus.InvalidTakerAssetAmount; expect(orderInfo.orderHash).to.be.equal(expectedOrderHash); expect(orderInfo.orderTakerAssetFilledAmount).to.be.bignumber.equal(expectedTakerAssetFilledAmount); - expect(orderInfo.orderStatus).to.be.equal(expectedOrderStatus); + expect(orderInfo.orderStatus).to.equal(expectedOrderStatus); }); }); }); diff --git a/contracts/protocol/test/exchange/internal.ts b/contracts/protocol/test/exchange/internal.ts index c65c477b2..972f5efb6 100644 --- a/contracts/protocol/test/exchange/internal.ts +++ b/contracts/protocol/test/exchange/internal.ts @@ -8,7 +8,6 @@ import { testCombinatoriallyWithReferenceFuncAsync, txDefaults, uint256Values, - orderUtils, web3Wrapper, } from '@0x/contracts-test-utils'; import { BlockchainLifecycle } from '@0x/dev-utils'; @@ -453,7 +452,7 @@ describe('Exchange core internal functions', () => { }; await web3Wrapper.awaitTransactionSuccessAsync( await testExchange.publicUpdateFilledState.sendTransactionAsync( - orderUtils.getOrderWithoutExchangeAddress(emptySignedOrder), + emptySignedOrder, constants.NULL_ADDRESS, orderHash, orderTakerAssetFilledAmount, |