aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange/transactions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/test/exchange/transactions.ts')
-rw-r--r--packages/contracts/test/exchange/transactions.ts50
1 files changed, 25 insertions, 25 deletions
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index c4de58bb9..959d79517 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -1,26 +1,26 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
import { assetProxyUtils, generatePseudoRandomSalt } from '@0xproject/order-utils';
-import { AssetProxyId, OrderWithoutExchangeAddress, RevertReason, SignedOrder } from '@0xproject/types';
+import { OrderWithoutExchangeAddress, RevertReason, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as _ from 'lodash';
-import { DummyERC20TokenContract } from '../../src/generated_contract_wrappers/dummy_e_r_c20_token';
-import { ERC20ProxyContract } from '../../src/generated_contract_wrappers/e_r_c20_proxy';
-import { ExchangeContract } from '../../src/generated_contract_wrappers/exchange';
-import { ExchangeWrapperContract } from '../../src/generated_contract_wrappers/exchange_wrapper';
-import { WhitelistContract } from '../../src/generated_contract_wrappers/whitelist';
-import { artifacts } from '../../src/utils/artifacts';
-import { expectRevertReasonOrAlwaysFailingTransactionAsync } from '../../src/utils/assertions';
-import { chaiSetup } from '../../src/utils/chai_setup';
-import { constants } from '../../src/utils/constants';
-import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
-import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
-import { OrderFactory } from '../../src/utils/order_factory';
-import { orderUtils } from '../../src/utils/order_utils';
-import { TransactionFactory } from '../../src/utils/transaction_factory';
-import { ERC20BalancesByOwner, SignedTransaction } from '../../src/utils/types';
-import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
+import { DummyERC20TokenContract } from '../../generated_contract_wrappers/dummy_e_r_c20_token';
+import { ERC20ProxyContract } from '../../generated_contract_wrappers/e_r_c20_proxy';
+import { ExchangeContract } from '../../generated_contract_wrappers/exchange';
+import { ExchangeWrapperContract } from '../../generated_contract_wrappers/exchange_wrapper';
+import { WhitelistContract } from '../../generated_contract_wrappers/whitelist';
+import { artifacts } from '../utils/artifacts';
+import { expectTransactionFailedAsync } from '../utils/assertions';
+import { chaiSetup } from '../utils/chai_setup';
+import { constants } from '../utils/constants';
+import { ERC20Wrapper } from '../utils/erc20_wrapper';
+import { ExchangeWrapper } from '../utils/exchange_wrapper';
+import { OrderFactory } from '../utils/order_factory';
+import { orderUtils } from '../utils/order_utils';
+import { TransactionFactory } from '../utils/transaction_factory';
+import { ERC20BalancesByOwner, SignedTransaction } from '../utils/types';
+import { provider, txDefaults, web3Wrapper } from '../utils/web3_wrapper';
chaiSetup.configure();
const expect = chai.expect;
@@ -91,7 +91,7 @@ describe('Exchange transactions', () => {
assetProxyUtils.encodeERC20AssetData(zrxToken.address),
);
exchangeWrapper = new ExchangeWrapper(exchange, provider);
- await exchangeWrapper.registerAssetProxyAsync(AssetProxyId.ERC20, erc20Proxy.address, owner);
+ await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, { from: owner }),
@@ -134,7 +134,7 @@ describe('Exchange transactions', () => {
});
it('should throw if not called by specified sender', async () => {
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
exchangeWrapper.executeTransactionAsync(signedTx, takerAddress),
RevertReason.FailedExecution,
);
@@ -177,7 +177,7 @@ describe('Exchange transactions', () => {
it('should throw if the a 0x transaction with the same transactionHash has already been executed', async () => {
await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
exchangeWrapper.executeTransactionAsync(signedTx, senderAddress),
RevertReason.InvalidTxHash,
);
@@ -197,7 +197,7 @@ describe('Exchange transactions', () => {
});
it('should throw if not called by specified sender', async () => {
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
exchangeWrapper.executeTransactionAsync(signedTx, makerAddress),
RevertReason.FailedExecution,
);
@@ -205,7 +205,7 @@ describe('Exchange transactions', () => {
it('should cancel the order when signed by maker and called by sender', async () => {
await exchangeWrapper.executeTransactionAsync(signedTx, senderAddress);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
exchangeWrapper.fillOrderAsync(signedOrder, senderAddress),
RevertReason.OrderUnfillable,
);
@@ -250,7 +250,7 @@ describe('Exchange transactions', () => {
signedOrder.signature,
);
const signedFillTx = takerTransactionFactory.newSignedTransaction(fillData);
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
exchangeWrapperContract.fillOrder.sendTransactionAsync(
orderWithoutExchangeAddress,
takerAssetFillAmount,
@@ -370,7 +370,7 @@ describe('Exchange transactions', () => {
orderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress(signedOrder);
const takerAssetFillAmount = signedOrder.takerAssetAmount;
const salt = generatePseudoRandomSalt();
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
whitelist.fillOrderIfWhitelisted.sendTransactionAsync(
orderWithoutExchangeAddress,
takerAssetFillAmount,
@@ -392,7 +392,7 @@ describe('Exchange transactions', () => {
orderWithoutExchangeAddress = orderUtils.getOrderWithoutExchangeAddress(signedOrder);
const takerAssetFillAmount = signedOrder.takerAssetAmount;
const salt = generatePseudoRandomSalt();
- return expectRevertReasonOrAlwaysFailingTransactionAsync(
+ return expectTransactionFailedAsync(
whitelist.fillOrderIfWhitelisted.sendTransactionAsync(
orderWithoutExchangeAddress,
takerAssetFillAmount,