aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-03-07 07:34:32 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-03-07 07:34:32 +0800
commitd39af6c9eb71501ec3a41bf12a3b0bb5d336ce46 (patch)
tree37c1419ca2b9087b608ad302970545af0163ce73
parent1789025da912aee536f0d9c9cbb66a56492251fc (diff)
downloaddexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.tar
dexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.tar.gz
dexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.tar.bz2
dexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.tar.lz
dexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.tar.xz
dexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.tar.zst
dexon-sol-tools-d39af6c9eb71501ec3a41bf12a3b0bb5d336ce46.zip
Print error message when no orders are found from /orders
-rw-r--r--packages/sra-report/src/postman_environment_factory.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts
index 91fbb5d2c..066e9ac04 100644
--- a/packages/sra-report/src/postman_environment_factory.ts
+++ b/packages/sra-report/src/postman_environment_factory.ts
@@ -1,10 +1,12 @@
import { SignedOrder, ZeroEx } from '0x.js';
import { HttpClient } from '@0xproject/connect';
import { Schema, schemas as schemasByName } from '@0xproject/json-schemas';
+import chalk from 'chalk';
import * as _ from 'lodash';
import { addresses as kovanAddresses } from './contract_addresses/kovan_addresses';
import { addresses as mainnetAddresses } from './contract_addresses/mainnet_addresses';
+import { utils } from './utils';
interface EnvironmentValue {
key: string;
@@ -61,7 +63,6 @@ function createContractAddressEnvironmentValues(networkId: number) {
createEnvironmentValue('exchangeContractAddress', contractAddresses.EXCHANGE),
];
}
-
async function createOrderEnvironmentValuesAsync(url: string) {
const httpClient = new HttpClient(url);
const orders = await httpClient.getOrdersAsync();
@@ -75,6 +76,7 @@ async function createOrderEnvironmentValuesAsync(url: string) {
createEnvironmentValue('orderHash', ZeroEx.getOrderHashHex(orderIfExists)),
];
} else {
+ utils.log(`${chalk.red(`No orders from /orders found`)}`);
return [
createEnvironmentValue('order', ''),
createEnvironmentValue('orderMaker', ''),