diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-05 21:23:35 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-05 22:21:03 +0800 |
commit | a365ab11d24ff8365b7d69a948b1b5211b772f5e (patch) | |
tree | a5b6f7f83957ee578323d66a00f0b5f233518192 /contracts/core/test/utils | |
parent | 48021a227f7034c2238c64146b2eb05eb8bfb687 (diff) | |
download | dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.tar dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.tar.gz dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.tar.bz2 dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.tar.lz dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.tar.xz dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.tar.zst dexon-sol-tools-a365ab11d24ff8365b7d69a948b1b5211b772f5e.zip |
Refactor out tokens from core contracts package
Diffstat (limited to 'contracts/core/test/utils')
6 files changed, 11 insertions, 9 deletions
diff --git a/contracts/core/test/utils/asset_proxy_owner_wrapper.ts b/contracts/core/test/utils/asset_proxy_owner_wrapper.ts index d5aaaf519..df23658d8 100644 --- a/contracts/core/test/utils/asset_proxy_owner_wrapper.ts +++ b/contracts/core/test/utils/asset_proxy_owner_wrapper.ts @@ -1,4 +1,5 @@ import { LogDecoder } from '@0x/contracts-test-utils'; +import { artifacts as tokensArtifacts } from '@0x/contracts-tokens'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; @@ -14,7 +15,7 @@ export class AssetProxyOwnerWrapper { constructor(assetproxyOwnerContract: AssetProxyOwnerContract, provider: Provider) { this._assetProxyOwner = assetproxyOwnerContract; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...tokensArtifacts }); } public async submitTransactionAsync( destination: string, diff --git a/contracts/core/test/utils/erc20_wrapper.ts b/contracts/core/test/utils/erc20_wrapper.ts index d6210646c..e5ab0e36c 100644 --- a/contracts/core/test/utils/erc20_wrapper.ts +++ b/contracts/core/test/utils/erc20_wrapper.ts @@ -1,11 +1,11 @@ import { constants, ERC20BalancesByOwner, txDefaults } from '@0x/contracts-test-utils'; +import { artifacts as tokensArtifacts, DummyERC20TokenContract } from '@0x/contracts-tokens'; import { assetDataUtils } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider } from 'ethereum-types'; import * as _ from 'lodash'; -import { DummyERC20TokenContract } from '../../generated-wrappers/dummy_erc20_token'; import { ERC20ProxyContract } from '../../generated-wrappers/erc20_proxy'; import { artifacts } from '../../src/artifacts'; @@ -38,7 +38,7 @@ export class ERC20Wrapper { for (let i = 0; i < numberToDeploy; i++) { this._dummyTokenContracts.push( await DummyERC20TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC20Token, + tokensArtifacts.DummyERC20Token, this._provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/core/test/utils/erc721_wrapper.ts b/contracts/core/test/utils/erc721_wrapper.ts index b5ae34e60..1f658ce86 100644 --- a/contracts/core/test/utils/erc721_wrapper.ts +++ b/contracts/core/test/utils/erc721_wrapper.ts @@ -1,11 +1,11 @@ import { constants, ERC721TokenIdsByOwner, txDefaults } from '@0x/contracts-test-utils'; +import { artifacts as tokensArtifacts, DummyERC721TokenContract } from '@0x/contracts-tokens'; import { generatePseudoRandomSalt } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider } from 'ethereum-types'; import * as _ from 'lodash'; -import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token'; import { ERC721ProxyContract } from '../../generated-wrappers/erc721_proxy'; import { artifacts } from '../../src/artifacts'; @@ -30,7 +30,7 @@ export class ERC721Wrapper { for (const i of _.times(constants.NUM_DUMMY_ERC721_TO_DEPLOY)) { this._dummyTokenContracts.push( await DummyERC721TokenContract.deployFrom0xArtifactAsync( - artifacts.DummyERC721Token, + tokensArtifacts.DummyERC721Token, this._provider, txDefaults, constants.DUMMY_TOKEN_NAME, diff --git a/contracts/core/test/utils/exchange_wrapper.ts b/contracts/core/test/utils/exchange_wrapper.ts index 2a24b880f..075d2cb96 100644 --- a/contracts/core/test/utils/exchange_wrapper.ts +++ b/contracts/core/test/utils/exchange_wrapper.ts @@ -6,6 +6,7 @@ import { orderUtils, SignedTransaction, } 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'; @@ -21,7 +22,7 @@ export class ExchangeWrapper { constructor(exchangeContract: ExchangeContract, provider: Provider) { this._exchange = exchangeContract; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...tokensArtifacts }); } public async fillOrderAsync( signedOrder: SignedOrder, diff --git a/contracts/core/test/utils/forwarder_wrapper.ts b/contracts/core/test/utils/forwarder_wrapper.ts index 9c5560381..4c78ecd79 100644 --- a/contracts/core/test/utils/forwarder_wrapper.ts +++ b/contracts/core/test/utils/forwarder_wrapper.ts @@ -1,4 +1,5 @@ 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'; @@ -58,7 +59,7 @@ export class ForwarderWrapper { constructor(contractInstance: ForwarderContract, provider: Provider) { this._forwarderContract = contractInstance; this._web3Wrapper = new Web3Wrapper(provider); - this._logDecoder = new LogDecoder(this._web3Wrapper, artifacts); + this._logDecoder = new LogDecoder(this._web3Wrapper, { ...artifacts, ...tokensArtifacts }); } public async marketSellOrdersWithEthAsync( orders: SignedOrder[], diff --git a/contracts/core/test/utils/order_factory_from_scenario.ts b/contracts/core/test/utils/order_factory_from_scenario.ts index 1cc962020..ecb4b2e28 100644 --- a/contracts/core/test/utils/order_factory_from_scenario.ts +++ b/contracts/core/test/utils/order_factory_from_scenario.ts @@ -8,12 +8,11 @@ import { OrderScenario, TakerScenario, } from '@0x/contracts-test-utils'; +import { DummyERC721TokenContract } from '@0x/contracts-tokens'; import { assetDataUtils, generatePseudoRandomSalt } from '@0x/order-utils'; import { Order } from '@0x/types'; import { BigNumber, errorUtils } from '@0x/utils'; -import { DummyERC721TokenContract } from '../../generated-wrappers/dummy_erc721_token'; - const TEN_UNITS_EIGHTEEN_DECIMALS = new BigNumber(10_000_000_000_000_000_000); const FIVE_UNITS_EIGHTEEN_DECIMALS = new BigNumber(5_000_000_000_000_000_000); const POINT_ONE_UNITS_EIGHTEEN_DECIMALS = new BigNumber(100_000_000_000_000_000); |