diff options
author | Jacob Evans <jacob@dekz.net> | 2019-01-12 09:07:37 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2019-01-12 09:07:37 +0800 |
commit | 007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4 (patch) | |
tree | ea026d5e6d1dda5108de60853b0ab9ed7f8fc1eb | |
parent | 5da40ab45e796c1b625afe69c128d174230fcceb (diff) | |
download | dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.tar dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.tar.gz dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.tar.bz2 dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.tar.lz dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.tar.xz dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.tar.zst dexon-sol-tools-007a2d7deb1d7c7bb62cb5cfd07dc5f3714b9cb4.zip |
Remove matchOrders optimization
-rw-r--r-- | packages/contract-wrappers/CHANGELOG.json | 2 | ||||
-rw-r--r-- | packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts | 14 |
2 files changed, 5 insertions, 11 deletions
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, |