Introduce publicFacingContracts config in all package.jsons, refactor all imports from src in contracts packages

This commit is contained in:
fabioberger
2019-11-11 15:10:15 +00:00
parent bc1dca3f6f
commit 86b76a3e75
123 changed files with 288 additions and 663 deletions

View File

@@ -24,7 +24,11 @@ import {
web3Wrapper,
} from '@0x/contracts-test-utils';
import { artifacts, BalanceThresholdFilterContract, BalanceThresholdWrapper } from '../src';
import { BalanceThresholdWrapper } from './utils/balance_threshold_wrapper';
import { BalanceThresholdFilterContract } from './wrappers';
import { artifacts } from './artifacts';
chaiSetup.configure();
const expect = chai.expect;
@@ -139,12 +143,9 @@ describe(ContractName.BalanceThresholdFilter, () => {
new BigNumber(chainId),
);
// Register proxies
await exchangeInstance.registerAssetProxy.awaitTransactionSuccessAsync(
erc20Proxy.address,
{
from: owner,
},
);
await exchangeInstance.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address, {
from: owner,
});
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeInstance.address, {
from: owner,
});

View File

@@ -22,7 +22,9 @@ import { Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import * as _ from 'lodash';
import { artifacts, DutchAuctionContract, DutchAuctionTestWrapper, WETH9Contract } from '../src';
import { DutchAuctionContract, DutchAuctionTestWrapper, WETH9Contract } from './wrappers';
import { artifacts } from './artifacts';
chaiSetup.configure();
const expect = chai.expect;
@@ -98,18 +100,12 @@ describe(ContractName.DutchAuction, () => {
zrxAssetData,
new BigNumber(chainId),
);
await exchangeInstance.registerAssetProxy.awaitTransactionSuccessAsync(
erc20Proxy.address,
{
from: owner,
},
);
await exchangeInstance.registerAssetProxy.awaitTransactionSuccessAsync(
erc721Proxy.address,
{
from: owner,
},
);
await exchangeInstance.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address, {
from: owner,
});
await exchangeInstance.registerAssetProxy.awaitTransactionSuccessAsync(erc721Proxy.address, {
from: owner,
});
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchangeInstance.address, {
from: owner,

View File

@@ -30,7 +30,9 @@ import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import * as _ from 'lodash';
import { artifacts, ExchangeFillEventArgs, OrderMatcherContract } from '../src';
import { ExchangeFillEventArgs, OrderMatcherContract } from './wrappers';
import { artifacts } from './artifacts';
const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
chaiSetup.configure();
@@ -117,18 +119,12 @@ describe('OrderMatcher', () => {
await devUtils.encodeERC20AssetData.callAsync(zrxToken.address),
new BigNumber(chainId),
);
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(
erc20Proxy.address,
{
from: owner,
},
);
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(
erc721Proxy.address,
{
from: owner,
},
); // Authorize ERC20 trades by exchange
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address, {
from: owner,
});
await exchange.registerAssetProxy.awaitTransactionSuccessAsync(erc721Proxy.address, {
from: owner,
}); // Authorize ERC20 trades by exchange
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(exchange.address, {
from: owner,

View File

@@ -13,7 +13,9 @@ import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { TransactionReceiptWithDecodedLogs } from 'ethereum-types';
import { artifacts, BalanceThresholdFilterContract } from '../../src';
import { BalanceThresholdFilterContract } from './wrappers';
import { artifacts } from './artifacts';
export class BalanceThresholdWrapper {
private readonly _balanceThresholdFilter: BalanceThresholdFilterContract;