Add var returns

This commit is contained in:
Fabio Berger
2018-05-10 15:22:51 +02:00
parent 93b74cc766
commit 13a61db289
3 changed files with 14 additions and 8 deletions

View File

@@ -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<BigNumber> {
const unavailableTakerAmount = await this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash);
return unavailableTakerAmount;
}
public getZRXTokenAddress(): string {
return this._exchangeWrapper.getZRXTokenAddress();
const zrxToken = this._exchangeWrapper.getZRXTokenAddress();
return zrxToken;
}
}

View File

@@ -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<BigNumber> {
const unavailableTakerAmount = await this._exchangeWrapper.getUnavailableTakerAmountAsync(orderHash);
return unavailableTakerAmount;
}
public getZRXTokenAddress(): string {
return this._exchangeWrapper.getZRXTokenAddress();
const zrxToken = this._exchangeWrapper.getZRXTokenAddress();
return zrxToken;
}
}

View File

@@ -7,7 +7,7 @@ const expect = chai.expect;
export const callbackErrorReporter = {
reportNoErrorCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) {
return <T>(f?: (value: T) => void) => {
const callback = <T>(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 <T>(f?: (value: T) => void) => {
const callback = <T>(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 = <T>(error: Error | null, value: T | undefined) => {