From 89429c54a7424eb6aa233047fa83fe595faa44d5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 11 Jan 2019 18:04:33 +0100 Subject: Updated CHANGELOGS --- packages/contract-wrappers/CHANGELOG.json | 9 +++++++++ packages/contract-wrappers/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 2ba6c9f10..3234ad31b 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1547225310, + "version": "4.2.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "4.2.0", "changes": [ diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md index fe7bb7b81..d43345049 100644 --- a/packages/contract-wrappers/CHANGELOG.md +++ b/packages/contract-wrappers/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v4.2.1 - _January 11, 2019_ + + * Dependencies updated + ## v4.2.0 - _January 9, 2019_ * Added Dutch Auction wrapper (#1465) -- cgit v1.2.3 From cf3787edbb9e8acf7160ab93b903b54c63bdffda Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 11 Jan 2019 18:04:43 +0100 Subject: Publish - 0x.js@3.0.1 - @0x/abi-gen@1.0.21 - @0x/abi-gen-wrappers@2.1.1 - @0x/assert@1.0.22 - @0x/asset-buyer@4.0.0 - @0x/base-contract@3.0.12 - @0x/connect@3.0.12 - @0x/contract-wrappers@4.2.1 - @0x/dev-tools-pages@0.0.12 - @0x/dev-utils@1.0.23 - ethereum-types@1.1.5 - @0x/fill-scenarios@1.1.1 - @0x/instant@1.0.6 - @0x/json-schemas@2.1.6 - @0x/metacoin@0.0.34 - @0x/migrations@2.3.1 - @0x/monorepo-scripts@1.0.17 - @0x/order-utils@3.1.1 - @0x/order-watcher@2.4.1 - @0x/pipeline@1.0.4 - @0x/react-docs@1.0.24 - @0x/react-shared@1.1.1 - @0x/sol-compiler@2.0.1 - @0x/sol-coverage@1.0.1 - @0x/sol-doc@1.0.13 - @0x/sol-profiler@1.0.1 - @0x/sol-resolver@1.2.2 - @0x/sol-trace@1.0.1 - @0x/sol-tracing-utils@3.0.0 - @0x/sra-spec@1.0.15 - @0x/subproviders@2.1.10 - @0x/testnet-faucets@1.0.62 - @0x/tslint-config@2.0.1 - @0x/types@1.5.1 - @0x/typescript-typings@3.0.7 - @0x/utils@3.0.0 - @0x/web3-wrapper@3.2.3 - @0x/website@0.0.65 - @0x/contracts-examples@1.0.4 - @0x/contracts-extensions@1.2.1 - @0x/contracts-interfaces@1.0.4 - @0x/contracts-libs@1.0.4 - @0x/contracts-multisig@1.0.4 - @0x/contracts-protocol@2.2.1 - @0x/contracts-test-utils@1.0.4 - @0x/contracts-tokens@1.0.4 - @0x/contracts-utils@1.0.4 --- packages/contract-wrappers/package.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json index 708b4249a..6c1a8836a 100644 --- a/packages/contract-wrappers/package.json +++ b/packages/contract-wrappers/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contract-wrappers", - "version": "4.2.0", + "version": "4.2.1", "description": "Smart TS wrappers for 0x smart contracts", "keywords": [ "0xproject", @@ -37,10 +37,10 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0x/dev-utils": "^1.0.22", - "@0x/migrations": "^2.3.0", - "@0x/subproviders": "^2.1.9", - "@0x/tslint-config": "^2.0.0", + "@0x/dev-utils": "^1.0.23", + "@0x/migrations": "^2.3.1", + "@0x/subproviders": "^2.1.10", + "@0x/tslint-config": "^2.0.1", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "@types/node": "*", @@ -65,19 +65,19 @@ "web3-provider-engine": "14.0.6" }, "dependencies": { - "@0x/abi-gen-wrappers": "^2.1.0", - "@0x/assert": "^1.0.21", + "@0x/abi-gen-wrappers": "^2.1.1", + "@0x/assert": "^1.0.22", "@0x/contract-addresses": "^2.1.0", "@0x/contract-artifacts": "^1.2.0", - "@0x/contracts-test-utils": "^1.0.3", - "@0x/fill-scenarios": "^1.1.0", - "@0x/json-schemas": "^2.1.5", - "@0x/order-utils": "^3.1.0", - "@0x/types": "^1.5.0", - "@0x/typescript-typings": "^3.0.6", - "@0x/utils": "^2.1.1", - "@0x/web3-wrapper": "^3.2.2", - "ethereum-types": "^1.1.4", + "@0x/contracts-test-utils": "^1.0.4", + "@0x/fill-scenarios": "^1.1.1", + "@0x/json-schemas": "^2.1.6", + "@0x/order-utils": "^3.1.1", + "@0x/types": "^1.5.1", + "@0x/typescript-typings": "^3.0.7", + "@0x/utils": "^3.0.0", + "@0x/web3-wrapper": "^3.2.3", + "ethereum-types": "^1.1.5", "ethereumjs-abi": "0.6.5", "ethereumjs-blockstream": "6.0.0", "ethereumjs-util": "^5.1.1", -- cgit v1.2.3 From 943c378309a84ed142852c6584b53958df7817c8 Mon Sep 17 00:00:00 2001 From: Xianny <8582774+xianny@users.noreply.github.com> Date: Fri, 11 Jan 2019 10:04:30 -0800 Subject: Implement tslint enum-naming to enforce PascalCase on enum members (#1474) --- packages/contract-wrappers/CHANGELOG.json | 9 +++++++++ packages/contract-wrappers/src/types.ts | 14 +++++++------- packages/contract-wrappers/test/exchange_wrapper_test.ts | 10 +++++----- packages/contract-wrappers/test/forwarder_wrapper_test.ts | 8 ++++---- .../contract-wrappers/test/order_validator_wrapper_test.ts | 4 ++-- 5 files changed, 27 insertions(+), 18 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 3234ad31b..9a225726a 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "5.0.0", + "changes": [ + { + "note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule", + "pr": 1474 + } + ] + }, { "timestamp": 1547225310, "version": "4.2.1", diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts index 945ca88cd..29cf8b2c4 100644 --- a/packages/contract-wrappers/src/types.ts +++ b/packages/contract-wrappers/src/types.ts @@ -177,13 +177,13 @@ export interface OrderInfo { } export enum OrderStatus { - INVALID = 0, - INVALID_MAKER_ASSET_AMOUNT, - INVALID_TAKER_ASSET_AMOUNT, - FILLABLE, - EXPIRED, - FULLY_FILLED, - CANCELLED, + Invalid = 0, + InvalidMakerAssetAmount, + InvalidTakerAssetAmount, + Fillable, + Expired, + FullyFilled, + Cancelled, } export interface TraderInfo { diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts index 73ce6c743..a1d60dc6e 100644 --- a/packages/contract-wrappers/test/exchange_wrapper_test.ts +++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts @@ -109,7 +109,7 @@ describe('ExchangeWrapper', () => { ); await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled); }); }); describe('#fillOrKillOrderAsync', () => { @@ -157,7 +157,7 @@ describe('ExchangeWrapper', () => { ); await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled); }); }); describe('#marketSellOrdersAsync', () => { @@ -183,7 +183,7 @@ describe('ExchangeWrapper', () => { ); await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled); }); }); describe('#batchFillOrdersNoThrowAsync', () => { @@ -197,9 +197,9 @@ describe('ExchangeWrapper', () => { ); await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); let orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled); orderInfo = await contractWrappers.exchange.getOrderInfoAsync(anotherSignedOrder); - expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); + expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled); }); }); describe('#batchFillOrKillOrdersAsync', () => { diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts index ff4ff8b67..0d197eced 100644 --- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts +++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts @@ -97,8 +97,8 @@ describe('ForwarderWrapper', () => { ); await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]); - expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); - expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); + expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FullyFilled); + expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FullyFilled); }); it('should throw when invalid transaction and shouldValidate is true', async () => { const signedOrders = [signedOrder]; @@ -131,8 +131,8 @@ describe('ForwarderWrapper', () => { ); await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]); - expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED); - expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FullyFilled); + expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.Fillable); expect(ordersInfo[1].orderTakerAssetFilledAmount).to.be.bignumber.equal(new BigNumber(4)); // only 95% of ETH is sold }); it('should throw when invalid transaction and shouldValidate is true', async () => { diff --git a/packages/contract-wrappers/test/order_validator_wrapper_test.ts b/packages/contract-wrappers/test/order_validator_wrapper_test.ts index da3f99e72..c61c05d31 100644 --- a/packages/contract-wrappers/test/order_validator_wrapper_test.ts +++ b/packages/contract-wrappers/test/order_validator_wrapper_test.ts @@ -117,9 +117,9 @@ describe('OrderValidator', () => { it('should return correct on-chain order info for input orders', async () => { const firstOrderInfo = ordersInfo[0]; const secondOrderInfo = ordersInfo[1]; - expect(firstOrderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(firstOrderInfo.orderStatus).to.be.equal(OrderStatus.Fillable); expect(firstOrderInfo.orderTakerAssetFilledAmount).to.bignumber.equal(constants.ZERO_AMOUNT); - expect(secondOrderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE); + expect(secondOrderInfo.orderStatus).to.be.equal(OrderStatus.Fillable); expect(secondOrderInfo.orderTakerAssetFilledAmount).to.bignumber.equal(constants.ZERO_AMOUNT); }); it('should return correct on-chain trader info for input takers', async () => { -- cgit v1.2.3 From 507c47c42cdc0cd2164b22bf84d14bfd2e59b1ea Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Sat, 12 Jan 2019 10:22:13 +1100 Subject: bug(exchange-wrapper): matchOrdersAsync input param mutation --- packages/contract-wrappers/CHANGELOG.json | 51 +++++++++++++++------- .../src/contract_wrappers/exchange_wrapper.ts | 18 ++++---- 2 files changed, 45 insertions(+), 24 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 9a225726a..c06f55465 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -5,6 +5,9 @@ { "note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule", "pr": 1474 + }, + { + "note": "Prevent Exchange `matchOrdersAsync` input parameters being modified" } ] }, @@ -70,7 +73,8 @@ "version": "4.1.0", "changes": [ { - "note": "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", + "note": + "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", "pr": 1292 } ], @@ -98,15 +102,18 @@ "version": "4.0.0", "changes": [ { - "note": "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "note": + "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", "pr": 1235 }, { - "note": "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "note": + "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", "pr": 1235 }, { - "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "note": + "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", "pr": 1235 } ], @@ -137,23 +144,28 @@ "pr": 1105 }, { - "note": "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", + "note": + "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", "pr": 1105 }, { - "note": "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", + "note": + "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", "pr": 1105 }, { - "note": "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", + "note": + "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", "pr": 1105 }, { - "note": "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", + "note": + "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", "pr": 1105 }, { - "note": "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", + "note": + "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", "pr": 1105 }, { @@ -189,11 +201,13 @@ "version": "2.0.0", "changes": [ { - "note": "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", + "note": + "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", "pr": 1080 }, { - "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", + "note": + "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", "pr": 1080 } ], @@ -242,15 +256,18 @@ "note": "Add `OrderValidatorWrapper`" }, { - "note": "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", + "note": + "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", "pr": 1044 }, { - "note": "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", + "note": + "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", "pr": 1054 }, { - "note": "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", + "note": + "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", "pr": 1054 } ], @@ -269,11 +286,13 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", + "note": + "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", "pr": 924 }, { - "note": "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", + "note": + "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", "pr": 924 }, { diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index c9556971a..e61f5bbdc 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -743,18 +743,20 @@ export class ExchangeWrapper extends ContractWrapper { rightSignedOrder.takerAssetData !== leftSignedOrder.makerAssetData ) { throw new Error(ExchangeWrapperError.AssetDataMismatch); - } else { - // Smart contracts assigns the asset data from the left order to the right one so we can save gas on reducing the size of call data - rightSignedOrder.makerAssetData = '0x'; - rightSignedOrder.takerAssetData = '0x'; } + // Smart contracts assigns the asset data from the left order to the right one so we can save gas on reducing the size of call data + const optimizedRightSignedOrder = { + ...rightSignedOrder, + makerAssetData: '0x', + takerAssetData: '0x', + }; const exchangeInstance = await this._getExchangeContractAsync(); if (orderTransactionOpts.shouldValidate) { await exchangeInstance.matchOrders.callAsync( leftSignedOrder, - rightSignedOrder, + optimizedRightSignedOrder, leftSignedOrder.signature, - rightSignedOrder.signature, + optimizedRightSignedOrder.signature, { from: normalizedTakerAddress, gas: orderTransactionOpts.gasLimit, @@ -765,9 +767,9 @@ export class ExchangeWrapper extends ContractWrapper { } const txHash = await exchangeInstance.matchOrders.sendTransactionAsync( leftSignedOrder, - rightSignedOrder, + optimizedRightSignedOrder, leftSignedOrder.signature, - rightSignedOrder.signature, + optimizedRightSignedOrder.signature, { from: normalizedTakerAddress, gas: orderTransactionOpts.gasLimit, -- cgit v1.2.3 From 54a1fd87db9246ecbfdd9341689896375732cb9a Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Sat, 12 Jan 2019 10:27:48 +1100 Subject: Update PR number --- packages/contract-wrappers/CHANGELOG.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index c06f55465..d171516a5 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -7,7 +7,8 @@ "pr": 1474 }, { - "note": "Prevent Exchange `matchOrdersAsync` input parameters being modified" + "note": "Prevent Exchange `matchOrdersAsync` input parameters being modified", + "pr": 1514 } ] }, -- cgit v1.2.3 From 5da40ab45e796c1b625afe69c128d174230fcceb Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Sat, 12 Jan 2019 11:07:48 +1100 Subject: Prettier --- packages/contract-wrappers/CHANGELOG.json | 48 +++++++++++-------------------- 1 file changed, 16 insertions(+), 32 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index d171516a5..769c79778 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -74,8 +74,7 @@ "version": "4.1.0", "changes": [ { - "note": - "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", + "note": "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount", "pr": 1292 } ], @@ -103,18 +102,15 @@ "version": "4.0.0", "changes": [ { - "note": - "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "note": "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", "pr": 1235 }, { - "note": - "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "note": "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", "pr": 1235 }, { - "note": - "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", "pr": 1235 } ], @@ -145,28 +141,23 @@ "pr": 1105 }, { - "note": - "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", + "note": "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.", "pr": 1105 }, { - "note": - "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", + "note": "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).", "pr": 1105 }, { - "note": - "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", + "note": "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.", "pr": 1105 }, { - "note": - "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", + "note": "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.", "pr": 1105 }, { - "note": - "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", + "note": "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.", "pr": 1105 }, { @@ -202,13 +193,11 @@ "version": "2.0.0", "changes": [ { - "note": - "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", + "note": "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.", "pr": 1080 }, { - "note": - "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", + "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it", "pr": 1080 } ], @@ -257,18 +246,15 @@ "note": "Add `OrderValidatorWrapper`" }, { - "note": - "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", + "note": "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`", "pr": 1044 }, { - "note": - "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", + "note": "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations", "pr": 1054 }, { - "note": - "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", + "note": "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper", "pr": 1054 } ], @@ -287,13 +273,11 @@ "version": "1.0.1-rc.4", "changes": [ { - "note": - "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", + "note": "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`", "pr": 924 }, { - "note": - "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", + "note": "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`", "pr": 924 }, { -- cgit v1.2.3 From 007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Sat, 12 Jan 2019 12:07:37 +1100 Subject: Remove matchOrders optimization --- packages/contract-wrappers/CHANGELOG.json | 2 +- .../src/contract_wrappers/exchange_wrapper.ts | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json index 769c79778..c6af3adee 100644 --- a/packages/contract-wrappers/CHANGELOG.json +++ b/packages/contract-wrappers/CHANGELOG.json @@ -7,7 +7,7 @@ "pr": 1474 }, { - "note": "Prevent Exchange `matchOrdersAsync` input parameters being modified", + "note": "Remove Exchange `matchOrdersAsync` optimization", "pr": 1514 } ] diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts index e61f5bbdc..49193f816 100644 --- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts @@ -744,19 +744,13 @@ export class ExchangeWrapper extends ContractWrapper { ) { throw new Error(ExchangeWrapperError.AssetDataMismatch); } - // Smart contracts assigns the asset data from the left order to the right one so we can save gas on reducing the size of call data - const optimizedRightSignedOrder = { - ...rightSignedOrder, - makerAssetData: '0x', - takerAssetData: '0x', - }; const exchangeInstance = await this._getExchangeContractAsync(); if (orderTransactionOpts.shouldValidate) { await exchangeInstance.matchOrders.callAsync( leftSignedOrder, - optimizedRightSignedOrder, + rightSignedOrder, leftSignedOrder.signature, - optimizedRightSignedOrder.signature, + rightSignedOrder.signature, { from: normalizedTakerAddress, gas: orderTransactionOpts.gasLimit, @@ -767,9 +761,9 @@ export class ExchangeWrapper extends ContractWrapper { } const txHash = await exchangeInstance.matchOrders.sendTransactionAsync( leftSignedOrder, - optimizedRightSignedOrder, + rightSignedOrder, leftSignedOrder.signature, - optimizedRightSignedOrder.signature, + rightSignedOrder.signature, { from: normalizedTakerAddress, gas: orderTransactionOpts.gasLimit, -- cgit v1.2.3 From dc58c608412ad0708b87f7b83291d2d99f5f056c Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Sat, 12 Jan 2019 17:54:43 +1100 Subject: Update hardcoded token addresses --- packages/contract-wrappers/test/utils/token_utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/contract-wrappers') diff --git a/packages/contract-wrappers/test/utils/token_utils.ts b/packages/contract-wrappers/test/utils/token_utils.ts index f8a88637f..e390d2775 100644 --- a/packages/contract-wrappers/test/utils/token_utils.ts +++ b/packages/contract-wrappers/test/utils/token_utils.ts @@ -9,14 +9,14 @@ import { provider, txDefaults, web3Wrapper } from './web3_wrapper'; // Before we were fetching them from the TokenRegistry but now we can't as it's deprecated and removed. // TODO(albrow): Import these from the migrations package instead of hard-coding them. const DUMMY_ERC_20_ADRESSES = [ - '0x6dfff22588be9b3ef8cf0ad6dc9b84796f9fb45f', - '0xcfc18cec799fbd1793b5c43e773c98d4d61cc2db', - '0xf22469f31527adc53284441bae1665a7b9214dba', - '0x10add991de718a69dec2117cb6aa28098836511b', - '0x8d61158a366019ac78db4149d75fff9dda51160d', + '0x34d402f14d58e001d8efbe6585051bf9706aa064', + '0x25b8fe1de9daf8ba351890744ff28cf7dfa8f5e3', + '0xcdb594a32b1cc3479d8746279712c39d18a07fc0', + '0x1e2f9e10d02a6b8f8f69fcbf515e75039d2ea30d', + '0xbe0037eaf2d64fe5529bca93c18c9702d3930376', ]; -const DUMMY_ERC_721_ADRESSES = ['0x131855dda0aaff096f6854854c55a4debf61077a']; +const DUMMY_ERC_721_ADRESSES = ['0x07f96aa816c1f244cbc6ef114bb2b023ba54a2eb']; export const tokenUtils = { getDummyERC20TokenAddresses(): string[] { -- cgit v1.2.3