diff options
author | Brandon Millman <brandon@0xproject.com> | 2017-12-22 02:16:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-22 02:16:25 +0800 |
commit | cb3582289ff94857d5956bbd71dbf68ee3f42ecf (patch) | |
tree | 62c94cba698834e33cf284c084c04e30766190e8 /packages/contracts/util/exchange_wrapper.ts | |
parent | 734d220d6050ad7b9fa66e5e0695b848501eeff6 (diff) | |
parent | 2d53b7d9a499e4fb5791fe34cae5ef118bdfc0ce (diff) | |
download | dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.tar dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.tar.gz dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.tar.bz2 dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.tar.lz dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.tar.xz dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.tar.zst dexon-sol-tools-cb3582289ff94857d5956bbd71dbf68ee3f42ecf.zip |
Merge pull request #285 from 0xProject/fix/underscorePrivate
Add new underscore-privates rule to @0xproject/tslint-config and fix …
Diffstat (limited to 'packages/contracts/util/exchange_wrapper.ts')
-rw-r--r-- | packages/contracts/util/exchange_wrapper.ts | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/packages/contracts/util/exchange_wrapper.ts b/packages/contracts/util/exchange_wrapper.ts index 304dcdacf..9545710cd 100644 --- a/packages/contracts/util/exchange_wrapper.ts +++ b/packages/contracts/util/exchange_wrapper.ts @@ -6,9 +6,9 @@ import {Order} from './order'; import {ContractInstance} from './types'; export class ExchangeWrapper { - private exchange: ContractInstance; + private _exchange: ContractInstance; constructor(exchangeContractInstance: ContractInstance) { - this.exchange = exchangeContractInstance; + this._exchange = exchangeContractInstance; } public async fillOrderAsync(order: Order, from: string, opts: { @@ -17,7 +17,7 @@ export class ExchangeWrapper { } = {}) { const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance; const params = order.createFill(shouldThrowOnInsufficientBalanceOrAllowance, opts.fillTakerTokenAmount); - const tx = await this.exchange.fillOrder( + const tx = await this._exchange.fillOrder( params.orderAddresses, params.orderValues, params.fillTakerTokenAmount, @@ -33,7 +33,7 @@ export class ExchangeWrapper { public async cancelOrderAsync(order: Order, from: string, opts: {cancelTakerTokenAmount?: BigNumber} = {}) { const params = order.createCancel(opts.cancelTakerTokenAmount); - const tx = await this.exchange.cancelOrder( + const tx = await this._exchange.cancelOrder( params.orderAddresses, params.orderValues, params.cancelTakerTokenAmount, @@ -46,7 +46,7 @@ export class ExchangeWrapper { opts: {fillTakerTokenAmount?: BigNumber} = {}) { const shouldThrowOnInsufficientBalanceOrAllowance = true; const params = order.createFill(shouldThrowOnInsufficientBalanceOrAllowance, opts.fillTakerTokenAmount); - const tx = await this.exchange.fillOrKillOrder( + const tx = await this._exchange.fillOrKillOrder( params.orderAddresses, params.orderValues, params.fillTakerTokenAmount, @@ -66,7 +66,7 @@ export class ExchangeWrapper { const shouldThrowOnInsufficientBalanceOrAllowance = !!opts.shouldThrowOnInsufficientBalanceOrAllowance; const params = formatters.createBatchFill( orders, shouldThrowOnInsufficientBalanceOrAllowance, opts.fillTakerTokenAmounts); - const tx = await this.exchange.batchFillOrders( + const tx = await this._exchange.batchFillOrders( params.orderAddresses, params.orderValues, params.fillTakerTokenAmounts, @@ -82,7 +82,7 @@ export class ExchangeWrapper { public async batchFillOrKillOrdersAsync(orders: Order[], from: string, opts: {fillTakerTokenAmounts?: BigNumber[]} = {}) { const params = formatters.createBatchFill(orders, undefined, opts.fillTakerTokenAmounts); - const tx = await this.exchange.batchFillOrKillOrders( + const tx = await this._exchange.batchFillOrKillOrders( params.orderAddresses, params.orderValues, params.fillTakerTokenAmounts, @@ -103,7 +103,7 @@ export class ExchangeWrapper { const params = formatters.createFillUpTo(orders, shouldThrowOnInsufficientBalanceOrAllowance, opts.fillTakerTokenAmount); - const tx = await this.exchange.fillOrdersUpTo( + const tx = await this._exchange.fillOrdersUpTo( params.orderAddresses, params.orderValues, params.fillTakerTokenAmount, @@ -119,7 +119,7 @@ export class ExchangeWrapper { public async batchCancelOrdersAsync(orders: Order[], from: string, opts: {cancelTakerTokenAmounts?: BigNumber[]} = {}) { const params = formatters.createBatchCancel(orders, opts.cancelTakerTokenAmounts); - const tx = await this.exchange.batchCancelOrders( + const tx = await this._exchange.batchCancelOrders( params.orderAddresses, params.orderValues, params.cancelTakerTokenAmounts, @@ -131,11 +131,11 @@ export class ExchangeWrapper { public async getOrderHashAsync(order: Order): Promise<string> { const shouldThrowOnInsufficientBalanceOrAllowance = false; const params = order.createFill(shouldThrowOnInsufficientBalanceOrAllowance); - const orderHash = await this.exchange.getOrderHash(params.orderAddresses, params.orderValues); + const orderHash = await this._exchange.getOrderHash(params.orderAddresses, params.orderValues); return orderHash; } public async isValidSignatureAsync(order: Order): Promise<boolean> { - const isValidSignature = await this.exchange.isValidSignature( + const isValidSignature = await this._exchange.isValidSignature( order.params.maker, order.params.orderHashHex, order.params.v, @@ -146,12 +146,12 @@ export class ExchangeWrapper { } public async isRoundingErrorAsync(numerator: BigNumber, denominator: BigNumber, target: BigNumber): Promise<boolean> { - const isRoundingError = await this.exchange.isRoundingError(numerator, denominator, target); + const isRoundingError = await this._exchange.isRoundingError(numerator, denominator, target); return isRoundingError; } public async getPartialAmountAsync(numerator: BigNumber, denominator: BigNumber, target: BigNumber): Promise<BigNumber> { - const partialAmount = new BigNumber(await this.exchange.getPartialAmount(numerator, denominator, target)); + const partialAmount = new BigNumber(await this._exchange.getPartialAmount(numerator, denominator, target)); return partialAmount; } } |