diff options
Diffstat (limited to 'contracts/extensions/test')
-rw-r--r-- | contracts/extensions/test/balance_threshold_filter.ts (renamed from contracts/extensions/test/extensions/balance_threshold_filter.ts) | 15 | ||||
-rw-r--r-- | contracts/extensions/test/dutch_auction.ts (renamed from contracts/extensions/test/extensions/dutch_auction.ts) | 23 | ||||
-rw-r--r-- | contracts/extensions/test/forwarder.ts (renamed from contracts/extensions/test/extensions/forwarder.ts) | 24 | ||||
-rw-r--r-- | contracts/extensions/test/order_matcher.ts (renamed from contracts/extensions/test/extensions/order_matcher.ts) | 24 | ||||
-rw-r--r-- | contracts/extensions/test/order_validator.ts (renamed from contracts/extensions/test/extensions/order_validator.ts) | 16 | ||||
-rw-r--r-- | contracts/extensions/test/utils/balance_threshold_wrapper.ts | 6 | ||||
-rw-r--r-- | contracts/extensions/test/utils/dutch_auction_test_wrapper.ts | 6 | ||||
-rw-r--r-- | contracts/extensions/test/utils/forwarder_wrapper.ts | 6 | ||||
-rw-r--r-- | contracts/extensions/test/utils/index.ts | 3 |
9 files changed, 50 insertions, 73 deletions
diff --git a/contracts/extensions/test/extensions/balance_threshold_filter.ts b/contracts/extensions/test/balance_threshold_filter.ts index 055beb487..c79a72f5a 100644 --- a/contracts/extensions/test/extensions/balance_threshold_filter.ts +++ b/contracts/extensions/test/balance_threshold_filter.ts @@ -7,13 +7,9 @@ import * as chai from 'chai'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { - artifacts as exchangeArtifacts, - ERC20Wrapper, - ERC721Wrapper, - ExchangeContract, - ExchangeWrapper, -} from '@0x/contracts-exchange'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -27,11 +23,8 @@ import { txDefaults, web3Wrapper, } from '@0x/contracts-test-utils'; -import { DummyERC20TokenContract } from '@0x/contracts-tokens'; -import { BalanceThresholdFilterContract } from '../../generated-wrappers/balance_threshold_filter'; -import { artifacts } from '../../src/artifacts'; -import { BalanceThresholdWrapper } from '../utils/balance_threshold_wrapper'; +import { artifacts, BalanceThresholdFilterContract, BalanceThresholdWrapper } from '../src'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/extensions/test/extensions/dutch_auction.ts b/contracts/extensions/test/dutch_auction.ts index 132989efe..34ff25c3d 100644 --- a/contracts/extensions/test/extensions/dutch_auction.ts +++ b/contracts/extensions/test/dutch_auction.ts @@ -1,11 +1,8 @@ import { DutchAuctionWrapper } from '@0x/contract-wrappers'; -import { - artifacts as exchangeArtifacts, - ERC20Wrapper, - ERC721Wrapper, - ExchangeContract, - ExchangeWrapper, -} from '@0x/contracts-exchange'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -18,12 +15,6 @@ import { txDefaults, web3Wrapper, } from '@0x/contracts-test-utils'; -import { - artifacts as tokensArtifacts, - DummyERC20TokenContract, - DummyERC721TokenContract, - WETH9Contract, -} from '@0x/contracts-tokens'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils'; import { RevertReason, SignedOrder } from '@0x/types'; @@ -32,9 +23,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { DutchAuctionContract } from '../../generated-wrappers/dutch_auction'; -import { artifacts } from '../../src/artifacts'; -import { DutchAuctionTestWrapper } from '../utils/dutch_auction_test_wrapper'; +import { artifacts, DutchAuctionContract, DutchAuctionTestWrapper } from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -93,7 +82,7 @@ describe(ContractName.DutchAuction, () => { const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address]; - wethContract = await WETH9Contract.deployFrom0xArtifactAsync(tokensArtifacts.WETH9, provider, txDefaults); + wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults); erc20Wrapper.addDummyTokenContract(wethContract as any); const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); diff --git a/contracts/extensions/test/extensions/forwarder.ts b/contracts/extensions/test/forwarder.ts index e9bda43ae..24c219563 100644 --- a/contracts/extensions/test/extensions/forwarder.ts +++ b/contracts/extensions/test/forwarder.ts @@ -1,10 +1,7 @@ -import { - artifacts as exchangeArtifacts, - ERC20Wrapper, - ERC721Wrapper, - ExchangeContract, - ExchangeWrapper, -} from '@0x/contracts-exchange'; +import { ERC20Wrapper, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { artifacts as erc20Artifacts, DummyERC20TokenContract, WETH9Contract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -18,12 +15,6 @@ import { txDefaults, web3Wrapper, } from '@0x/contracts-test-utils'; -import { - artifacts as tokenArtifacts, - DummyERC20TokenContract, - DummyERC721TokenContract, - WETH9Contract, -} from '@0x/contracts-tokens'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils } from '@0x/order-utils'; import { RevertReason, SignedOrder } from '@0x/types'; @@ -32,10 +23,7 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import { ForwarderContract } from '../../generated-wrappers/forwarder'; -import { artifacts } from '../../src/artifacts'; - -import { ForwarderWrapper } from '../utils/forwarder_wrapper'; +import { artifacts, ForwarderContract, ForwarderWrapper } from '../src'; chaiSetup.configure(); const expect = chai.expect; @@ -100,7 +88,7 @@ describe(ContractName.Forwarder, () => { const erc721Balances = await erc721Wrapper.getBalancesAsync(); erc721MakerAssetIds = erc721Balances[makerAddress][erc721Token.address]; - wethContract = await WETH9Contract.deployFrom0xArtifactAsync(tokenArtifacts.WETH9, provider, txDefaults); + wethContract = await WETH9Contract.deployFrom0xArtifactAsync(erc20Artifacts.WETH9, provider, txDefaults); weth = new DummyERC20TokenContract(wethContract.abi, wethContract.address, provider); erc20Wrapper.addDummyTokenContract(weth); diff --git a/contracts/extensions/test/extensions/order_matcher.ts b/contracts/extensions/test/order_matcher.ts index 61965dab3..0b2f9ddbb 100644 --- a/contracts/extensions/test/extensions/order_matcher.ts +++ b/contracts/extensions/test/order_matcher.ts @@ -1,7 +1,13 @@ -import { artifacts as proxyArtifacts, ERC20ProxyContract, ERC721ProxyContract } from '@0x/contracts-asset-proxy'; import { - artifacts as exchangeArtifacts, + artifacts as proxyArtifacts, + ERC20ProxyContract, ERC20Wrapper, + ERC721ProxyContract, +} from '@0x/contracts-asset-proxy'; +import { artifacts as erc20Artifacts, DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { artifacts as erc721Artifacts, DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { + artifacts as exchangeArtifacts, ExchangeContract, ExchangeFillEventArgs, ExchangeWrapper, @@ -19,7 +25,6 @@ import { txDefaults, web3Wrapper, } from '@0x/contracts-test-utils'; -import { artifacts as tokenArtifacts, DummyERC20TokenContract, DummyERC721TokenContract } from '@0x/contracts-tokens'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils } from '@0x/order-utils'; import { RevertReason } from '@0x/types'; @@ -29,8 +34,7 @@ import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; -import { OrderMatcherContract } from '../../generated-wrappers/order_matcher'; -import { artifacts } from '../../src/artifacts'; +import { artifacts, OrderMatcherContract } from '../src'; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); chaiSetup.configure(); @@ -450,7 +454,7 @@ describe('OrderMatcher', () => { signedOrderLeft.signature, signedOrderRight.signature, ); - const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...tokenArtifacts, ...exchangeArtifacts }); + const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts }); const txReceipt = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ data, @@ -488,7 +492,7 @@ describe('OrderMatcher', () => { signedOrderLeft.signature, signedOrderRight.signature, ); - const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...tokenArtifacts, ...exchangeArtifacts }); + const logDecoder = new LogDecoder(web3Wrapper, { ...artifacts, ...erc20Artifacts, ...exchangeArtifacts }); const txReceipt = await logDecoder.getTxWithDecodedLogsAsync( await web3Wrapper.sendTransactionAsync({ data, @@ -725,7 +729,7 @@ describe('OrderMatcher', () => { }); it('should allow owner to withdraw ERC721 tokens', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - tokenArtifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -770,7 +774,7 @@ describe('OrderMatcher', () => { }); it('should be able to approve an ERC721 token by passing in allowance = 1', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - tokenArtifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, @@ -787,7 +791,7 @@ describe('OrderMatcher', () => { }); it('should be able to approve an ERC721 token by passing in allowance > 1', async () => { const erc721Token = await DummyERC721TokenContract.deployFrom0xArtifactAsync( - tokenArtifacts.DummyERC721Token, + erc721Artifacts.DummyERC721Token, provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/extensions/test/extensions/order_validator.ts b/contracts/extensions/test/order_validator.ts index 7871867c7..88dae14fb 100644 --- a/contracts/extensions/test/extensions/order_validator.ts +++ b/contracts/extensions/test/order_validator.ts @@ -1,11 +1,7 @@ -import { ERC20ProxyContract, ERC721ProxyContract } from '@0x/contracts-asset-proxy'; -import { - artifacts as exchangeArtifacts, - ERC20Wrapper, - ERC721Wrapper, - ExchangeContract, - ExchangeWrapper, -} from '@0x/contracts-exchange'; +import { ERC20ProxyContract, ERC20Wrapper, ERC721ProxyContract, ERC721Wrapper } from '@0x/contracts-asset-proxy'; +import { DummyERC20TokenContract } from '@0x/contracts-erc20'; +import { DummyERC721TokenContract } from '@0x/contracts-erc721'; +import { artifacts as exchangeArtifacts, ExchangeContract, ExchangeWrapper } from '@0x/contracts-exchange'; import { chaiSetup, constants, @@ -15,7 +11,6 @@ import { txDefaults, web3Wrapper, } from '@0x/contracts-test-utils'; -import { DummyERC20TokenContract, DummyERC721TokenContract } from '@0x/contracts-tokens'; import { BlockchainLifecycle } from '@0x/dev-utils'; import { assetDataUtils, orderHashUtils } from '@0x/order-utils'; import { SignedOrder } from '@0x/types'; @@ -23,8 +18,7 @@ import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { OrderValidatorContract } from '../../generated-wrappers/order_validator'; -import { artifacts } from '../../src/artifacts/index'; +import { artifacts, OrderValidatorContract } from '../src'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/extensions/test/utils/balance_threshold_wrapper.ts b/contracts/extensions/test/utils/balance_threshold_wrapper.ts index db2b23d42..3178d992e 100644 --- a/contracts/extensions/test/utils/balance_threshold_wrapper.ts +++ b/contracts/extensions/test/utils/balance_threshold_wrapper.ts @@ -1,3 +1,5 @@ +import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; +import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { artifacts as exchangeArtifacts, ExchangeContract } from '@0x/contracts-exchange'; import { FillResults, @@ -7,7 +9,6 @@ import { orderUtils, TransactionFactory, } from '@0x/contracts-test-utils'; -import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; @@ -35,7 +36,8 @@ export class BalanceThresholdWrapper { this._web3Wrapper = new Web3Wrapper(provider); this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, - ...tokensArtifacts, + ...erc20Artifacts, + ...erc721Artifacts, ...exchangeArtifacts, }); } diff --git a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts index 985af336d..5899ffcac 100644 --- a/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts +++ b/contracts/extensions/test/utils/dutch_auction_test_wrapper.ts @@ -1,6 +1,7 @@ +import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; +import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange'; import { LogDecoder } from '@0x/contracts-test-utils'; -import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; import { DutchAuctionDetails, SignedOrder } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; @@ -19,7 +20,8 @@ export class DutchAuctionTestWrapper { this._web3Wrapper = new Web3Wrapper(provider); this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, - ...tokensArtifacts, + ...erc20Artifacts, + ...erc721Artifacts, ...exchangeArtifacts, }); } diff --git a/contracts/extensions/test/utils/forwarder_wrapper.ts b/contracts/extensions/test/utils/forwarder_wrapper.ts index 5b89638a0..207106852 100644 --- a/contracts/extensions/test/utils/forwarder_wrapper.ts +++ b/contracts/extensions/test/utils/forwarder_wrapper.ts @@ -1,6 +1,7 @@ +import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; +import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { artifacts as exchangeArtifacts } from '@0x/contracts-exchange'; import { constants, formatters, LogDecoder, MarketSellOrders } from '@0x/contracts-test-utils'; -import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; @@ -62,7 +63,8 @@ export class ForwarderWrapper { this._web3Wrapper = new Web3Wrapper(provider); this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, - ...tokensArtifacts, + ...erc20Artifacts, + ...erc721Artifacts, ...exchangeArtifacts, }); } diff --git a/contracts/extensions/test/utils/index.ts b/contracts/extensions/test/utils/index.ts new file mode 100644 index 000000000..d5d529c11 --- /dev/null +++ b/contracts/extensions/test/utils/index.ts @@ -0,0 +1,3 @@ +export * from './balance_threshold_wrapper'; +export * from './dutch_auction_test_wrapper'; +export * from './forwarder_wrapper'; |