aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-07-04 05:31:40 +0800
committerGitHub <noreply@github.com>2017-07-04 05:31:40 +0800
commit86c742cb11d0bb6a5ffb14275ce86be265b04cb8 (patch)
treecde0f449e90d108a3d715faf12d859487c236b6a /src/utils
parent92c6144b6a7a47402770cd6c1d33db7f4cb847ec (diff)
parentd4cef89587ef8ea0f7fbab1146c4524e8f588eac (diff)
downloaddexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.tar
dexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.tar.gz
dexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.tar.bz2
dexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.tar.lz
dexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.tar.xz
dexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.tar.zst
dexon-sol-tools-86c742cb11d0bb6a5ffb14275ce86be265b04cb8.zip
Merge branch 'master' into wrap-log-bignumber
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/assert.ts1
-rw-r--r--src/utils/schema_validator.ts2
-rw-r--r--src/utils/utils.ts7
3 files changed, 7 insertions, 3 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts
index 94b119d5a..38c1d4aae 100644
--- a/src/utils/assert.ts
+++ b/src/utils/assert.ts
@@ -2,6 +2,7 @@ import * as _ from 'lodash';
import * as BigNumber from 'bignumber.js';
import * as Web3 from 'web3';
import {Web3Wrapper} from '../web3_wrapper';
+import {Schema} from 'jsonschema';
import {SchemaValidator} from './schema_validator';
import {utils} from './utils';
diff --git a/src/utils/schema_validator.ts b/src/utils/schema_validator.ts
index 9097dce88..e3f911adb 100644
--- a/src/utils/schema_validator.ts
+++ b/src/utils/schema_validator.ts
@@ -1,4 +1,4 @@
-import {Validator, ValidatorResult} from 'jsonschema';
+import {Validator, ValidatorResult, Schema} from 'jsonschema';
import {ecSignatureSchema, ecSignatureParameterSchema} from '../schemas/ec_signature_schema';
import {orderSchema, signedOrderSchema} from '../schemas/order_schemas';
import {addressSchema, numberSchema} from '../schemas/basic_type_schemas';
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index bad5b6498..061e9f99a 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -22,6 +22,9 @@ export const utils = {
isParityNode(nodeVersion: string): boolean {
return _.includes(nodeVersion, 'Parity');
},
+ isTestRpc(nodeVersion: string): boolean {
+ return _.includes(nodeVersion, 'TestRPC');
+ },
isValidOrderHash(orderHashHex: string): boolean {
const isValid = /^0x[0-9A-F]{64}$/i.test(orderHashHex);
return isValid;
@@ -29,9 +32,9 @@ export const utils = {
spawnSwitchErr(name: string, value: any): Error {
return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
},
- getOrderHashHex(order: Order|SignedOrder, exchangeContractAddr: string): string {
+ getOrderHashHex(order: Order|SignedOrder): string {
const orderParts = [
- {value: exchangeContractAddr, type: SolidityTypes.address},
+ {value: order.exchangeContractAddress, type: SolidityTypes.address},
{value: order.maker, type: SolidityTypes.address},
{value: order.taker, type: SolidityTypes.address},
{value: order.makerTokenAddress, type: SolidityTypes.address},