diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-14 16:36:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 16:36:13 +0800 |
commit | 58fa35641d3016ef106496c929e48febcf827dc6 (patch) | |
tree | 3f33c2faac3b55e52098ab0b5b9883a9b62f5aee /packages/contract-wrappers | |
parent | 6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (diff) | |
parent | b74957acdfc8d67d154bcb4698acd7575db7cc47 (diff) | |
download | dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.tar dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.tar.gz dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.tar.bz2 dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.tar.lz dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.tar.xz dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.tar.zst dexon-sol-tools-58fa35641d3016ef106496c929e48febcf827dc6.zip |
Merge pull request #585 from 0xProject/feature/typedef
Add missing type definitions. Enable typedef linter rule
Diffstat (limited to 'packages/contract-wrappers')
-rw-r--r-- | packages/contract-wrappers/src/utils/assert.ts | 2 | ||||
-rw-r--r-- | packages/contract-wrappers/src/utils/decorators.ts | 4 | ||||
-rw-r--r-- | packages/contract-wrappers/src/utils/order_validation_utils.ts | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/packages/contract-wrappers/src/utils/assert.ts b/packages/contract-wrappers/src/utils/assert.ts index 2588a4d09..c74ed341f 100644 --- a/packages/contract-wrappers/src/utils/assert.ts +++ b/packages/contract-wrappers/src/utils/assert.ts @@ -12,7 +12,7 @@ import { isValidSignature } from '@0xproject/order-utils'; export const assert = { ...sharedAssert, - isValidSignature(orderHash: string, ecSignature: ECSignature, signerAddress: string) { + isValidSignature(orderHash: string, ecSignature: ECSignature, signerAddress: string): void { const isValid = isValidSignature(orderHash, ecSignature, signerAddress); this.assert(isValid, `Expected order with hash '${orderHash}' to have a valid signature`); }, diff --git a/packages/contract-wrappers/src/utils/decorators.ts b/packages/contract-wrappers/src/utils/decorators.ts index 64123143c..494575e7b 100644 --- a/packages/contract-wrappers/src/utils/decorators.ts +++ b/packages/contract-wrappers/src/utils/decorators.ts @@ -39,7 +39,7 @@ const asyncErrorHandlerFactory = (errorTransformer: ErrorTransformer) => { // Do not use arrow syntax here. Use a function expression in // order to use the correct value of `this` in this method // tslint:disable-next-line:only-arrow-functions - descriptor.value = async function(...args: any[]) { + descriptor.value = async function(...args: any[]): Promise<any> { try { const result = await originalMethod.apply(this, args); return result; @@ -66,7 +66,7 @@ const syncErrorHandlerFactory = (errorTransformer: ErrorTransformer) => { // Do not use arrow syntax here. Use a function expression in // order to use the correct value of `this` in this method // tslint:disable-next-line:only-arrow-functions - descriptor.value = function(...args: any[]) { + descriptor.value = function(...args: any[]): any { try { const result = originalMethod.apply(this, args); return result; diff --git a/packages/contract-wrappers/src/utils/order_validation_utils.ts b/packages/contract-wrappers/src/utils/order_validation_utils.ts index 36dfbd800..362c605de 100644 --- a/packages/contract-wrappers/src/utils/order_validation_utils.ts +++ b/packages/contract-wrappers/src/utils/order_validation_utils.ts @@ -86,12 +86,12 @@ export class OrderValidationUtils { private static _validateRemainingFillAmountNotZeroOrThrow( takerTokenAmount: BigNumber, unavailableTakerTokenAmount: BigNumber, - ) { + ): void { if (takerTokenAmount.eq(unavailableTakerTokenAmount)) { throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero); } } - private static _validateOrderNotExpiredOrThrow(expirationUnixTimestampSec: BigNumber) { + private static _validateOrderNotExpiredOrThrow(expirationUnixTimestampSec: BigNumber): void { const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec(); if (expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) { throw new Error(ExchangeContractErrs.OrderFillExpired); |