From 857a35d4f71c1c954033c3b0505250e18be21cfb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 9 Nov 2018 00:45:48 +0100 Subject: Fix validateOrderFillableOrThrowAsync method so it also checks order signature, cancelled, cancelledUpTo, and throws helpful error messages --- .../abstract_order_filled_cancelled_fetcher.ts | 3 +- .../abstract_order_filled_cancelled_lazy_store.ts | 3 +- packages/order-utils/src/order_state_utils.ts | 4 +-- packages/order-utils/src/order_validation_utils.ts | 35 +++++++++++----------- .../src/store/order_filled_cancelled_lazy_store.ts | 7 +++-- .../order-utils/test/order_state_utils_test.ts | 3 +- 6 files changed, 31 insertions(+), 24 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts index de096b7d9..9e240f9ef 100644 --- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts +++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts @@ -1,3 +1,4 @@ +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; /** @@ -17,6 +18,6 @@ export abstract class AbstractOrderFilledCancelledFetcher { * @param orderHash OrderHash of order we are interested in * @return Whether or not the order is cancelled */ - public abstract async isOrderCancelledAsync(orderHash: string): Promise; + public abstract async isOrderCancelledAsync(signedOrder: SignedOrder): Promise; public abstract getZRXAssetData(): string; } diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts index d9e66db06..186521401 100644 --- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts +++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts @@ -1,8 +1,9 @@ +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; export abstract class AbstractOrderFilledCancelledLazyStore { public abstract async getFilledTakerAmountAsync(orderHash: string): Promise; - public abstract async getIsCancelledAsync(orderHash: string): Promise; + public abstract async getIsCancelledAsync(signedOrder: SignedOrder): Promise; public abstract setFilledTakerAmount(orderHash: string, balance: BigNumber): void; public abstract deleteFilledTakerAmount(orderHash: string): void; public abstract setIsCancelled(orderHash: string, isCancelled: boolean): void; diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts index 159aeeb09..fe0d6c773 100644 --- a/packages/order-utils/src/order_state_utils.ts +++ b/packages/order-utils/src/order_state_utils.ts @@ -117,7 +117,7 @@ export class OrderStateUtils { public async getOpenOrderStateAsync(signedOrder: SignedOrder, transactionHash?: string): Promise { const orderRelevantState = await this.getOpenOrderRelevantStateAsync(signedOrder); const orderHash = orderHashUtils.getOrderHashHex(signedOrder); - const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash); + const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder); const sidedOrderRelevantState = { isMakerSide: true, traderBalance: orderRelevantState.makerBalance, @@ -256,7 +256,7 @@ export class OrderStateUtils { const filledTakerAssetAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash); const totalMakerAssetAmount = signedOrder.makerAssetAmount; const totalTakerAssetAmount = signedOrder.takerAssetAmount; - const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash); + const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder); const remainingTakerAssetAmount = isOrderCancelled ? new BigNumber(0) : totalTakerAssetAmount.minus(filledTakerAssetAmount); diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index a40069f63..766fbaf0f 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -109,14 +109,6 @@ export class OrderValidationUtils { throw new Error(RevertReason.TransferFailed); } } - private static _validateRemainingFillAmountNotZeroOrThrow( - takerAssetAmount: BigNumber, - filledTakerTokenAmount: BigNumber, - ): void { - if (takerAssetAmount.eq(filledTakerTokenAmount)) { - throw new Error(RevertReason.OrderUnfillable); - } - } private static _validateOrderNotExpiredOrThrow(expirationTimeSeconds: BigNumber): void { const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec(); if (expirationTimeSeconds.lessThan(currentUnixTimestampSec)) { @@ -125,12 +117,15 @@ export class OrderValidationUtils { } /** * Instantiate OrderValidationUtils - * @param orderFilledCancelledFetcher A module that implements the AbstractOrderFilledCancelledFetcher + * @param orderFilledCancelledFetcher A module that implements the AbstractOrderInfoFetcher * @return An instance of OrderValidationUtils */ constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher) { this._orderFilledCancelledFetcher = orderFilledCancelledFetcher; } + // TODO(fabio): remove this method once the smart contracts have been refactored + // to return helpful revert reasons instead of ORDER_UNFILLABLE. Instruct devs + // to make "calls" to validate order fillability + getOrderInfo for fillable amount. /** * Validate if the supplied order is fillable, and throw if it isn't * @param exchangeTradeEmulator ExchangeTradeEmulator instance @@ -146,12 +141,19 @@ export class OrderValidationUtils { expectedFillTakerTokenAmount?: BigNumber, ): Promise { const orderHash = orderHashUtils.getOrderHashHex(signedOrder); + const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder); + if (isCancelled) { + throw new Error('CANCELLED'); + } const filledTakerTokenAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash); - OrderValidationUtils._validateRemainingFillAmountNotZeroOrThrow( - signedOrder.takerAssetAmount, - filledTakerTokenAmount, - ); + if (signedOrder.takerAssetAmount.eq(filledTakerTokenAmount)) { + throw new Error('FULLY_FILLED'); + } + try { OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds); + } catch (err) { + throw new Error('EXPIRED'); + } let fillTakerAssetAmount = signedOrder.takerAssetAmount.minus(filledTakerTokenAmount); if (!_.isUndefined(expectedFillTakerTokenAmount)) { fillTakerAssetAmount = expectedFillTakerTokenAmount; @@ -198,10 +200,9 @@ export class OrderValidationUtils { throw new Error(OrderError.InvalidSignature); } const filledTakerTokenAmount = await this._orderFilledCancelledFetcher.getFilledTakerAmountAsync(orderHash); - OrderValidationUtils._validateRemainingFillAmountNotZeroOrThrow( - signedOrder.takerAssetAmount, - filledTakerTokenAmount, - ); + if (signedOrder.takerAssetAmount.eq(filledTakerTokenAmount)) { + throw new Error(RevertReason.OrderUnfillable); + } if (signedOrder.takerAddress !== constants.NULL_ADDRESS && signedOrder.takerAddress !== takerAddress) { throw new Error(RevertReason.InvalidTaker); } diff --git a/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts b/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts index 1d84ffdaa..afd6f1108 100644 --- a/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts +++ b/packages/order-utils/src/store/order_filled_cancelled_lazy_store.ts @@ -1,8 +1,10 @@ +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; import { AbstractOrderFilledCancelledFetcher } from '../abstract/abstract_order_filled_cancelled_fetcher'; import { AbstractOrderFilledCancelledLazyStore } from '../abstract/abstract_order_filled_cancelled_lazy_store'; +import { orderHashUtils } from '../order_hash'; /** * Copy on read store for balances/proxyAllowances of tokens/accounts @@ -58,9 +60,10 @@ export class OrderFilledCancelledLazyStore implements AbstractOrderFilledCancell * @param orderHash OrderHash from order of interest * @return Whether the order has been cancelled */ - public async getIsCancelledAsync(orderHash: string): Promise { + public async getIsCancelledAsync(signedOrder: SignedOrder): Promise { + const orderHash = orderHashUtils.getOrderHashHex(signedOrder); if (_.isUndefined(this._isCancelled[orderHash])) { - const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash); + const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder); this.setIsCancelled(orderHash, isCancelled); } const cachedIsCancelled = this._isCancelled[orderHash]; // tslint:disable-line:boolean-naming diff --git a/packages/order-utils/test/order_state_utils_test.ts b/packages/order-utils/test/order_state_utils_test.ts index 39c4c362f..42acd54c6 100644 --- a/packages/order-utils/test/order_state_utils_test.ts +++ b/packages/order-utils/test/order_state_utils_test.ts @@ -1,3 +1,4 @@ +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import 'mocha'; @@ -33,7 +34,7 @@ describe('OrderStateUtils', () => { async getFilledTakerAmountAsync(_orderHash: string): Promise { return filledAmount; }, - async isOrderCancelledAsync(_orderHash: string): Promise { + async isOrderCancelledAsync(_signedOrder: SignedOrder): Promise { return cancelled; }, getZRXAssetData(): string { -- cgit v1.2.3 From 57318a6ef22876a8c73321b7cc281302bbd67a3b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 9 Nov 2018 00:46:07 +0100 Subject: Remove unused validateFillOrKill method --- packages/order-utils/src/order_validation_utils.ts | 31 +--------------------- 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index 766fbaf0f..0af82f5cc 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -150,7 +150,7 @@ export class OrderValidationUtils { throw new Error('FULLY_FILLED'); } try { - OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds); + OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds); } catch (err) { throw new Error('EXPIRED'); } @@ -229,33 +229,4 @@ export class OrderValidationUtils { } return filledTakerTokenAmount; } - /** - * Validate a call to fillOrKillOrder and throw if it would fail - * @param exchangeTradeEmulator ExchangeTradeEmulator to use - * @param provider Web3 provider to use for JSON RPC requests - * @param signedOrder SignedOrder of interest - * @param fillTakerAssetAmount Amount we'd like to fill the order for - * @param takerAddress The taker of the order - * @param zrxAssetData ZRX asset data - */ - public async validateFillOrKillOrderThrowIfInvalidAsync( - exchangeTradeEmulator: ExchangeTransferSimulator, - provider: Provider, - signedOrder: SignedOrder, - fillTakerAssetAmount: BigNumber, - takerAddress: string, - zrxAssetData: string, - ): Promise { - const filledTakerTokenAmount = await this.validateFillOrderThrowIfInvalidAsync( - exchangeTradeEmulator, - provider, - signedOrder, - fillTakerAssetAmount, - takerAddress, - zrxAssetData, - ); - if (filledTakerTokenAmount !== fillTakerAssetAmount) { - throw new Error(RevertReason.OrderUnfillable); - } - } } -- cgit v1.2.3 From 3980bf39a9ae8cb5b5cc3cbc33b6e84d1bcf6c28 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 9 Nov 2018 18:50:25 +0100 Subject: Keep more helpful error messages, and stop swallowing errors when returning contract error --- packages/order-utils/src/order_validation_utils.ts | 131 +++++++++++---------- 1 file changed, 72 insertions(+), 59 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index 0af82f5cc..345e9099e 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -1,4 +1,4 @@ -import { RevertReason, SignedOrder } from '@0x/types'; +import { ExchangeContractErrs, RevertReason, SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { Provider } from 'ethereum-types'; import * as _ from 'lodash'; @@ -57,57 +57,53 @@ export class OrderValidationUtils { senderAddress: string, zrxAssetData: string, ): Promise { - try { - const fillMakerTokenAmount = utils.getPartialAmountFloor( - fillTakerAssetAmount, - signedOrder.takerAssetAmount, - signedOrder.makerAssetAmount, - ); - await exchangeTradeEmulator.transferFromAsync( - signedOrder.makerAssetData, - signedOrder.makerAddress, - senderAddress, - fillMakerTokenAmount, - TradeSide.Maker, - TransferType.Trade, - ); - await exchangeTradeEmulator.transferFromAsync( - signedOrder.takerAssetData, - senderAddress, - signedOrder.makerAddress, - fillTakerAssetAmount, - TradeSide.Taker, - TransferType.Trade, - ); - const makerFeeAmount = utils.getPartialAmountFloor( - fillTakerAssetAmount, - signedOrder.takerAssetAmount, - signedOrder.makerFee, - ); - await exchangeTradeEmulator.transferFromAsync( - zrxAssetData, - signedOrder.makerAddress, - signedOrder.feeRecipientAddress, - makerFeeAmount, - TradeSide.Maker, - TransferType.Fee, - ); - const takerFeeAmount = utils.getPartialAmountFloor( - fillTakerAssetAmount, - signedOrder.takerAssetAmount, - signedOrder.takerFee, - ); - await exchangeTradeEmulator.transferFromAsync( - zrxAssetData, - senderAddress, - signedOrder.feeRecipientAddress, - takerFeeAmount, - TradeSide.Taker, - TransferType.Fee, - ); - } catch (err) { - throw new Error(RevertReason.TransferFailed); - } + const fillMakerTokenAmount = utils.getPartialAmountFloor( + fillTakerAssetAmount, + signedOrder.takerAssetAmount, + signedOrder.makerAssetAmount, + ); + await exchangeTradeEmulator.transferFromAsync( + signedOrder.makerAssetData, + signedOrder.makerAddress, + senderAddress, + fillMakerTokenAmount, + TradeSide.Maker, + TransferType.Trade, + ); + await exchangeTradeEmulator.transferFromAsync( + signedOrder.takerAssetData, + senderAddress, + signedOrder.makerAddress, + fillTakerAssetAmount, + TradeSide.Taker, + TransferType.Trade, + ); + const makerFeeAmount = utils.getPartialAmountFloor( + fillTakerAssetAmount, + signedOrder.takerAssetAmount, + signedOrder.makerFee, + ); + await exchangeTradeEmulator.transferFromAsync( + zrxAssetData, + signedOrder.makerAddress, + signedOrder.feeRecipientAddress, + makerFeeAmount, + TradeSide.Maker, + TransferType.Fee, + ); + const takerFeeAmount = utils.getPartialAmountFloor( + fillTakerAssetAmount, + signedOrder.takerAssetAmount, + signedOrder.takerFee, + ); + await exchangeTradeEmulator.transferFromAsync( + zrxAssetData, + senderAddress, + signedOrder.feeRecipientAddress, + takerFeeAmount, + TradeSide.Taker, + TransferType.Fee, + ); } private static _validateOrderNotExpiredOrThrow(expirationTimeSeconds: BigNumber): void { const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec(); @@ -211,13 +207,30 @@ export class OrderValidationUtils { const desiredFillTakerTokenAmount = remainingTakerTokenAmount.lessThan(fillTakerAssetAmount) ? remainingTakerTokenAmount : fillTakerAssetAmount; - await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync( - exchangeTradeEmulator, - signedOrder, - desiredFillTakerTokenAmount, - takerAddress, - zrxAssetData, - ); + try { + await OrderValidationUtils.validateFillOrderBalancesAllowancesThrowIfInvalidAsync( + exchangeTradeEmulator, + signedOrder, + desiredFillTakerTokenAmount, + takerAddress, + zrxAssetData, + ); + } catch (err) { + const transferFailedErrorMessages = [ + ExchangeContractErrs.InsufficientMakerBalance, + ExchangeContractErrs.InsufficientMakerFeeBalance, + ExchangeContractErrs.InsufficientTakerBalance, + ExchangeContractErrs.InsufficientTakerFeeBalance, + ExchangeContractErrs.InsufficientMakerAllowance, + ExchangeContractErrs.InsufficientMakerFeeAllowance, + ExchangeContractErrs.InsufficientTakerAllowance, + ExchangeContractErrs.InsufficientTakerFeeAllowance, + ]; + if (_.includes(transferFailedErrorMessages, err.message)) { + throw new Error(RevertReason.TransferFailed); + } + throw err; + } const wouldRoundingErrorOccur = OrderValidationUtils.isRoundingErrorFloor( desiredFillTakerTokenAmount, -- cgit v1.2.3 From 53d0f5b98ebd132d51b1fdf463fe57481c895ec4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 9 Nov 2018 23:15:34 +0100 Subject: Revert comment change --- packages/order-utils/src/order_validation_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index 345e9099e..2150e643f 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -113,7 +113,7 @@ export class OrderValidationUtils { } /** * Instantiate OrderValidationUtils - * @param orderFilledCancelledFetcher A module that implements the AbstractOrderInfoFetcher + * @param orderFilledCancelledFetcher A module that implements the AbstractOrderFilledCancelledFetcher * @return An instance of OrderValidationUtils */ constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher) { -- cgit v1.2.3 From 1f0ac47bd97b88071a6380a728cfdb1457c2590c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 10 Nov 2018 00:14:48 +0100 Subject: Move signature validation into OrderValidationUtils.validateOrderFillableOrThrowAsync --- packages/order-utils/src/order_validation_utils.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index 2150e643f..ca4c32543 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -17,6 +17,7 @@ import { utils } from './utils'; */ export class OrderValidationUtils { private readonly _orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher; + private readonly _provider: Provider; /** * A Typescript implementation mirroring the implementation of isRoundingError in the * Exchange smart contract @@ -116,8 +117,9 @@ export class OrderValidationUtils { * @param orderFilledCancelledFetcher A module that implements the AbstractOrderFilledCancelledFetcher * @return An instance of OrderValidationUtils */ - constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher) { + constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher, provider: Provider) { this._orderFilledCancelledFetcher = orderFilledCancelledFetcher; + this._provider = provider; } // TODO(fabio): remove this method once the smart contracts have been refactored // to return helpful revert reasons instead of ORDER_UNFILLABLE. Instruct devs @@ -137,6 +139,16 @@ export class OrderValidationUtils { expectedFillTakerTokenAmount?: BigNumber, ): Promise { const orderHash = orderHashUtils.getOrderHashHex(signedOrder); + const isValidSignature = await signatureUtils.isValidSignatureAsync( + this._provider, + orderHash, + signedOrder.signature, + signedOrder.makerAddress, + ); + if (!isValidSignature) { + throw new Error('INVALID_ORDER_SIGNATURE'); + } + const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder); if (isCancelled) { throw new Error('CANCELLED'); -- cgit v1.2.3 From fd7ba3ecea72487ecbec428c31b5547f8691ca23 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 12 Nov 2018 10:22:22 +0100 Subject: Use RevertReason when possible --- packages/order-utils/src/order_validation_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index ca4c32543..ae4291ea8 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -146,7 +146,7 @@ export class OrderValidationUtils { signedOrder.makerAddress, ); if (!isValidSignature) { - throw new Error('INVALID_ORDER_SIGNATURE'); + throw new Error(RevertReason.InvalidOrderSignature); } const isCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(signedOrder); -- cgit v1.2.3 From 348556a54442fc93d76536735b8e8e4d76ed5ce6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 12 Nov 2018 12:07:19 +0100 Subject: Add fixes affecting the public interface to the CHANGELOGs --- packages/order-utils/CHANGELOG.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'packages/order-utils') diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index abcf3d392..0ed6117df 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -1,4 +1,29 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": + "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`", + "pr": 1235 + }, + { + "note": + "Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive", + "pr": 1235 + }, + { + "note": + "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)", + "pr": 1235 + }, + { + "note": + "Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param", + "pr": 1235 + } + ] + }, { "version": "2.0.1", "changes": [ -- cgit v1.2.3 From 085d34834b8af5a96090d078929fedcabba95a9a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 12 Nov 2018 14:30:14 +0100 Subject: Updated CHANGELOGS --- packages/order-utils/CHANGELOG.json | 3 ++- packages/order-utils/CHANGELOG.md | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/CHANGELOG.json b/packages/order-utils/CHANGELOG.json index 0ed6117df..6ce3169d5 100644 --- a/packages/order-utils/CHANGELOG.json +++ b/packages/order-utils/CHANGELOG.json @@ -22,7 +22,8 @@ "Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param", "pr": 1235 } - ] + ], + "timestamp": 1542028948 }, { "version": "2.0.1", diff --git a/packages/order-utils/CHANGELOG.md b/packages/order-utils/CHANGELOG.md index 31bd02595..eaa74d6ce 100644 --- a/packages/order-utils/CHANGELOG.md +++ b/packages/order-utils/CHANGELOG.md @@ -5,6 +5,13 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.0.0 - _November 12, 2018_ + + * Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync` (#1235) + * Improved the errors thrown by `validateOrderFillableOrThrowAsync` by making them more descriptive (#1235) + * Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218) (#1235) + * Modified the `AbstractOrderFilledCancelledFetcher` interface slightly such that `isOrderCancelledAsync` accepts a `signedOrder` instead of an `orderHash` param (#1235) + ## v2.0.1 - _November 9, 2018_ * Dependencies updated -- cgit v1.2.3 From 0ebbbdfca49028f196853bbfb082a1378c09f441 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 12 Nov 2018 14:30:26 +0100 Subject: Publish - 0x.js@2.0.2 - @0x/abi-gen-wrappers@1.0.3 - @0x/assert@1.0.16 - @0x/asset-buyer@2.2.1 - @0x/base-contract@3.0.4 - @0x/connect@3.0.4 - @0x/contract-wrappers@4.0.0 - contracts@2.1.52 - @0x/dev-tools-pages@0.0.4 - @0x/dev-utils@1.0.15 - @0x/fill-scenarios@1.0.10 - @0x/instant@0.0.5 - @0x/json-schemas@2.1.0 - @0x/metacoin@0.0.26 - @0x/migrations@2.0.2 - @0x/order-utils@3.0.0 - @0x/order-watcher@2.2.2 - @0x/react-docs@1.0.16 - @0x/react-shared@1.0.19 - @0x/sol-compiler@1.1.10 - @0x/sol-cov@2.1.10 - @0x/sol-doc@1.0.5 - @0x/sra-spec@1.0.9 - @0x/subproviders@2.1.2 - @0x/testnet-faucets@1.0.54 - @0x/web3-wrapper@3.1.2 - @0x/website@0.0.57 --- packages/order-utils/package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/package.json b/packages/order-utils/package.json index d6fb9892e..060150f96 100644 --- a/packages/order-utils/package.json +++ b/packages/order-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/order-utils", - "version": "2.0.1", + "version": "3.0.0", "engines": { "node": ">=6.12" }, @@ -35,7 +35,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/order-utils/README.md", "devDependencies": { - "@0x/dev-utils": "^1.0.14", + "@0x/dev-utils": "^1.0.15", "@0x/tslint-config": "^1.0.10", "@types/bn.js": "^4.11.0", "@types/lodash": "4.14.104", @@ -53,15 +53,15 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/abi-gen-wrappers": "^1.0.2", - "@0x/assert": "^1.0.15", - "@0x/base-contract": "^3.0.3", + "@0x/abi-gen-wrappers": "^1.0.3", + "@0x/assert": "^1.0.16", + "@0x/base-contract": "^3.0.4", "@0x/contract-artifacts": "^1.1.0", - "@0x/json-schemas": "^2.0.1", + "@0x/json-schemas": "^2.1.0", "@0x/types": "^1.2.1", "@0x/typescript-typings": "^3.0.4", "@0x/utils": "^2.0.4", - "@0x/web3-wrapper": "^3.1.1", + "@0x/web3-wrapper": "^3.1.2", "@types/node": "*", "bn.js": "^4.11.8", "ethereum-types": "^1.1.2", -- cgit v1.2.3