aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/utils/order_state_utils.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2017-12-20 13:44:08 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-12-20 22:30:25 +0800
commitcb11aec84df346d5180c7d5874859c1c34f0bf1c (patch)
treeb959a65bdcfc3e8b01dca1bc160f93a0df8a4bf9 /packages/0x.js/src/utils/order_state_utils.ts
parent972e1675f6490bc10e8d9fd64cce2f7945cd4840 (diff)
downloaddexon-sol-tools-cb11aec84df346d5180c7d5874859c1c34f0bf1c.tar.gz
dexon-sol-tools-cb11aec84df346d5180c7d5874859c1c34f0bf1c.tar.zst
dexon-sol-tools-cb11aec84df346d5180c7d5874859c1c34f0bf1c.zip
Add new underscore-privates rule to @0xproject/tslint-config and fix lint errors
Diffstat (limited to 'packages/0x.js/src/utils/order_state_utils.ts')
-rw-r--r--packages/0x.js/src/utils/order_state_utils.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts
index a0985d028..9849b073a 100644
--- a/packages/0x.js/src/utils/order_state_utils.ts
+++ b/packages/0x.js/src/utils/order_state_utils.ts
@@ -18,9 +18,9 @@ import {
const ACCEPTABLE_RELATIVE_ROUNDING_ERROR = 0.0001;
export class OrderStateUtils {
- private balanceAndProxyAllowanceLazyStore: BalanceAndProxyAllowanceLazyStore;
- private orderFilledCancelledLazyStore: OrderFilledCancelledLazyStore;
- private static validateIfOrderIsValid(signedOrder: SignedOrder, orderRelevantState: OrderRelevantState): void {
+ private _balanceAndProxyAllowanceLazyStore: BalanceAndProxyAllowanceLazyStore;
+ private _orderFilledCancelledLazyStore: OrderFilledCancelledLazyStore;
+ private static _validateIfOrderIsValid(signedOrder: SignedOrder, orderRelevantState: OrderRelevantState): void {
const unavailableTakerTokenAmount = orderRelevantState.cancelledTakerTokenAmount.add(
orderRelevantState.filledTakerTokenAmount,
);
@@ -53,14 +53,14 @@ export class OrderStateUtils {
}
constructor(balanceAndProxyAllowanceLazyStore: BalanceAndProxyAllowanceLazyStore,
orderFilledCancelledLazyStore: OrderFilledCancelledLazyStore) {
- this.balanceAndProxyAllowanceLazyStore = balanceAndProxyAllowanceLazyStore;
- this.orderFilledCancelledLazyStore = orderFilledCancelledLazyStore;
+ this._balanceAndProxyAllowanceLazyStore = balanceAndProxyAllowanceLazyStore;
+ this._orderFilledCancelledLazyStore = orderFilledCancelledLazyStore;
}
public async getOrderStateAsync(signedOrder: SignedOrder): Promise<OrderState> {
const orderRelevantState = await this.getOrderRelevantStateAsync(signedOrder);
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
try {
- OrderStateUtils.validateIfOrderIsValid(signedOrder, orderRelevantState);
+ OrderStateUtils._validateIfOrderIsValid(signedOrder, orderRelevantState);
const orderState: OrderStateValid = {
isValid: true,
orderHash,
@@ -81,23 +81,23 @@ export class OrderStateUtils {
// If we pass it from the instantiator - there is no opportunity to get it there
// because JS doesn't support async constructors.
// Moreover - it's cached under the hood so it's equivalent to an async constructor.
- const exchange = (this.orderFilledCancelledLazyStore as any).exchange as ExchangeWrapper;
+ const exchange = (this._orderFilledCancelledLazyStore as any).exchange as ExchangeWrapper;
const zrxTokenAddress = exchange.getZRXTokenAddress();
const orderHash = ZeroEx.getOrderHashHex(signedOrder);
- const makerBalance = await this.balanceAndProxyAllowanceLazyStore.getBalanceAsync(
+ const makerBalance = await this._balanceAndProxyAllowanceLazyStore.getBalanceAsync(
signedOrder.makerTokenAddress, signedOrder.maker,
);
- const makerProxyAllowance = await this.balanceAndProxyAllowanceLazyStore.getProxyAllowanceAsync(
+ const makerProxyAllowance = await this._balanceAndProxyAllowanceLazyStore.getProxyAllowanceAsync(
signedOrder.makerTokenAddress, signedOrder.maker,
);
- const makerFeeBalance = await this.balanceAndProxyAllowanceLazyStore.getBalanceAsync(
+ const makerFeeBalance = await this._balanceAndProxyAllowanceLazyStore.getBalanceAsync(
zrxTokenAddress, signedOrder.maker,
);
- const makerFeeProxyAllowance = await this.balanceAndProxyAllowanceLazyStore.getProxyAllowanceAsync(
+ const makerFeeProxyAllowance = await this._balanceAndProxyAllowanceLazyStore.getProxyAllowanceAsync(
zrxTokenAddress, signedOrder.maker,
);
- const filledTakerTokenAmount = await this.orderFilledCancelledLazyStore.getFilledTakerAmountAsync(orderHash);
- const cancelledTakerTokenAmount = await this.orderFilledCancelledLazyStore.getCancelledTakerAmountAsync(
+ const filledTakerTokenAmount = await this._orderFilledCancelledLazyStore.getFilledTakerAmountAsync(orderHash);
+ const cancelledTakerTokenAmount = await this._orderFilledCancelledLazyStore.getCancelledTakerAmountAsync(
orderHash,
);
const unavailableTakerTokenAmount = await exchange.getUnavailableTakerAmountAsync(orderHash);