aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils/exchange_wrapper.ts
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-05-12 05:51:00 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-05-19 08:01:06 +0800
commit5735095521aeda75b257236e34d6ec76c16df8ab (patch)
tree14ef56b89e5ca3105408fad7b98f3151571b4bc4 /packages/contracts/src/utils/exchange_wrapper.ts
parentfa7570352ce65dc58df6969c5a24cf3f487e738f (diff)
downloaddexon-sol-tools-5735095521aeda75b257236e34d6ec76c16df8ab.tar.gz
dexon-sol-tools-5735095521aeda75b257236e34d6ec76c16df8ab.tar.zst
dexon-sol-tools-5735095521aeda75b257236e34d6ec76c16df8ab.zip
Style changes to atomic order matching
Diffstat (limited to 'packages/contracts/src/utils/exchange_wrapper.ts')
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index 6d36198f2..5b026fce0 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -225,12 +225,6 @@ export class ExchangeWrapper {
const filledAmount = new BigNumber(await this._exchange.filled.callAsync(orderHashHex));
return filledAmount;
}
- private async _getTxWithDecodedExchangeLogsAsync(txHash: string) {
- const tx = await this._zeroEx.awaitTransactionMinedAsync(txHash);
- tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address);
- tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log));
- return tx;
- }
public async getOrderInfoAsync(
signedOrder: SignedOrder,
): Promise<[number /* orderStatus */, string /* orderHash */, BigNumber /* orderTakerAssetAmountFilled */]> {
@@ -251,6 +245,14 @@ export class ExchangeWrapper {
{ from },
);
const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash);
+ tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address);
+ tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log));
+ return tx;
+ }
+ private async _getTxWithDecodedExchangeLogsAsync(txHash: string) {
+ const tx = await this._zeroEx.awaitTransactionMinedAsync(txHash);
+ tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address);
+ tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log));
return tx;
}
}