aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contract-wrappers')
-rw-r--r--packages/contract-wrappers/CHANGELOG.json89
-rw-r--r--packages/contract-wrappers/CHANGELOG.md13
-rw-r--r--packages/contract-wrappers/package.json38
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts6
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts4
-rw-r--r--packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts4
-rw-r--r--packages/contract-wrappers/src/types.ts14
-rw-r--r--packages/contract-wrappers/src/utils/assert.ts2
-rw-r--r--packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts4
-rw-r--r--packages/contract-wrappers/src/utils/utils.ts6
-rw-r--r--packages/contract-wrappers/test/ether_token_wrapper_test.ts6
-rw-r--r--packages/contract-wrappers/test/exchange_wrapper_test.ts10
-rw-r--r--packages/contract-wrappers/test/forwarder_wrapper_test.ts8
-rw-r--r--packages/contract-wrappers/test/order_validator_wrapper_test.ts4
-rw-r--r--packages/contract-wrappers/test/utils/token_utils.ts12
15 files changed, 128 insertions, 92 deletions
diff --git a/packages/contract-wrappers/CHANGELOG.json b/packages/contract-wrappers/CHANGELOG.json
index fd8dfa427..30199ae1d 100644
--- a/packages/contract-wrappers/CHANGELOG.json
+++ b/packages/contract-wrappers/CHANGELOG.json
@@ -1,5 +1,46 @@
[
{
+ "version": "6.0.0",
+ "changes": [
+ {
+ "note": "Upgrade the bignumber.js to v8.0.2",
+ "pr": 1517
+ }
+ ]
+ },
+ {
+ "timestamp": 1547747677,
+ "version": "5.0.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
+ "version": "5.0.0",
+ "changes": [
+ {
+ "note": "Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule",
+ "pr": 1474
+ },
+ {
+ "note": "Remove Exchange `matchOrdersAsync` optimization",
+ "pr": 1514
+ }
+ ],
+ "timestamp": 1547561734
+ },
+ {
+ "timestamp": 1547225310,
+ "version": "4.2.1",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"version": "4.2.0",
"changes": [
{
@@ -52,8 +93,7 @@
"version": "4.1.0",
"changes": [
{
- "note":
- "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount",
+ "note": "Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount",
"pr": 1292
}
],
@@ -81,18 +121,15 @@
"version": "4.0.0",
"changes": [
{
- "note":
- "Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync`",
+ "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",
+ "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)",
+ "note": "Throw previously swallowed network errors when calling `validateOrderFillableOrThrowAsync` (see issue: #1218)",
"pr": 1235
}
],
@@ -123,28 +160,23 @@
"pr": 1105
},
{
- "note":
- "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.",
+ "note": "Default contract addresses are no longer stored in artifacts and are instead loaded from the `@0xproject/contract-addresses` package.",
"pr": 1105
},
{
- "note":
- "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).",
+ "note": "Most contract addresses are now defined at instantiation time and are available as properties (e.g., `exchangeWrapper.address`) instead of methods (e.g., `exchangeWrapper.getContractAddress()`).",
"pr": 1105
},
{
- "note":
- "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.",
+ "note": "Removed `setProvider` method in top-level `ContractWrapper` class and added new `unsubscribeAll` method.",
"pr": 1105
},
{
- "note":
- "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.",
+ "note": "Some properties and methods have been renamed. For example, some methods that previously could throw no longer can, and so their names have been updated accordingly.",
"pr": 1105
},
{
- "note":
- "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.",
+ "note": "Removed ContractNotFound errors. Checking for this error was somewhat ineffecient. Relevant methods/functions now return the default error from web3-wrapper, which we feel provides enough information.",
"pr": 1105
},
{
@@ -180,13 +212,11 @@
"version": "2.0.0",
"changes": [
{
- "note":
- "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.",
+ "note": "Fixes dropped events in subscriptions by fetching logs by blockHash instead of blockNumber. Support for fetching by blockHash was added in Geth > v1.8.13 and Parity > v2.1.0. Infura works too.",
"pr": 1080
},
{
- "note":
- "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it",
+ "note": "Fix misunderstanding about blockstream interface callbacks and pass the raw JSON RPC responses to it",
"pr": 1080
}
],
@@ -235,18 +265,15 @@
"note": "Add `OrderValidatorWrapper`"
},
{
- "note":
- "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`",
+ "note": "Fix bug where contracts not deployed on a network showed an `EXCHANGE_CONTRACT_DOES_NOT_EXIST` error instead of `CONTRACT_NOT_DEPLOYED_ON_NETWORK`",
"pr": 1044
},
{
- "note":
- "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations",
+ "note": "Export `AssetBalanceAndProxyAllowanceFetcher` and `OrderFilledCancelledFetcher` implementations",
"pr": 1054
},
{
- "note":
- "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper",
+ "note": "Add `validateOrderFillableOrThrowAsync` and `validateFillOrderThrowIfInvalidAsync` to ExchangeWrapper",
"pr": 1054
}
],
@@ -265,13 +292,11 @@
"version": "1.0.1-rc.4",
"changes": [
{
- "note":
- "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`",
+ "note": "Export missing types: `TransactionEncoder`, `ContractAbi`, `JSONRPCRequestPayload`, `JSONRPCResponsePayload`, `JSONRPCErrorCallback`, `AbiDefinition`, `FunctionAbi`, `EventAbi`, `EventParameter`, `DecodedLogArgs`, `MethodAbi`, `ConstructorAbi`, `FallbackAbi`, `DataItem`, `ConstructorStateMutability`, `StateMutability` & `ExchangeSignatureValidatorApprovalEventArgs`",
"pr": 924
},
{
- "note":
- "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`",
+ "note": "Remove superfluous exported types: `ContractEvent`, `Token`, `OrderFillRequest`, `ContractEventArgs`, `LogEvent`, `OnOrderStateChangeCallback`, `ECSignature`, `OrderStateValid`, `OrderStateInvalid`, `OrderState`, `FilterObject`, `TransactionReceipt` & `TransactionReceiptWithDecodedLogs`",
"pr": 924
},
{
diff --git a/packages/contract-wrappers/CHANGELOG.md b/packages/contract-wrappers/CHANGELOG.md
index fe7bb7b81..28cbf2ec6 100644
--- a/packages/contract-wrappers/CHANGELOG.md
+++ b/packages/contract-wrappers/CHANGELOG.md
@@ -5,6 +5,19 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+## v5.0.1 - _January 17, 2019_
+
+ * Dependencies updated
+
+## v5.0.0 - _January 15, 2019_
+
+ * Renamed OrderStatus enum members to PascalCase to conform with tslint enum-naming rule (#1474)
+ * Remove Exchange `matchOrdersAsync` optimization (#1514)
+
+## v4.2.1 - _January 11, 2019_
+
+ * Dependencies updated
+
## v4.2.0 - _January 9, 2019_
* Added Dutch Auction wrapper (#1465)
diff --git a/packages/contract-wrappers/package.json b/packages/contract-wrappers/package.json
index 708b4249a..cc7dc1a3e 100644
--- a/packages/contract-wrappers/package.json
+++ b/packages/contract-wrappers/package.json
@@ -1,6 +1,6 @@
{
"name": "@0x/contract-wrappers",
- "version": "4.2.0",
+ "version": "5.0.1",
"description": "Smart TS wrappers for 0x smart contracts",
"keywords": [
"0xproject",
@@ -37,10 +37,10 @@
"node": ">=6.0.0"
},
"devDependencies": {
- "@0x/dev-utils": "^1.0.22",
- "@0x/migrations": "^2.3.0",
- "@0x/subproviders": "^2.1.9",
- "@0x/tslint-config": "^2.0.0",
+ "@0x/dev-utils": "^1.0.24",
+ "@0x/migrations": "^2.4.0",
+ "@0x/subproviders": "^2.1.11",
+ "@0x/tslint-config": "^2.0.2",
"@types/lodash": "4.14.104",
"@types/mocha": "^2.2.42",
"@types/node": "*",
@@ -49,7 +49,7 @@
"@types/web3-provider-engine": "^14.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-bignumber": "^2.0.1",
+ "chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
@@ -65,19 +65,19 @@
"web3-provider-engine": "14.0.6"
},
"dependencies": {
- "@0x/abi-gen-wrappers": "^2.1.0",
- "@0x/assert": "^1.0.21",
- "@0x/contract-addresses": "^2.1.0",
- "@0x/contract-artifacts": "^1.2.0",
- "@0x/contracts-test-utils": "^1.0.3",
- "@0x/fill-scenarios": "^1.1.0",
- "@0x/json-schemas": "^2.1.5",
- "@0x/order-utils": "^3.1.0",
- "@0x/types": "^1.5.0",
- "@0x/typescript-typings": "^3.0.6",
- "@0x/utils": "^2.1.1",
- "@0x/web3-wrapper": "^3.2.2",
- "ethereum-types": "^1.1.4",
+ "@0x/abi-gen-wrappers": "^2.2.0",
+ "@0x/assert": "^1.0.23",
+ "@0x/contract-addresses": "^2.2.0",
+ "@0x/contract-artifacts": "^1.3.0",
+ "@0x/contracts-test-utils": "^2.0.1",
+ "@0x/fill-scenarios": "^1.1.2",
+ "@0x/json-schemas": "^2.1.7",
+ "@0x/order-utils": "^3.1.2",
+ "@0x/types": "^1.5.2",
+ "@0x/typescript-typings": "^3.0.8",
+ "@0x/utils": "^3.0.1",
+ "@0x/web3-wrapper": "^3.2.4",
+ "ethereum-types": "^1.1.6",
"ethereumjs-abi": "0.6.5",
"ethereumjs-blockstream": "6.0.0",
"ethereumjs-util": "^5.1.1",
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts
index ad42cfd4f..cd79a0e5d 100644
--- a/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts
@@ -271,7 +271,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
const tokenContract = await this._getTokenContractAsync(normalizedTokenAddress);
const fromAddressBalance = await this.getBalanceAsync(normalizedTokenAddress, normalizedFromAddress);
- if (fromAddressBalance.lessThan(amountInBaseUnits)) {
+ if (fromAddressBalance.isLessThan(amountInBaseUnits)) {
throw new Error(ContractWrappersError.InsufficientBalanceForTransfer);
}
@@ -327,12 +327,12 @@ export class ERC20TokenWrapper extends ContractWrapper {
normalizedFromAddress,
normalizedSenderAddress,
);
- if (fromAddressAllowance.lessThan(amountInBaseUnits)) {
+ if (fromAddressAllowance.isLessThan(amountInBaseUnits)) {
throw new Error(ContractWrappersError.InsufficientAllowanceForTransfer);
}
const fromAddressBalance = await this.getBalanceAsync(normalizedTokenAddress, normalizedFromAddress);
- if (fromAddressBalance.lessThan(amountInBaseUnits)) {
+ if (fromAddressBalance.isLessThan(amountInBaseUnits)) {
throw new Error(ContractWrappersError.InsufficientBalanceForTransfer);
}
diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
index c9556971a..49193f816 100644
--- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
@@ -743,10 +743,6 @@ export class ExchangeWrapper extends ContractWrapper {
rightSignedOrder.takerAssetData !== leftSignedOrder.makerAssetData
) {
throw new Error(ExchangeWrapperError.AssetDataMismatch);
- } else {
- // Smart contracts assigns the asset data from the left order to the right one so we can save gas on reducing the size of call data
- rightSignedOrder.makerAssetData = '0x';
- rightSignedOrder.takerAssetData = '0x';
}
const exchangeInstance = await this._getExchangeContractAsync();
if (orderTransactionOpts.shouldValidate) {
diff --git a/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts b/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts
index 1ff130a48..c35b24664 100644
--- a/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts
+++ b/packages/contract-wrappers/src/fetchers/asset_balance_and_proxy_allowance_fetcher.ts
@@ -39,7 +39,7 @@ export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndP
nestedAssetDataElement,
userAddress,
)).dividedToIntegerBy(nestedAmountElement);
- if (_.isUndefined(balance) || nestedAssetBalance.lessThan(balance)) {
+ if (_.isUndefined(balance) || nestedAssetBalance.isLessThan(balance)) {
balance = nestedAssetBalance;
}
}
@@ -81,7 +81,7 @@ export class AssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndP
nestedAssetDataElement,
userAddress,
)).dividedToIntegerBy(nestedAmountElement);
- if (_.isUndefined(proxyAllowance) || nestedAssetAllowance.lessThan(proxyAllowance)) {
+ if (_.isUndefined(proxyAllowance) || nestedAssetAllowance.isLessThan(proxyAllowance)) {
proxyAllowance = nestedAssetAllowance;
}
}
diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts
index 945ca88cd..29cf8b2c4 100644
--- a/packages/contract-wrappers/src/types.ts
+++ b/packages/contract-wrappers/src/types.ts
@@ -177,13 +177,13 @@ export interface OrderInfo {
}
export enum OrderStatus {
- INVALID = 0,
- INVALID_MAKER_ASSET_AMOUNT,
- INVALID_TAKER_ASSET_AMOUNT,
- FILLABLE,
- EXPIRED,
- FULLY_FILLED,
- CANCELLED,
+ Invalid = 0,
+ InvalidMakerAssetAmount,
+ InvalidTakerAssetAmount,
+ Fillable,
+ Expired,
+ FullyFilled,
+ Cancelled,
}
export interface TraderInfo {
diff --git a/packages/contract-wrappers/src/utils/assert.ts b/packages/contract-wrappers/src/utils/assert.ts
index 3f02ed052..d30c6b29c 100644
--- a/packages/contract-wrappers/src/utils/assert.ts
+++ b/packages/contract-wrappers/src/utils/assert.ts
@@ -70,7 +70,7 @@ export const assert = {
/*
* Asserts that all the orders have the same value for the provided propertyName
* If the value parameter is provided, this asserts that all orders have the prope
- */
+ */
ordersHaveAtMostOneUniqueValueForProperty(orders: Order[], propertyName: string, value?: any): void {
const allValues = _.map(orders, order => _.get(order, propertyName));
sharedAssert.hasAtMostOneUniqueValue(
diff --git a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
index f374d509b..4b75ea386 100644
--- a/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
+++ b/packages/contract-wrappers/src/utils/exchange_transfer_simulator.ts
@@ -72,10 +72,10 @@ export class ExchangeTransferSimulator {
}
const balance = await this._store.getBalanceAsync(tokenAddress, from);
const proxyAllowance = await this._store.getProxyAllowanceAsync(tokenAddress, from);
- if (proxyAllowance.lessThan(amountInBaseUnits)) {
+ if (proxyAllowance.isLessThan(amountInBaseUnits)) {
ExchangeTransferSimulator._throwValidationError(FailureReason.ProxyAllowance, tradeSide, transferType);
}
- if (balance.lessThan(amountInBaseUnits)) {
+ if (balance.isLessThan(amountInBaseUnits)) {
ExchangeTransferSimulator._throwValidationError(FailureReason.Balance, tradeSide, transferType);
}
await this._decreaseProxyAllowanceAsync(tokenAddress, from, amountInBaseUnits);
diff --git a/packages/contract-wrappers/src/utils/utils.ts b/packages/contract-wrappers/src/utils/utils.ts
index 0b3270e78..ab69385e7 100644
--- a/packages/contract-wrappers/src/utils/utils.ts
+++ b/packages/contract-wrappers/src/utils/utils.ts
@@ -7,13 +7,15 @@ import { constants } from './constants';
export const utils = {
getCurrentUnixTimestampSec(): BigNumber {
const milisecondsInSecond = 1000;
- return new BigNumber(Date.now() / milisecondsInSecond).round();
+ return new BigNumber(Date.now() / milisecondsInSecond).integerValue();
},
getCurrentUnixTimestampMs(): BigNumber {
return new BigNumber(Date.now());
},
numberPercentageToEtherTokenAmountPercentage(percentage: number): BigNumber {
- return Web3Wrapper.toBaseUnitAmount(constants.ONE_AMOUNT, constants.ETHER_TOKEN_DECIMALS).mul(percentage);
+ return Web3Wrapper.toBaseUnitAmount(constants.ONE_AMOUNT, constants.ETHER_TOKEN_DECIMALS).multipliedBy(
+ percentage,
+ );
},
removeUndefinedProperties<T extends object>(obj: T): Partial<T> {
return _.pickBy(obj);
diff --git a/packages/contract-wrappers/test/ether_token_wrapper_test.ts b/packages/contract-wrappers/test/ether_token_wrapper_test.ts
index e3efef19d..cc2419aa2 100644
--- a/packages/contract-wrappers/test/ether_token_wrapper_test.ts
+++ b/packages/contract-wrappers/test/ether_token_wrapper_test.ts
@@ -116,7 +116,7 @@ describe('EtherTokenWrapper', () => {
const preETHBalance = await web3Wrapper.getBalanceInWeiAsync(addressWithETH);
const extraETHBalance = Web3Wrapper.toWei(new BigNumber(5));
- const overETHBalanceinWei = preETHBalance.add(extraETHBalance);
+ const overETHBalanceinWei = preETHBalance.plus(extraETHBalance);
return expect(
contractWrappers.etherToken.depositAsync(wethContractAddress, overETHBalanceinWei, addressWithETH),
@@ -153,7 +153,7 @@ describe('EtherTokenWrapper', () => {
);
expect(postWETHBalanceInBaseUnits).to.be.bignumber.equal(0);
- const expectedETHBalance = preETHBalance.add(depositWeiAmount).round(decimalPlaces);
+ const expectedETHBalance = preETHBalance.plus(depositWeiAmount).integerValue(decimalPlaces);
gasCost = expectedETHBalance.minus(postETHBalance);
expect(gasCost).to.be.bignumber.lte(MAX_REASONABLE_GAS_COST_IN_WEI);
});
@@ -165,7 +165,7 @@ describe('EtherTokenWrapper', () => {
expect(preWETHBalance).to.be.bignumber.equal(0);
// tslint:disable-next-line:custom-no-magic-numbers
- const overWETHBalance = preWETHBalance.add(999999999);
+ const overWETHBalance = preWETHBalance.plus(999999999);
return expect(
contractWrappers.etherToken.withdrawAsync(wethContractAddress, overWETHBalance, addressWithETH),
diff --git a/packages/contract-wrappers/test/exchange_wrapper_test.ts b/packages/contract-wrappers/test/exchange_wrapper_test.ts
index 73ce6c743..a1d60dc6e 100644
--- a/packages/contract-wrappers/test/exchange_wrapper_test.ts
+++ b/packages/contract-wrappers/test/exchange_wrapper_test.ts
@@ -109,7 +109,7 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#fillOrKillOrderAsync', () => {
@@ -157,7 +157,7 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#marketSellOrdersAsync', () => {
@@ -183,7 +183,7 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#batchFillOrdersNoThrowAsync', () => {
@@ -197,9 +197,9 @@ describe('ExchangeWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
let orderInfo = await contractWrappers.exchange.getOrderInfoAsync(signedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
orderInfo = await contractWrappers.exchange.getOrderInfoAsync(anotherSignedOrder);
- expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(orderInfo.orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
});
describe('#batchFillOrKillOrdersAsync', () => {
diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
index ff4ff8b67..0d197eced 100644
--- a/packages/contract-wrappers/test/forwarder_wrapper_test.ts
+++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts
@@ -97,8 +97,8 @@ describe('ForwarderWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]);
- expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
- expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
+ expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FullyFilled);
+ expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FullyFilled);
});
it('should throw when invalid transaction and shouldValidate is true', async () => {
const signedOrders = [signedOrder];
@@ -131,8 +131,8 @@ describe('ForwarderWrapper', () => {
);
await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS);
const ordersInfo = await contractWrappers.exchange.getOrdersInfoAsync([signedOrder, anotherSignedOrder]);
- expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FULLY_FILLED);
- expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(ordersInfo[0].orderStatus).to.be.equal(OrderStatus.FullyFilled);
+ expect(ordersInfo[1].orderStatus).to.be.equal(OrderStatus.Fillable);
expect(ordersInfo[1].orderTakerAssetFilledAmount).to.be.bignumber.equal(new BigNumber(4)); // only 95% of ETH is sold
});
it('should throw when invalid transaction and shouldValidate is true', async () => {
diff --git a/packages/contract-wrappers/test/order_validator_wrapper_test.ts b/packages/contract-wrappers/test/order_validator_wrapper_test.ts
index da3f99e72..c61c05d31 100644
--- a/packages/contract-wrappers/test/order_validator_wrapper_test.ts
+++ b/packages/contract-wrappers/test/order_validator_wrapper_test.ts
@@ -117,9 +117,9 @@ describe('OrderValidator', () => {
it('should return correct on-chain order info for input orders', async () => {
const firstOrderInfo = ordersInfo[0];
const secondOrderInfo = ordersInfo[1];
- expect(firstOrderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(firstOrderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(firstOrderInfo.orderTakerAssetFilledAmount).to.bignumber.equal(constants.ZERO_AMOUNT);
- expect(secondOrderInfo.orderStatus).to.be.equal(OrderStatus.FILLABLE);
+ expect(secondOrderInfo.orderStatus).to.be.equal(OrderStatus.Fillable);
expect(secondOrderInfo.orderTakerAssetFilledAmount).to.bignumber.equal(constants.ZERO_AMOUNT);
});
it('should return correct on-chain trader info for input takers', async () => {
diff --git a/packages/contract-wrappers/test/utils/token_utils.ts b/packages/contract-wrappers/test/utils/token_utils.ts
index f8a88637f..e390d2775 100644
--- a/packages/contract-wrappers/test/utils/token_utils.ts
+++ b/packages/contract-wrappers/test/utils/token_utils.ts
@@ -9,14 +9,14 @@ import { provider, txDefaults, web3Wrapper } from './web3_wrapper';
// Before we were fetching them from the TokenRegistry but now we can't as it's deprecated and removed.
// TODO(albrow): Import these from the migrations package instead of hard-coding them.
const DUMMY_ERC_20_ADRESSES = [
- '0x6dfff22588be9b3ef8cf0ad6dc9b84796f9fb45f',
- '0xcfc18cec799fbd1793b5c43e773c98d4d61cc2db',
- '0xf22469f31527adc53284441bae1665a7b9214dba',
- '0x10add991de718a69dec2117cb6aa28098836511b',
- '0x8d61158a366019ac78db4149d75fff9dda51160d',
+ '0x34d402f14d58e001d8efbe6585051bf9706aa064',
+ '0x25b8fe1de9daf8ba351890744ff28cf7dfa8f5e3',
+ '0xcdb594a32b1cc3479d8746279712c39d18a07fc0',
+ '0x1e2f9e10d02a6b8f8f69fcbf515e75039d2ea30d',
+ '0xbe0037eaf2d64fe5529bca93c18c9702d3930376',
];
-const DUMMY_ERC_721_ADRESSES = ['0x131855dda0aaff096f6854854c55a4debf61077a'];
+const DUMMY_ERC_721_ADRESSES = ['0x07f96aa816c1f244cbc6ef114bb2b023ba54a2eb'];
export const tokenUtils = {
getDummyERC20TokenAddresses(): string[] {