From 17328bce53d67da4f99ca8e803b209350f1d2e0d Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 28 Feb 2018 16:13:03 -0800 Subject: Add more globals --- .../sra-report/src/postman_environment_factory.ts | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'packages/sra-report/src') diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index bea805ca6..a8753d9ff 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -1,7 +1,4 @@ -import { - SignedOrder, - ZeroEx, - } from '0x.js'; +import { SignedOrder, ZeroEx } from '0x.js'; import { Schema, schemas as schemasByName } from '@0xproject/json-schemas'; import * as _ from 'lodash'; @@ -17,10 +14,6 @@ interface EnvironmentValue { export const postmanEnvironmentFactory = { createGlobalEnvironment(url: string, order: SignedOrder) { - const orderHash = ZeroEx.getOrderHashHex(order); - const orderEnvironmentValue = createEnvironmentValue('order', JSON.stringify(order)); - const orderHashEnvironmentValue = createEnvironmentValue('orderHash', orderHash); - const urlEnvironmentValue = createEnvironmentValue('url', url); const schemas: Schema[] = _.values(schemasByName); const schemaEnvironmentValues = _.compact( _.map(schemas, (schema: Schema) => { @@ -37,16 +30,18 @@ export const postmanEnvironmentFactory = { const schemaKeys = _.map(schemaEnvironmentValues, (environmentValue: EnvironmentValue) => { return environmentValue.key; }); - const schemaKeysEnvironmentValue = createEnvironmentValue('schemaKeys', JSON.stringify(schemaKeys)); - const environmentValues = _.concat( + const allEnvironmentValues = _.concat( schemaEnvironmentValues, - urlEnvironmentValue, - schemaKeysEnvironmentValue, - orderEnvironmentValue, - orderHashEnvironmentValue, + createEnvironmentValue('schemaKeys', JSON.stringify(schemaKeys)), + createEnvironmentValue('url', url), + createEnvironmentValue('order', JSON.stringify(order)), + createEnvironmentValue('orderMaker', order.maker), + createEnvironmentValue('orderTaker', order.taker), + createEnvironmentValue('orderFeeRecipient', order.feeRecipient), + createEnvironmentValue('orderHash', ZeroEx.getOrderHashHex(order)), ); const environment = { - values: environmentValues, + values: allEnvironmentValues, }; return environment; }, -- cgit v1.2.3