From c02dfc4fb1bf39ceaaf80ec68fb8907a4a11e0df Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 26 Jan 2018 12:57:51 +0100 Subject: Fix tslint issues --- packages/0x.js/src/contract_wrappers/exchange_wrapper.ts | 4 ++-- packages/0x.js/src/order_watcher/order_state_watcher.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/0x.js') diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 5672f0360..fceab851a 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -844,9 +844,9 @@ export class ExchangeWrapper extends ContractWrapper { public throwLogErrorsAsErrors(logs: Array | Web3.LogEntry>): void { const errLog = _.find(logs, { event: ExchangeEvents.LogError, - }) as LogWithDecodedArgs | undefined; + }); if (!_.isUndefined(errLog)) { - const logArgs = errLog.args; + const logArgs = (errLog as LogWithDecodedArgs).args; const errCode = logArgs.errorId.toNumber(); const errMessage = this._exchangeContractErrCodesToMsg[errCode]; throw new Error(errMessage); diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts index 446fab676..576be00c8 100644 --- a/packages/0x.js/src/order_watcher/order_state_watcher.ts +++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts @@ -223,12 +223,12 @@ export class OrderStateWatcher { return; } const log = logIfExists as LogEvent; // At this moment we are sure that no error occured and log is defined. - const maybeDecodedLog = this._abiDecoder.tryToDecodeLogOrNoop(log); - const isLogDecoded = !_.isUndefined((maybeDecodedLog as LogWithDecodedArgs).event); + const maybeDecodedLog = this._abiDecoder.tryToDecodeLogOrNoop(log); + const isLogDecoded = !_.isUndefined(((maybeDecodedLog as any) as LogWithDecodedArgs).event); if (!isLogDecoded) { return; // noop } - const decodedLog = maybeDecodedLog as LogWithDecodedArgs; + const decodedLog = (maybeDecodedLog as any) as LogWithDecodedArgs; let makerToken: string; let makerAddress: string; switch (decodedLog.event) { -- cgit v1.2.3