diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-07-04 03:05:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-04 03:05:46 +0800 |
commit | 8204409c6d6bf773aa8ebb38006a3975ed43a684 (patch) | |
tree | 93dcf602b5a738bad03c121384707fcf19518310 /src | |
parent | 4bcad260244f5399c07530db7ac18a8335246e34 (diff) | |
parent | d506a1f98562dd11ecff5e936a93fce6d14e48a9 (diff) | |
download | dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.tar dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.tar.gz dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.tar.bz2 dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.tar.lz dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.tar.xz dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.tar.zst dexon-0x-contracts-8204409c6d6bf773aa8ebb38006a3975ed43a684.zip |
Merge branch 'master' into add-exchange-address-to-order-struct
Diffstat (limited to 'src')
-rw-r--r-- | src/0x.ts | 5 | ||||
-rw-r--r-- | src/utils/utils.ts | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -200,8 +200,9 @@ export class ZeroEx { let msgHashHex; const nodeVersion = await this._web3Wrapper.getNodeVersionAsync(); const isParityNode = utils.isParityNode(nodeVersion); - if (isParityNode) { - // Parity node adds the personalMessage prefix itself + const isTestRpc = utils.isTestRpc(nodeVersion); + if (isParityNode || isTestRpc) { + // Parity and TestRpc nodes add the personalMessage prefix itself msgHashHex = orderHash; } else { const orderHashBuff = ethUtil.toBuffer(orderHash); diff --git a/src/utils/utils.ts b/src/utils/utils.ts index a20fa2243..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; |