aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-06-13 02:43:19 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-06-13 02:45:02 +0800
commit3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d (patch)
tree7a27b880fcab96e867a02af2e337f32a3d352187 /packages/contracts/src/utils
parenta0a90afbc0962eb70b2abb3d24aef80a8d8a822d (diff)
downloaddexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.tar
dexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.tar.gz
dexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.tar.bz2
dexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.tar.lz
dexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.tar.xz
dexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.tar.zst
dexon-sol-tools-3a5f3e8b55f4b9733ef542281ee71c4fdc9cd39d.zip
Unpop byte rather than making deep copy
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/formatters.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/contracts/src/utils/formatters.ts b/packages/contracts/src/utils/formatters.ts
index b25dec27c..32e4787d6 100644
--- a/packages/contracts/src/utils/formatters.ts
+++ b/packages/contracts/src/utils/formatters.ts
@@ -2,6 +2,7 @@ import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
+import { constants } from './constants';
import { orderUtils } from './order_utils';
import { BatchCancelOrders, BatchFillOrders, MarketBuyOrders, MarketSellOrders } from './types';
@@ -31,10 +32,7 @@ export const formatters = {
_.forEach(signedOrders, (signedOrder, i) => {
const orderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress(signedOrder);
if (i !== 0) {
- orderWithoutExchangeAddress.takerAssetData = `0x${_.repeat(
- '0',
- signedOrders[0].takerAssetData.length - 2,
- )}`;
+ orderWithoutExchangeAddress.takerAssetData = constants.NULL_BYTES;
}
marketSellOrders.orders.push(orderWithoutExchangeAddress);
marketSellOrders.signatures.push(signedOrder.signature);
@@ -50,10 +48,7 @@ export const formatters = {
_.forEach(signedOrders, (signedOrder, i) => {
const orderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress(signedOrder);
if (i !== 0) {
- orderWithoutExchangeAddress.makerAssetData = `0x${_.repeat(
- '0',
- signedOrders[0].makerAssetData.length - 2,
- )}`;
+ orderWithoutExchangeAddress.makerAssetData = constants.NULL_BYTES;
}
marketBuyOrders.orders.push(orderWithoutExchangeAddress);
marketBuyOrders.signatures.push(signedOrder.signature);