diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/order-watcher/src/utils | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/order-watcher/src/utils')
-rw-r--r-- | packages/order-watcher/src/utils/assert.ts | 23 | ||||
-rw-r--r-- | packages/order-watcher/src/utils/utils.ts | 11 |
2 files changed, 0 insertions, 34 deletions
diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts deleted file mode 100644 index ccfc7325c..000000000 --- a/packages/order-watcher/src/utils/assert.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { assert as sharedAssert } from '@0x/assert'; -// HACK: We need those two unused imports because they're actually used by sharedAssert which gets injected here -// tslint:disable:no-unused-variable -import { Schema } from '@0x/json-schemas'; -import { ECSignature } from '@0x/types'; -import { BigNumber } from '@0x/utils'; -// tslint:enable:no-unused-variable -import { Provider } from 'ethereum-types'; - -import { signatureUtils } from '@0x/order-utils'; - -export const assert = { - ...sharedAssert, - async isValidSignatureAsync( - provider: Provider, - orderHash: string, - signature: string, - signerAddress: string, - ): Promise<void> { - const isValid = await signatureUtils.isValidSignatureAsync(provider, orderHash, signature, signerAddress); - assert.assert(isValid, `Expected order with hash '${orderHash}' to have a valid signature`); - }, -}; diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts deleted file mode 100644 index 9c3849ff1..000000000 --- a/packages/order-watcher/src/utils/utils.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BigNumber } from '@0x/utils'; - -export const utils = { - getCurrentUnixTimestampSec(): BigNumber { - const milisecondsInASecond = 1000; - return new BigNumber(Date.now() / milisecondsInASecond).integerValue(); - }, - getCurrentUnixTimestampMs(): BigNumber { - return new BigNumber(Date.now()); - }, -}; |