aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/utils.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-01 02:08:28 +0800
committerFabio Berger <me@fabioberger.com>2017-06-01 02:08:28 +0800
commit595656d3fc06a221274eb6bee89e7ba6e4e8ae61 (patch)
tree7fe822899556285ab9ea6dbde055aa4a927373ee /src/utils/utils.ts
parent9364c5647ff5518aaa2b3fcd133a9e6c47ec0eda (diff)
downloaddexon-0x-contracts-595656d3fc06a221274eb6bee89e7ba6e4e8ae61.tar.gz
dexon-0x-contracts-595656d3fc06a221274eb6bee89e7ba6e4e8ae61.tar.zst
dexon-0x-contracts-595656d3fc06a221274eb6bee89e7ba6e4e8ae61.zip
Move isValidOrderHash to utils and implement assert.isValidOrderHash
Diffstat (limited to 'src/utils/utils.ts')
-rw-r--r--src/utils/utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index 336eaf7bb..e6840a624 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -18,4 +18,8 @@ export const utils = {
isParityNode(nodeVersion: string): boolean {
return _.includes(nodeVersion, 'Parity');
},
+ isValidOrderHash(orderHashHex: string) {
+ const isValid = /^0x[0-9A-F]{64}$/i.test(orderHashHex);
+ return isValid;
+ },
};