diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-20 01:22:09 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-07-26 04:25:56 +0800 |
commit | 4d27b89fe38e0bb617aa05c86735025de9799fe9 (patch) | |
tree | e9443eade896cdd58cc7611118c43004f7921cb3 /src/contract_wrappers/exchange_wrapper.ts | |
parent | 31d068b83ff8d8e9117e410693c3afbc6f8a82ab (diff) | |
download | dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.tar dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.tar.gz dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.tar.bz2 dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.tar.lz dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.tar.xz dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.tar.zst dexon-0x-contracts-4d27b89fe38e0bb617aa05c86735025de9799fe9.zip |
Store tokenWrapper inside of OrdervalidationUtils
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 88dca82b2..2ddd63422 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -61,6 +61,7 @@ export class ExchangeWrapper extends ContractWrapper { }; private _exchangeContractIfExists?: ExchangeContract; private _exchangeLogEventEmitters: ContractEventEmitter[]; + private _orderValidationUtils: OrderValidationUtils; private _tokenWrapper: TokenWrapper; private static _getOrderAddressesAndValues(order: Order): [OrderAddresses, OrderValues] { const orderAddresses: OrderAddresses = [ @@ -83,6 +84,7 @@ export class ExchangeWrapper extends ContractWrapper { constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper) { super(web3Wrapper); this._tokenWrapper = tokenWrapper; + this._orderValidationUtils = new OrderValidationUtils(tokenWrapper); this._exchangeLogEventEmitters = []; } /** @@ -662,8 +664,8 @@ export class ExchangeWrapper extends ContractWrapper { throw new Error(ExchangeContractErrs.OrderFillExpired); } const zrxTokenAddress = await this._getZRXTokenAddressAsync(signedOrder.exchangeContractAddress); - await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync( - this._tokenWrapper, signedOrder, fillTakerAmount, senderAddress, zrxTokenAddress, + await this._orderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync( + signedOrder, fillTakerAmount, senderAddress, zrxTokenAddress, ); const wouldRoundingErrorOccur = await this._isRoundingErrorAsync( |