diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/sra-report/src/index.ts | 5 | ||||
-rw-r--r-- | packages/sra-report/src/postman_environment_factory.ts | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/packages/sra-report/src/index.ts b/packages/sra-report/src/index.ts index fade07095..bee9db192 100644 --- a/packages/sra-report/src/index.ts +++ b/packages/sra-report/src/index.ts @@ -1,6 +1,4 @@ #!/usr/bin/env node - -import { ZeroEx } from '0x.js'; import { assert } from '@0xproject/assert'; import { HttpClient } from '@0xproject/connect'; import { Schema, schemas } from '@0xproject/json-schemas'; @@ -62,10 +60,9 @@ const mainAsync = async () => { if (_.isUndefined(firstOrder)) { throw new Error('Could not get any orders from /orders endpoint'); } - const orderHash = ZeroEx.getOrderHashHex(firstOrder); const newmanEnvironmentOptions = { collection: sraReportCollectionJSON, - globals: postmanEnvironmentFactory.createGlobalEnvironment(args.url, orderHash), + globals: postmanEnvironmentFactory.createGlobalEnvironment(args.url, firstOrder), environment: postmanEnvironmentFactory.createNetworkEnvironment(args.networkId), }; const newmanReporterOptions = !_.isUndefined(args.output) diff --git a/packages/sra-report/src/postman_environment_factory.ts b/packages/sra-report/src/postman_environment_factory.ts index b0b69ddad..bea805ca6 100644 --- a/packages/sra-report/src/postman_environment_factory.ts +++ b/packages/sra-report/src/postman_environment_factory.ts @@ -1,3 +1,7 @@ +import { + SignedOrder, + ZeroEx, + } from '0x.js'; import { Schema, schemas as schemasByName } from '@0xproject/json-schemas'; import * as _ from 'lodash'; @@ -12,9 +16,11 @@ interface EnvironmentValue { } export const postmanEnvironmentFactory = { - createGlobalEnvironment(url: string, orderHash: string) { - const urlEnvironmentValue = createEnvironmentValue('url', url); + 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) => { @@ -36,6 +42,7 @@ export const postmanEnvironmentFactory = { schemaEnvironmentValues, urlEnvironmentValue, schemaKeysEnvironmentValue, + orderEnvironmentValue, orderHashEnvironmentValue, ); const environment = { |