aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-08-03 07:02:58 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-08-03 07:03:19 +0800
commit82092ab50a73e15e167f387380cd75ac52581e88 (patch)
treebce674d1e668299c131f30f8c808a9167ac3167b /packages/contract-wrappers/src
parentc3e6be7956adf4fabcc8dfffe081515562a1dde0 (diff)
downloaddexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.tar
dexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.tar.gz
dexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.tar.bz2
dexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.tar.lz
dexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.tar.xz
dexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.tar.zst
dexon-sol-tools-82092ab50a73e15e167f387380cd75ac52581e88.zip
Rename to calldata utils
Diffstat (limited to 'packages/contract-wrappers/src')
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts10
-rw-r--r--packages/contract-wrappers/src/utils/calldata_optimization_utils.ts (renamed from packages/contract-wrappers/src/utils/market_orders_optimization_utils.ts)6
2 files changed, 8 insertions, 8 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts
index 7d51889cf..13ef0fe01 100644
--- a/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/forwarder_wrapper.ts
@@ -10,8 +10,8 @@ import { orderTxOptsSchema } from '../schemas/order_tx_opts_schema';
import { txOptsSchema } from '../schemas/tx_opts_schema';
import { TransactionOpts } from '../types';
import { assert } from '../utils/assert';
+import { calldataOptimizationUtils } from '../utils/calldata_optimization_utils';
import { constants } from '../utils/constants';
-import { marketOrdersOptimizationUtils } from '../utils/market_orders_optimization_utils';
import { ContractWrapper } from './contract_wrapper';
import { ForwarderContract } from './generated/forwarder';
@@ -80,8 +80,8 @@ export class ForwarderWrapper extends ContractWrapper {
const normalizedTakerAddress = takerAddress.toLowerCase();
const normalizedFeeRecipientAddress = feeRecipientAddress.toLowerCase();
// optimize orders
- const optimizedMarketOrders = marketOrdersOptimizationUtils.optimizeMarketOrders(signedOrders);
- const optimizedFeeOrders = marketOrdersOptimizationUtils.optimizeFeeOrders(signedFeeOrders);
+ const optimizedMarketOrders = calldataOptimizationUtils.optimizeForwarderOrders(signedOrders);
+ const optimizedFeeOrders = calldataOptimizationUtils.optimizeForwarderFeeOrders(signedFeeOrders);
// send transaction
const forwarderContractInstance = await this._getForwarderContractAsync();
const txHash = await forwarderContractInstance.marketSellOrdersWithEth.sendTransactionAsync(
@@ -148,8 +148,8 @@ export class ForwarderWrapper extends ContractWrapper {
const normalizedTakerAddress = takerAddress.toLowerCase();
const normalizedFeeRecipientAddress = feeRecipientAddress.toLowerCase();
// optimize orders
- const optimizedMarketOrders = marketOrdersOptimizationUtils.optimizeMarketOrders(signedOrders);
- const optimizedFeeOrders = marketOrdersOptimizationUtils.optimizeFeeOrders(signedFeeOrders);
+ const optimizedMarketOrders = calldataOptimizationUtils.optimizeForwarderOrders(signedOrders);
+ const optimizedFeeOrders = calldataOptimizationUtils.optimizeForwarderFeeOrders(signedFeeOrders);
// send transaction
const forwarderContractInstance = await this._getForwarderContractAsync();
const txHash = await forwarderContractInstance.marketBuyOrdersWithEth.sendTransactionAsync(
diff --git a/packages/contract-wrappers/src/utils/market_orders_optimization_utils.ts b/packages/contract-wrappers/src/utils/calldata_optimization_utils.ts
index e35b2eadc..3172cf531 100644
--- a/packages/contract-wrappers/src/utils/market_orders_optimization_utils.ts
+++ b/packages/contract-wrappers/src/utils/calldata_optimization_utils.ts
@@ -3,14 +3,14 @@ import * as _ from 'lodash';
import { constants } from './constants';
-export const marketOrdersOptimizationUtils = {
+export const calldataOptimizationUtils = {
/**
* Takes an array of orders and outputs an array of equivalent orders where all takerAssetData are '0x' and
* all makerAssetData are '0x' except for that of the first order, which retains its original value
* @param orders An array of SignedOrder objects
* @returns optimized orders
*/
- optimizeMarketOrders(orders: SignedOrder[]): SignedOrder[] {
+ optimizeForwarderOrders(orders: SignedOrder[]): SignedOrder[] {
const optimizedOrders = _.map(orders, (order, index) =>
transformOrder(order, {
makerAssetData: index === 0 ? order.makerAssetData : constants.NULL_BYTES,
@@ -25,7 +25,7 @@ export const marketOrdersOptimizationUtils = {
* @param orders An array of SignedOrder objects
* @returns optimized orders
*/
- optimizeFeeOrders(orders: SignedOrder[]): SignedOrder[] {
+ optimizeForwarderFeeOrders(orders: SignedOrder[]): SignedOrder[] {
const optimizedOrders = _.map(orders, (order, index) =>
transformOrder(order, {
makerAssetData: constants.NULL_BYTES,