aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-report
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-03-01 08:13:03 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-03-01 08:39:23 +0800
commit17328bce53d67da4f99ca8e803b209350f1d2e0d (patch)
treed7368ed9389eed4581eca88306de2aa701bff042 /packages/sra-report
parenta3c7af95e17dda91efaff83824c43f8ffb28f078 (diff)
downloaddexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.tar
dexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.tar.gz
dexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.tar.bz2
dexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.tar.lz
dexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.tar.xz
dexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.tar.zst
dexon-sol-tools-17328bce53d67da4f99ca8e803b209350f1d2e0d.zip
Add more globals
Diffstat (limited to 'packages/sra-report')
-rw-r--r--packages/sra-report/src/postman_environment_factory.ts25
1 files changed, 10 insertions, 15 deletions
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;
},