From 7a66da5a51603d4d87d644f3635f8c7f1d00bb36 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Mon, 2 Apr 2018 15:28:56 -0700 Subject: Fix build errors --- .../contracts/current/protocol/Exchange/MixinExchangeCore.sol | 2 +- packages/contracts/src/utils/exchange_wrapper.ts | 10 ++-------- packages/contracts/src/utils/log_decoder.ts | 7 +++---- 3 files changed, 6 insertions(+), 13 deletions(-) (limited to 'packages/contracts/src') diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index a42519850..82c1cc33a 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -134,7 +134,7 @@ contract MixinExchangeCore is // Validate order is not cancelled if (order.salt < makerEpoch[order.makerAddress]) { - LogError(uint8(Errors.ORDER_FULLY_FILLED_OR_CANCELLED), orderHash); + LogError(uint8(Errors.ORDER_CANCELLED), orderHash); return 0; } diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts index bbe9a1baf..179fe44a5 100644 --- a/packages/contracts/src/utils/exchange_wrapper.ts +++ b/packages/contracts/src/utils/exchange_wrapper.ts @@ -154,14 +154,8 @@ export class ExchangeWrapper { const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash); return tx; } - public async cancelOrdersUpToAsync( - salt: BigNumber, - from: string, - ): Promise { - const txHash = await this._exchange.cancelOrdersUpTo.sendTransactionAsync( - salt, - { from }, - ); + public async cancelOrdersUpToAsync(salt: BigNumber, from: string): Promise { + const txHash = await this._exchange.cancelOrdersUpTo.sendTransactionAsync(salt, { from }); const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash); return tx; } diff --git a/packages/contracts/src/utils/log_decoder.ts b/packages/contracts/src/utils/log_decoder.ts index 845e025fe..291b85dd2 100644 --- a/packages/contracts/src/utils/log_decoder.ts +++ b/packages/contracts/src/utils/log_decoder.ts @@ -1,7 +1,6 @@ -import { LogWithDecodedArgs, RawLog } from '@0xproject/types'; +import { AbiDefinition, LogEntry, LogWithDecodedArgs, RawLog } from '@0xproject/types'; import { AbiDecoder, BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import { artifacts } from './artifacts'; import { Artifact } from './types'; @@ -12,7 +11,7 @@ export class LogDecoder { if (_.isUndefined(networkIdIfExists)) { throw new Error('networkId not specified'); } - const abiArrays: Web3.AbiDefinition[][] = []; + const abiArrays: AbiDefinition[][] = []; _.forEach(artifacts, (artifact: Artifact) => { const networkIfExists = artifact.networks[networkIdIfExists]; if (_.isUndefined(networkIfExists)) { @@ -22,7 +21,7 @@ export class LogDecoder { }); this._abiDecoder = new AbiDecoder(abiArrays); } - public decodeLogOrThrow(log: Web3.LogEntry): LogWithDecodedArgs | RawLog { + public decodeLogOrThrow(log: LogEntry): LogWithDecodedArgs | RawLog { const logWithDecodedArgsOrLog = this._abiDecoder.tryToDecodeLogOrNoop(log); if (_.isUndefined((logWithDecodedArgsOrLog as LogWithDecodedArgs).args)) { throw new Error(`Unable to decode log: ${JSON.stringify(log)}`); -- cgit v1.2.3