diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-20 19:24:09 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-20 19:24:09 +0800 |
commit | 5541327968ad6f974a37c49057253746f738a709 (patch) | |
tree | ace7aa83183ac1f05a432aed7f5516e1c29dba05 /packages/contracts/src/utils/core_combinatorial_utils.ts | |
parent | f35af1fb6d141d23506d418a4110752595ff0b3d (diff) | |
download | dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.tar dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.tar.gz dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.tar.bz2 dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.tar.lz dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.tar.xz dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.tar.zst dexon-0x-contracts-5541327968ad6f974a37c49057253746f738a709.zip |
Add ability for verbose logging
Diffstat (limited to 'packages/contracts/src/utils/core_combinatorial_utils.ts')
-rw-r--r-- | packages/contracts/src/utils/core_combinatorial_utils.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/contracts/src/utils/core_combinatorial_utils.ts b/packages/contracts/src/utils/core_combinatorial_utils.ts index cdb8e579d..cf87ad36f 100644 --- a/packages/contracts/src/utils/core_combinatorial_utils.ts +++ b/packages/contracts/src/utils/core_combinatorial_utils.ts @@ -7,7 +7,7 @@ import { OrderValidationUtils, } from '@0xproject/order-utils'; import { AssetProxyId, Order, SignatureType, SignedOrder } from '@0xproject/types'; -import { BigNumber, errorUtils } from '@0xproject/utils'; +import { BigNumber, errorUtils, logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import { BlockParamLiteral, LogWithDecodedArgs, Provider, TxData } from 'ethereum-types'; @@ -253,7 +253,11 @@ export class CoreCombinatorialUtils { this.exchangeWrapper = exchangeWrapper; this.assetWrapper = assetWrapper; } - public async testFillOrderScenarioAsync(provider: Provider, fillScenario: FillScenario): Promise<void> { + public async testFillOrderScenarioAsync( + provider: Provider, + fillScenario: FillScenario, + isVerbose: boolean = false, + ): Promise<void> { // 1. Generate order const order = this.orderFactory.generateOrder(fillScenario.orderScenario); @@ -304,6 +308,10 @@ export class CoreCombinatorialUtils { this.zrxAssetData, ); } catch (err) { + if (isVerbose) { + logUtils.log(`Expecting order to ${isFillFailureExpected ? 'fail' : 'succeed'} with:`); + logUtils.log(err); + } isFillFailureExpected = true; } |