From 13a61db2896074a939baa1769abef4c4917d4354 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 10 May 2018 15:22:51 +0200 Subject: Add var returns --- .../src/fetchers/simple_order_filled_cancelled_fetcher.ts | 8 +++++--- .../src/stores/order_filled_cancelled_lazy_store.ts | 8 +++++--- packages/dev-utils/src/callback_error_reporter.ts | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/contract-wrappers/src/fetchers/simple_order_filled_cancelled_fetcher.ts b/packages/contract-wrappers/src/fetchers/simple_order_filled_cancelled_fetcher.ts index b6f31b205..52d0a100c 100644 --- a/packages/contract-wrappers/src/fetchers/simple_order_filled_cancelled_fetcher.ts +++ b/packages/contract-wrappers/src/fetchers/simple_order_filled_cancelled_fetcher.ts @@ -25,10 +25,12 @@ export class SimpleOrderFilledCancelledFetcher implements AbstractOrderFilledCan const cancelledTakerAmount = this._exchangeWrapper.getCancelledTakerAmountAsync(orderHash, methodOpts); return cancelledTakerAmount; } - public async getUnavailableTakerAmountAsync(orderHash: string) { - return this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); + public async getUnavailableTakerAmountAsync(orderHash: string): Promise { + const unavailableTakerAmount = await this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); + return unavailableTakerAmount; } public getZRXTokenAddress(): string { - return this._exchangeWrapper.getZRXTokenAddress(); + const zrxToken = this._exchangeWrapper.getZRXTokenAddress(); + return zrxToken; } } diff --git a/packages/contract-wrappers/src/stores/order_filled_cancelled_lazy_store.ts b/packages/contract-wrappers/src/stores/order_filled_cancelled_lazy_store.ts index b554191a2..3d96a95f3 100644 --- a/packages/contract-wrappers/src/stores/order_filled_cancelled_lazy_store.ts +++ b/packages/contract-wrappers/src/stores/order_filled_cancelled_lazy_store.ts @@ -64,10 +64,12 @@ export class OrderFilledCancelledLazyStore implements AbstractOrderFilledCancell this._filledTakerAmount = {}; this._cancelledTakerAmount = {}; } - public async getUnavailableTakerAmountAsync(orderHash: string) { - return this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); + public async getUnavailableTakerAmountAsync(orderHash: string): Promise { + const unavailableTakerAmount = await this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash); + return unavailableTakerAmount; } public getZRXTokenAddress(): string { - return this._exchangeWrapper.getZRXTokenAddress(); + const zrxToken = this._exchangeWrapper.getZRXTokenAddress(); + return zrxToken; } } diff --git a/packages/dev-utils/src/callback_error_reporter.ts b/packages/dev-utils/src/callback_error_reporter.ts index 874343ccc..c8e693673 100644 --- a/packages/dev-utils/src/callback_error_reporter.ts +++ b/packages/dev-utils/src/callback_error_reporter.ts @@ -7,7 +7,7 @@ const expect = chai.expect; export const callbackErrorReporter = { reportNoErrorCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) { - return (f?: (value: T) => void) => { + const callback = (f?: (value: T) => void) => { const wrapped = (value: T) => { if (_.isUndefined(f)) { done(); @@ -24,9 +24,10 @@ export const callbackErrorReporter = { }; return wrapped; }; + return callback; }, reportNodeCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) { - return (f?: (value: T) => void) => { + const callback = (f?: (value: T) => void) => { const wrapped = (error: Error | null, value: T | undefined) => { if (!_.isNull(error)) { done(error); @@ -47,6 +48,7 @@ export const callbackErrorReporter = { }; return wrapped; }; + return callback; }, assertNodeCallbackError(done: DoneCallback, errMsg: string) { const wrapped = (error: Error | null, value: T | undefined) => { -- cgit v1.2.3