From 86b76a3e752bb39b988be2742a47fbc03cbaa5e5 Mon Sep 17 00:00:00 2001 From: fabioberger Date: Mon, 11 Nov 2019 15:10:15 +0000 Subject: [PATCH] Introduce publicFacingContracts config in all package.jsons, refactor all imports from src in contracts packages --- contracts/asset-proxy/package.json | 1 + contracts/asset-proxy/src/artifacts.ts | 28 +----- contracts/asset-proxy/src/wrappers.ts | 12 --- contracts/asset-proxy/test/authorizable.ts | 4 +- contracts/asset-proxy/test/erc1155_proxy.ts | 5 +- .../asset-proxy/test/erc20bridge_proxy.ts | 5 +- contracts/asset-proxy/test/eth2dai_bridge.ts | 5 +- contracts/asset-proxy/test/proxies.ts | 19 ++-- .../asset-proxy/test/static_call_proxy.ts | 4 +- contracts/asset-proxy/test/uniswap_bridge.ts | 5 +- .../test/utils/erc1155_proxy_wrapper.ts | 4 +- .../asset-proxy/test/utils/erc20_wrapper.ts | 4 +- .../asset-proxy/test/utils/erc721_wrapper.ts | 4 +- contracts/asset-proxy/tsconfig.json | 12 --- contracts/coordinator/package.json | 1 + contracts/coordinator/src/artifacts.ts | 20 +--- contracts/coordinator/src/wrappers.ts | 8 -- .../coordinator/test/coordinator_registry.ts | 4 +- contracts/coordinator/test/libs.ts | 6 +- contracts/coordinator/test/mixins.ts | 6 +- contracts/coordinator/tsconfig.json | 8 -- contracts/dev-utils/package.json | 1 + contracts/dev-utils/src/artifacts.ts | 6 -- contracts/dev-utils/src/wrappers.ts | 3 - contracts/dev-utils/tsconfig.json | 3 - contracts/erc1155/package.json | 1 + contracts/erc1155/src/artifacts.ts | 6 -- contracts/erc1155/src/wrappers.ts | 3 - contracts/erc1155/test/erc1155_token.ts | 9 +- .../erc1155/test/utils/erc1155_wrapper.ts | 4 +- contracts/erc1155/tsconfig.json | 3 - contracts/erc20/package.json | 1 + contracts/erc20/src/artifacts.ts | 20 +--- contracts/erc20/src/wrappers.ts | 8 -- contracts/erc20/test/lib_erc20_token.ts | 4 +- .../erc20/test/unlimited_allowance_token.ts | 4 +- contracts/erc20/test/weth9.ts | 4 +- contracts/erc20/test/zrx_token.ts | 4 +- contracts/erc20/tsconfig.json | 8 -- contracts/erc721/package.json | 1 + contracts/erc721/src/artifacts.ts | 8 +- contracts/erc721/src/wrappers.ts | 3 - contracts/erc721/test/erc721_token.ts | 5 +- contracts/erc721/tsconfig.json | 3 - contracts/exchange-forwarder/package.json | 1 + contracts/exchange-forwarder/src/artifacts.ts | 22 +---- contracts/exchange-forwarder/src/wrappers.ts | 9 -- contracts/exchange-forwarder/tsconfig.json | 9 -- contracts/exchange-libs/package.json | 1 + contracts/exchange-libs/src/artifacts.ts | 12 --- contracts/exchange-libs/src/wrappers.ts | 6 -- .../test/lib_eip712_exchange_domain.ts | 4 +- .../exchange-libs/test/lib_fill_results.ts | 19 ++-- contracts/exchange-libs/test/lib_math.ts | 36 ++++--- contracts/exchange-libs/test/lib_order.ts | 4 +- .../test/lib_zero_ex_transaction.ts | 4 +- contracts/exchange-libs/tsconfig.json | 6 -- .../assertion_wrappers/fill_order_wrapper.ts | 6 +- contracts/exchange/test/codesize.ts | 2 +- contracts/exchange/test/core.ts | 19 +--- contracts/extensions/package.json | 1 + .../test/balance_threshold_filter.ts | 15 +-- contracts/extensions/test/dutch_auction.ts | 22 ++--- contracts/extensions/test/order_matcher.ts | 22 ++--- .../test/utils/balance_threshold_wrapper.ts | 4 +- contracts/integrations/package.json | 1 + .../function_assertion_test.ts | 4 +- .../exchange_wrapper_test.ts | 6 +- .../fillorder_test.ts | 6 +- contracts/multisig/package.json | 1 + contracts/multisig/src/artifacts.ts | 8 -- contracts/multisig/src/wrappers.ts | 4 - .../multisig/test/multi_sig_with_time_lock.ts | 7 +- .../multisig/test/utils/multi_sig_wrapper.ts | 4 +- .../test/utils/zero_ex_governor_wrapper.ts | 2 +- contracts/multisig/test/zero_ex_governor.ts | 7 +- contracts/multisig/tsconfig.json | 4 - contracts/staking/package.json | 1 + contracts/staking/src/artifacts.ts | 96 +------------------ contracts/staking/src/wrappers.ts | 45 --------- contracts/staking/test/codesize_test.ts | 2 +- .../layout_and_constant_regression_test.ts | 3 +- contracts/staking/test/migration_test.ts | 5 +- .../test/unit_tests/delegator_reward_test.ts | 14 +-- .../staking/test/unit_tests/exchange_test.ts | 4 +- .../staking/test/unit_tests/finalizer_test.ts | 9 +- .../test/unit_tests/lib_cobb_douglas_test.ts | 5 +- .../test/unit_tests/lib_fixed_math_test.ts | 5 +- .../test/unit_tests/lib_safe_downcast_test.ts | 3 +- .../mixin_cumulative_rewards_test.ts | 5 +- .../test/unit_tests/mixin_scheduler_test.ts | 8 +- .../unit_tests/mixin_stake_storage_test.ts | 5 +- .../unit_tests/mixin_staking_pool_rewards.ts | 3 +- .../staking/test/unit_tests/params_test.ts | 3 +- .../test/unit_tests/protocol_fees_test.ts | 4 +- .../test/unit_tests/stake_balances_test.ts | 4 +- .../staking/test/unit_tests/stake_test.ts | 4 +- .../test/unit_tests/staking_pool_test.ts | 4 +- .../test/unit_tests/staking_proxy_test.ts | 4 +- .../staking/test/unit_tests/zrx_vault_test.ts | 4 +- contracts/staking/test/utils/api_wrapper.ts | 4 +- .../cumulative_reward_tracking_simulation.ts | 3 +- contracts/staking/tsconfig.json | 45 --------- contracts/test-utils/test/mocha_blockchain.ts | 4 +- .../test/subtests/mocha_blockchain_1.ts | 3 +- .../test-utils/test/test_with_reference.ts | 3 +- contracts/utils/package.json | 1 + contracts/utils/src/artifacts.ts | 28 +----- contracts/utils/src/wrappers.ts | 12 --- contracts/utils/test/authorizable.ts | 3 +- contracts/utils/test/lib_address.ts | 3 +- contracts/utils/test/lib_address_array.ts | 3 +- contracts/utils/test/lib_bytes.ts | 3 +- contracts/utils/test/lib_eip712.ts | 3 +- contracts/utils/test/lib_rich_errors.ts | 3 +- contracts/utils/test/lib_safe_math.ts | 4 +- contracts/utils/test/log_decoding.ts | 3 +- contracts/utils/test/ownable.ts | 3 +- contracts/utils/test/reentrancy_guard.ts | 3 +- contracts/utils/test/refundable.ts | 3 +- contracts/utils/tsconfig.json | 12 --- packages/abi-gen/package.json | 2 +- .../unit/mnemonic_wallet_subprovider_test.ts | 1 + 123 files changed, 286 insertions(+), 661 deletions(-) diff --git a/contracts/asset-proxy/package.json b/contracts/asset-proxy/package.json index 9fc098cd31..e83e9c7ea1 100644 --- a/contracts/asset-proxy/package.json +++ b/contracts/asset-proxy/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "ERC1155Proxy,ERC20Proxy,ERC721Proxy,MultiAssetProxy,StaticCallProxy,ERC20BridgeProxy,Eth2DaiBridge,IAssetData,IAssetProxy,UniswapBridge,TestStaticCallTarget", "abis": "./test/generated-artifacts/@(ERC1155Proxy|ERC20BridgeProxy|ERC20Proxy|ERC721Proxy|Eth2DaiBridge|IAssetData|IAssetProxy|IAssetProxyDispatcher|IAuthorizable|IERC20Bridge|IEth2Dai|IUniswapExchange|IUniswapExchangeFactory|MixinAssetProxyDispatcher|MixinAuthorizable|MultiAssetProxy|Ownable|StaticCallProxy|TestERC20Bridge|TestEth2DaiBridge|TestStaticCallTarget|TestUniswapBridge|UniswapBridge).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/asset-proxy/src/artifacts.ts b/contracts/asset-proxy/src/artifacts.ts index ebe46f9d40..1dd886dedf 100644 --- a/contracts/asset-proxy/src/artifacts.ts +++ b/contracts/asset-proxy/src/artifacts.ts @@ -12,44 +12,20 @@ import * as ERC721Proxy from '../generated-artifacts/ERC721Proxy.json'; import * as Eth2DaiBridge from '../generated-artifacts/Eth2DaiBridge.json'; import * as IAssetData from '../generated-artifacts/IAssetData.json'; import * as IAssetProxy from '../generated-artifacts/IAssetProxy.json'; -import * as IAssetProxyDispatcher from '../generated-artifacts/IAssetProxyDispatcher.json'; -import * as IAuthorizable from '../generated-artifacts/IAuthorizable.json'; -import * as IERC20Bridge from '../generated-artifacts/IERC20Bridge.json'; -import * as IEth2Dai from '../generated-artifacts/IEth2Dai.json'; -import * as IUniswapExchange from '../generated-artifacts/IUniswapExchange.json'; -import * as IUniswapExchangeFactory from '../generated-artifacts/IUniswapExchangeFactory.json'; -import * as MixinAssetProxyDispatcher from '../generated-artifacts/MixinAssetProxyDispatcher.json'; -import * as MixinAuthorizable from '../generated-artifacts/MixinAuthorizable.json'; import * as MultiAssetProxy from '../generated-artifacts/MultiAssetProxy.json'; -import * as Ownable from '../generated-artifacts/Ownable.json'; import * as StaticCallProxy from '../generated-artifacts/StaticCallProxy.json'; -import * as TestERC20Bridge from '../generated-artifacts/TestERC20Bridge.json'; -import * as TestEth2DaiBridge from '../generated-artifacts/TestEth2DaiBridge.json'; import * as TestStaticCallTarget from '../generated-artifacts/TestStaticCallTarget.json'; -import * as TestUniswapBridge from '../generated-artifacts/TestUniswapBridge.json'; import * as UniswapBridge from '../generated-artifacts/UniswapBridge.json'; export const artifacts = { - MixinAssetProxyDispatcher: MixinAssetProxyDispatcher as ContractArtifact, - MixinAuthorizable: MixinAuthorizable as ContractArtifact, - Ownable: Ownable as ContractArtifact, ERC1155Proxy: ERC1155Proxy as ContractArtifact, - ERC20BridgeProxy: ERC20BridgeProxy as ContractArtifact, ERC20Proxy: ERC20Proxy as ContractArtifact, ERC721Proxy: ERC721Proxy as ContractArtifact, MultiAssetProxy: MultiAssetProxy as ContractArtifact, StaticCallProxy: StaticCallProxy as ContractArtifact, + ERC20BridgeProxy: ERC20BridgeProxy as ContractArtifact, Eth2DaiBridge: Eth2DaiBridge as ContractArtifact, - UniswapBridge: UniswapBridge as ContractArtifact, IAssetData: IAssetData as ContractArtifact, IAssetProxy: IAssetProxy as ContractArtifact, - IAssetProxyDispatcher: IAssetProxyDispatcher as ContractArtifact, - IAuthorizable: IAuthorizable as ContractArtifact, - IERC20Bridge: IERC20Bridge as ContractArtifact, - IEth2Dai: IEth2Dai as ContractArtifact, - IUniswapExchange: IUniswapExchange as ContractArtifact, - IUniswapExchangeFactory: IUniswapExchangeFactory as ContractArtifact, - TestERC20Bridge: TestERC20Bridge as ContractArtifact, - TestEth2DaiBridge: TestEth2DaiBridge as ContractArtifact, + UniswapBridge: UniswapBridge as ContractArtifact, TestStaticCallTarget: TestStaticCallTarget as ContractArtifact, - TestUniswapBridge: TestUniswapBridge as ContractArtifact, }; diff --git a/contracts/asset-proxy/src/wrappers.ts b/contracts/asset-proxy/src/wrappers.ts index a39cbd282b..0fa37a911c 100644 --- a/contracts/asset-proxy/src/wrappers.ts +++ b/contracts/asset-proxy/src/wrappers.ts @@ -10,19 +10,7 @@ export * from '../generated-wrappers/erc721_proxy'; export * from '../generated-wrappers/eth2_dai_bridge'; export * from '../generated-wrappers/i_asset_data'; export * from '../generated-wrappers/i_asset_proxy'; -export * from '../generated-wrappers/i_asset_proxy_dispatcher'; -export * from '../generated-wrappers/i_authorizable'; -export * from '../generated-wrappers/i_erc20_bridge'; -export * from '../generated-wrappers/i_eth2_dai'; -export * from '../generated-wrappers/i_uniswap_exchange'; -export * from '../generated-wrappers/i_uniswap_exchange_factory'; -export * from '../generated-wrappers/mixin_asset_proxy_dispatcher'; -export * from '../generated-wrappers/mixin_authorizable'; export * from '../generated-wrappers/multi_asset_proxy'; -export * from '../generated-wrappers/ownable'; export * from '../generated-wrappers/static_call_proxy'; -export * from '../generated-wrappers/test_erc20_bridge'; -export * from '../generated-wrappers/test_eth2_dai_bridge'; export * from '../generated-wrappers/test_static_call_target'; -export * from '../generated-wrappers/test_uniswap_bridge'; export * from '../generated-wrappers/uniswap_bridge'; diff --git a/contracts/asset-proxy/test/authorizable.ts b/contracts/asset-proxy/test/authorizable.ts index 4a7794734c..1685c609f9 100644 --- a/contracts/asset-proxy/test/authorizable.ts +++ b/contracts/asset-proxy/test/authorizable.ts @@ -5,7 +5,9 @@ import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, MixinAuthorizableContract } from '../src'; +import { artifacts } from './artifacts'; + +import { MixinAuthorizableContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/asset-proxy/test/erc1155_proxy.ts b/contracts/asset-proxy/test/erc1155_proxy.ts index 82c410a184..07afe72288 100644 --- a/contracts/asset-proxy/test/erc1155_proxy.ts +++ b/contracts/asset-proxy/test/erc1155_proxy.ts @@ -23,7 +23,10 @@ import { LogWithDecodedArgs } from 'ethereum-types'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; -import { artifacts, ERC1155ProxyContract, ERC1155ProxyWrapper, IAssetDataContract } from '../src'; +import { ERC1155ProxyContract, IAssetDataContract } from '../src/wrappers'; + +import { artifacts } from './artifacts'; +import { ERC1155ProxyWrapper } from './utils/erc1155_proxy_wrapper'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/asset-proxy/test/erc20bridge_proxy.ts b/contracts/asset-proxy/test/erc20bridge_proxy.ts index 358b0038b2..95861b388b 100644 --- a/contracts/asset-proxy/test/erc20bridge_proxy.ts +++ b/contracts/asset-proxy/test/erc20bridge_proxy.ts @@ -14,12 +14,13 @@ import { AbiEncoder, AuthorizableRevertErrors, BigNumber, StringRevertError } fr import { DecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from './artifacts'; + import { - artifacts, ERC20BridgeProxyContract, TestERC20BridgeBridgeWithdrawToEventArgs, TestERC20BridgeContract, -} from '../src'; +} from './wrappers'; blockchainTests.resets('ERC20BridgeProxy unit tests', env => { const PROXY_ID = AssetProxyId.ERC20Bridge; diff --git a/contracts/asset-proxy/test/eth2dai_bridge.ts b/contracts/asset-proxy/test/eth2dai_bridge.ts index 2cf0173239..b368c8d4ad 100644 --- a/contracts/asset-proxy/test/eth2dai_bridge.ts +++ b/contracts/asset-proxy/test/eth2dai_bridge.ts @@ -15,14 +15,15 @@ import { BigNumber, RawRevertError } from '@0x/utils'; import { DecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from './artifacts'; + import { - artifacts, TestEth2DaiBridgeContract, TestEth2DaiBridgeEvents, TestEth2DaiBridgeSellAllAmountEventArgs, TestEth2DaiBridgeTokenApproveEventArgs, TestEth2DaiBridgeTokenTransferEventArgs, -} from '../src'; +} from './wrappers'; blockchainTests.resets('Eth2DaiBridge unit tests', env => { const txHelper = new TransactionHelper(env.web3Wrapper, artifacts); diff --git a/contracts/asset-proxy/test/proxies.ts b/contracts/asset-proxy/test/proxies.ts index 232b085086..0f66004f7f 100644 --- a/contracts/asset-proxy/test/proxies.ts +++ b/contracts/asset-proxy/test/proxies.ts @@ -29,18 +29,13 @@ import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; -import { - artifacts, - ERC1155ProxyContract, - ERC1155ProxyWrapper, - ERC20ProxyContract, - ERC20Wrapper, - ERC721ProxyContract, - ERC721Wrapper, - IAssetDataContract, - IAssetProxyContract, - MultiAssetProxyContract, -} from '../src'; +import { ERC1155ProxyContract, ERC20ProxyContract, ERC721ProxyContract } from '../src/wrappers'; + +import { artifacts } from './artifacts'; +import { ERC1155ProxyWrapper } from './utils/erc1155_proxy_wrapper'; +import { ERC20Wrapper } from './utils/erc20_wrapper'; +import { ERC721Wrapper } from './utils/erc721_wrapper'; +import { IAssetDataContract, IAssetProxyContract, MultiAssetProxyContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/asset-proxy/test/static_call_proxy.ts b/contracts/asset-proxy/test/static_call_proxy.ts index 743cc476a3..8fcbc57e25 100644 --- a/contracts/asset-proxy/test/static_call_proxy.ts +++ b/contracts/asset-proxy/test/static_call_proxy.ts @@ -14,7 +14,9 @@ import { AbiEncoder, BigNumber } from '@0x/utils'; import * as chai from 'chai'; import * as ethUtil from 'ethereumjs-util'; -import { artifacts, IAssetProxyContract, StaticCallProxyContract, TestStaticCallTargetContract } from '../src'; +import { artifacts } from './artifacts'; + +import { IAssetProxyContract, StaticCallProxyContract, TestStaticCallTargetContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/asset-proxy/test/uniswap_bridge.ts b/contracts/asset-proxy/test/uniswap_bridge.ts index 2f7f6a0290..66815b421e 100644 --- a/contracts/asset-proxy/test/uniswap_bridge.ts +++ b/contracts/asset-proxy/test/uniswap_bridge.ts @@ -16,8 +16,9 @@ import { BigNumber } from '@0x/utils'; import { DecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from './artifacts'; + import { - artifacts, TestUniswapBridgeContract, TestUniswapBridgeEthToTokenTransferInputEventArgs as EthToTokenTransferInputArgs, TestUniswapBridgeEvents as ContractEvents, @@ -27,7 +28,7 @@ import { TestUniswapBridgeTokenTransferEventArgs as TokenTransferArgs, TestUniswapBridgeWethDepositEventArgs as WethDepositArgs, TestUniswapBridgeWethWithdrawEventArgs as WethWithdrawArgs, -} from '../src'; +} from './wrappers'; blockchainTests.resets('UniswapBridge unit tests', env => { const txHelper = new TransactionHelper(env.web3Wrapper, artifacts); diff --git a/contracts/asset-proxy/test/utils/erc1155_proxy_wrapper.ts b/contracts/asset-proxy/test/utils/erc1155_proxy_wrapper.ts index 5bc707af41..cc40915f1d 100644 --- a/contracts/asset-proxy/test/utils/erc1155_proxy_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc1155_proxy_wrapper.ts @@ -13,7 +13,9 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, ERC1155ProxyContract, IAssetProxyContract } from '../../src'; +import { artifacts } from '../../src/artifacts'; + +import { ERC1155ProxyContract, IAssetProxyContract } from '../../src/wrappers'; export class ERC1155ProxyWrapper { private readonly _tokenOwnerAddresses: string[]; diff --git a/contracts/asset-proxy/test/utils/erc20_wrapper.ts b/contracts/asset-proxy/test/utils/erc20_wrapper.ts index 52e8d43142..831dfbf26f 100644 --- a/contracts/asset-proxy/test/utils/erc20_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc20_wrapper.ts @@ -5,7 +5,9 @@ import { BigNumber } from '@0x/utils'; import { ZeroExProvider } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, ERC20ProxyContract } from '../../src'; +import { artifacts } from '../../src/artifacts'; + +import { ERC20ProxyContract } from '../../src/wrappers'; export class ERC20Wrapper { private readonly _tokenOwnerAddresses: string[]; diff --git a/contracts/asset-proxy/test/utils/erc721_wrapper.ts b/contracts/asset-proxy/test/utils/erc721_wrapper.ts index e2ae988930..068c675f1e 100644 --- a/contracts/asset-proxy/test/utils/erc721_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc721_wrapper.ts @@ -5,7 +5,9 @@ import { BigNumber } from '@0x/utils'; import { ZeroExProvider } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, ERC721ProxyContract } from '../../src'; +import { artifacts } from '../../src/artifacts'; + +import { ERC721ProxyContract } from '../../src/wrappers'; export class ERC721Wrapper { private readonly _tokenOwnerAddresses: string[]; diff --git a/contracts/asset-proxy/tsconfig.json b/contracts/asset-proxy/tsconfig.json index 63f22050f0..f96ede121d 100644 --- a/contracts/asset-proxy/tsconfig.json +++ b/contracts/asset-proxy/tsconfig.json @@ -10,21 +10,9 @@ "generated-artifacts/Eth2DaiBridge.json", "generated-artifacts/IAssetData.json", "generated-artifacts/IAssetProxy.json", - "generated-artifacts/IAssetProxyDispatcher.json", - "generated-artifacts/IAuthorizable.json", - "generated-artifacts/IERC20Bridge.json", - "generated-artifacts/IEth2Dai.json", - "generated-artifacts/IUniswapExchange.json", - "generated-artifacts/IUniswapExchangeFactory.json", - "generated-artifacts/MixinAssetProxyDispatcher.json", - "generated-artifacts/MixinAuthorizable.json", "generated-artifacts/MultiAssetProxy.json", - "generated-artifacts/Ownable.json", "generated-artifacts/StaticCallProxy.json", - "generated-artifacts/TestERC20Bridge.json", - "generated-artifacts/TestEth2DaiBridge.json", "generated-artifacts/TestStaticCallTarget.json", - "generated-artifacts/TestUniswapBridge.json", "generated-artifacts/UniswapBridge.json", "test/generated-artifacts/ERC1155Proxy.json", "test/generated-artifacts/ERC20BridgeProxy.json", diff --git a/contracts/coordinator/package.json b/contracts/coordinator/package.json index a92969a0a2..ea07ee5061 100644 --- a/contracts/coordinator/package.json +++ b/contracts/coordinator/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "Coordinator,CoordinatorRegistry,LibCoordinatorApproval,LibCoordinatorRichErrors,LibEIP712CoordinatorDomain,LibConstants", "abis": "./test/generated-artifacts/@(Coordinator|CoordinatorRegistry|ICoordinatorApprovalVerifier|ICoordinatorCore|ICoordinatorRegistryCore|ICoordinatorSignatureValidator|LibConstants|LibCoordinatorApproval|LibCoordinatorRichErrors|LibEIP712CoordinatorDomain|MixinCoordinatorApprovalVerifier|MixinCoordinatorCore|MixinCoordinatorRegistryCore|MixinSignatureValidator).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/coordinator/src/artifacts.ts b/contracts/coordinator/src/artifacts.ts index 9722198ad8..61e478dc39 100644 --- a/contracts/coordinator/src/artifacts.ts +++ b/contracts/coordinator/src/artifacts.ts @@ -7,31 +7,15 @@ import { ContractArtifact } from 'ethereum-types'; import * as Coordinator from '../generated-artifacts/Coordinator.json'; import * as CoordinatorRegistry from '../generated-artifacts/CoordinatorRegistry.json'; -import * as ICoordinatorApprovalVerifier from '../generated-artifacts/ICoordinatorApprovalVerifier.json'; -import * as ICoordinatorCore from '../generated-artifacts/ICoordinatorCore.json'; -import * as ICoordinatorRegistryCore from '../generated-artifacts/ICoordinatorRegistryCore.json'; -import * as ICoordinatorSignatureValidator from '../generated-artifacts/ICoordinatorSignatureValidator.json'; import * as LibConstants from '../generated-artifacts/LibConstants.json'; import * as LibCoordinatorApproval from '../generated-artifacts/LibCoordinatorApproval.json'; import * as LibCoordinatorRichErrors from '../generated-artifacts/LibCoordinatorRichErrors.json'; import * as LibEIP712CoordinatorDomain from '../generated-artifacts/LibEIP712CoordinatorDomain.json'; -import * as MixinCoordinatorApprovalVerifier from '../generated-artifacts/MixinCoordinatorApprovalVerifier.json'; -import * as MixinCoordinatorCore from '../generated-artifacts/MixinCoordinatorCore.json'; -import * as MixinCoordinatorRegistryCore from '../generated-artifacts/MixinCoordinatorRegistryCore.json'; -import * as MixinSignatureValidator from '../generated-artifacts/MixinSignatureValidator.json'; export const artifacts = { Coordinator: Coordinator as ContractArtifact, - MixinCoordinatorApprovalVerifier: MixinCoordinatorApprovalVerifier as ContractArtifact, - MixinCoordinatorCore: MixinCoordinatorCore as ContractArtifact, - MixinSignatureValidator: MixinSignatureValidator as ContractArtifact, - ICoordinatorApprovalVerifier: ICoordinatorApprovalVerifier as ContractArtifact, - ICoordinatorCore: ICoordinatorCore as ContractArtifact, - ICoordinatorSignatureValidator: ICoordinatorSignatureValidator as ContractArtifact, - LibConstants: LibConstants as ContractArtifact, + CoordinatorRegistry: CoordinatorRegistry as ContractArtifact, LibCoordinatorApproval: LibCoordinatorApproval as ContractArtifact, LibCoordinatorRichErrors: LibCoordinatorRichErrors as ContractArtifact, LibEIP712CoordinatorDomain: LibEIP712CoordinatorDomain as ContractArtifact, - CoordinatorRegistry: CoordinatorRegistry as ContractArtifact, - MixinCoordinatorRegistryCore: MixinCoordinatorRegistryCore as ContractArtifact, - ICoordinatorRegistryCore: ICoordinatorRegistryCore as ContractArtifact, + LibConstants: LibConstants as ContractArtifact, }; diff --git a/contracts/coordinator/src/wrappers.ts b/contracts/coordinator/src/wrappers.ts index 1307b59821..53905d57a5 100644 --- a/contracts/coordinator/src/wrappers.ts +++ b/contracts/coordinator/src/wrappers.ts @@ -5,15 +5,7 @@ */ export * from '../generated-wrappers/coordinator'; export * from '../generated-wrappers/coordinator_registry'; -export * from '../generated-wrappers/i_coordinator_approval_verifier'; -export * from '../generated-wrappers/i_coordinator_core'; -export * from '../generated-wrappers/i_coordinator_registry_core'; -export * from '../generated-wrappers/i_coordinator_signature_validator'; export * from '../generated-wrappers/lib_constants'; export * from '../generated-wrappers/lib_coordinator_approval'; export * from '../generated-wrappers/lib_coordinator_rich_errors'; export * from '../generated-wrappers/lib_e_i_p712_coordinator_domain'; -export * from '../generated-wrappers/mixin_coordinator_approval_verifier'; -export * from '../generated-wrappers/mixin_coordinator_core'; -export * from '../generated-wrappers/mixin_coordinator_registry_core'; -export * from '../generated-wrappers/mixin_signature_validator'; diff --git a/contracts/coordinator/test/coordinator_registry.ts b/contracts/coordinator/test/coordinator_registry.ts index 743132fa7e..4d732c2af5 100644 --- a/contracts/coordinator/test/coordinator_registry.ts +++ b/contracts/coordinator/test/coordinator_registry.ts @@ -1,6 +1,8 @@ import { blockchainTests, expect, verifyEvents } from '@0x/contracts-test-utils'; -import { artifacts, CoordinatorRegistryContract, CoordinatorRegistryCoordinatorEndpointSetEventArgs } from '../src'; +import { artifacts } from './artifacts'; + +import { CoordinatorRegistryContract, CoordinatorRegistryCoordinatorEndpointSetEventArgs } from './wrappers'; // tslint:disable:no-unnecessary-type-assertion blockchainTests.resets('Coordinator Registry tests', env => { diff --git a/contracts/coordinator/test/libs.ts b/contracts/coordinator/test/libs.ts index ef6eb0b2a7..094797c243 100644 --- a/contracts/coordinator/test/libs.ts +++ b/contracts/coordinator/test/libs.ts @@ -2,7 +2,11 @@ import { blockchainTests, constants, expect, randomAddress } from '@0x/contracts import { transactionHashUtils } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; -import { artifacts, CoordinatorContract, hashUtils } from '../src'; +import { hashUtils } from './utils/hash_utils'; + +import { artifacts } from './artifacts'; + +import { CoordinatorContract } from './wrappers'; blockchainTests.resets('Libs tests', env => { let coordinatorContract: CoordinatorContract; diff --git a/contracts/coordinator/test/mixins.ts b/contracts/coordinator/test/mixins.ts index 44238f7adc..d5a76d1ce5 100644 --- a/contracts/coordinator/test/mixins.ts +++ b/contracts/coordinator/test/mixins.ts @@ -13,7 +13,11 @@ import { CoordinatorRevertErrors, transactionHashUtils } from '@0x/order-utils'; import { SignatureType, SignedOrder } from '@0x/types'; import { BigNumber, LibBytesRevertErrors } from '@0x/utils'; -import { ApprovalFactory, artifacts, CoordinatorContract } from '../src'; +import { ApprovalFactory } from './utils/approval_factory'; + +import { artifacts } from './artifacts'; + +import { CoordinatorContract } from './wrappers'; blockchainTests.resets('Mixins tests', env => { let chainId: number; diff --git a/contracts/coordinator/tsconfig.json b/contracts/coordinator/tsconfig.json index 665faf907a..cd6b5d948f 100644 --- a/contracts/coordinator/tsconfig.json +++ b/contracts/coordinator/tsconfig.json @@ -5,18 +5,10 @@ "files": [ "generated-artifacts/Coordinator.json", "generated-artifacts/CoordinatorRegistry.json", - "generated-artifacts/ICoordinatorApprovalVerifier.json", - "generated-artifacts/ICoordinatorCore.json", - "generated-artifacts/ICoordinatorRegistryCore.json", - "generated-artifacts/ICoordinatorSignatureValidator.json", "generated-artifacts/LibConstants.json", "generated-artifacts/LibCoordinatorApproval.json", "generated-artifacts/LibCoordinatorRichErrors.json", "generated-artifacts/LibEIP712CoordinatorDomain.json", - "generated-artifacts/MixinCoordinatorApprovalVerifier.json", - "generated-artifacts/MixinCoordinatorCore.json", - "generated-artifacts/MixinCoordinatorRegistryCore.json", - "generated-artifacts/MixinSignatureValidator.json", "test/generated-artifacts/Coordinator.json", "test/generated-artifacts/CoordinatorRegistry.json", "test/generated-artifacts/ICoordinatorApprovalVerifier.json", diff --git a/contracts/dev-utils/package.json b/contracts/dev-utils/package.json index fd19351074..c0f04688d8 100644 --- a/contracts/dev-utils/package.json +++ b/contracts/dev-utils/package.json @@ -24,6 +24,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "DevUtils,LibAssetData,LibTransactionDecoder", "abis": "./test/generated-artifacts/@(DevUtils|EthBalanceChecker|LibAssetData|LibTransactionDecoder|OrderTransferSimulationUtils|OrderValidationUtils).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/dev-utils/src/artifacts.ts b/contracts/dev-utils/src/artifacts.ts index 6d4be86321..3c2f022c66 100644 --- a/contracts/dev-utils/src/artifacts.ts +++ b/contracts/dev-utils/src/artifacts.ts @@ -6,16 +6,10 @@ import { ContractArtifact } from 'ethereum-types'; import * as DevUtils from '../generated-artifacts/DevUtils.json'; -import * as EthBalanceChecker from '../generated-artifacts/EthBalanceChecker.json'; import * as LibAssetData from '../generated-artifacts/LibAssetData.json'; import * as LibTransactionDecoder from '../generated-artifacts/LibTransactionDecoder.json'; -import * as OrderTransferSimulationUtils from '../generated-artifacts/OrderTransferSimulationUtils.json'; -import * as OrderValidationUtils from '../generated-artifacts/OrderValidationUtils.json'; export const artifacts = { DevUtils: DevUtils as ContractArtifact, - EthBalanceChecker: EthBalanceChecker as ContractArtifact, LibAssetData: LibAssetData as ContractArtifact, LibTransactionDecoder: LibTransactionDecoder as ContractArtifact, - OrderTransferSimulationUtils: OrderTransferSimulationUtils as ContractArtifact, - OrderValidationUtils: OrderValidationUtils as ContractArtifact, }; diff --git a/contracts/dev-utils/src/wrappers.ts b/contracts/dev-utils/src/wrappers.ts index a457a7998e..e07c65436d 100644 --- a/contracts/dev-utils/src/wrappers.ts +++ b/contracts/dev-utils/src/wrappers.ts @@ -4,8 +4,5 @@ * ----------------------------------------------------------------------------- */ export * from '../generated-wrappers/dev_utils'; -export * from '../generated-wrappers/eth_balance_checker'; export * from '../generated-wrappers/lib_asset_data'; export * from '../generated-wrappers/lib_transaction_decoder'; -export * from '../generated-wrappers/order_transfer_simulation_utils'; -export * from '../generated-wrappers/order_validation_utils'; diff --git a/contracts/dev-utils/tsconfig.json b/contracts/dev-utils/tsconfig.json index 9c73a11607..ec5f1f9157 100644 --- a/contracts/dev-utils/tsconfig.json +++ b/contracts/dev-utils/tsconfig.json @@ -4,11 +4,8 @@ "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ "generated-artifacts/DevUtils.json", - "generated-artifacts/EthBalanceChecker.json", "generated-artifacts/LibAssetData.json", "generated-artifacts/LibTransactionDecoder.json", - "generated-artifacts/OrderTransferSimulationUtils.json", - "generated-artifacts/OrderValidationUtils.json", "test/generated-artifacts/DevUtils.json", "test/generated-artifacts/EthBalanceChecker.json", "test/generated-artifacts/LibAssetData.json", diff --git a/contracts/erc1155/package.json b/contracts/erc1155/package.json index cacb08e9af..b2fb8c187b 100644 --- a/contracts/erc1155/package.json +++ b/contracts/erc1155/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "ERC1155,ERC1155Mintable,IERC1155Receiver,DummyERC1155Receiver", "abis": "./test/generated-artifacts/@(DummyERC1155Receiver|ERC1155|ERC1155Mintable|IERC1155|IERC1155Mintable|IERC1155Receiver|MixinNonFungibleToken).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/erc1155/src/artifacts.ts b/contracts/erc1155/src/artifacts.ts index 196fb37ef5..42606f89ca 100644 --- a/contracts/erc1155/src/artifacts.ts +++ b/contracts/erc1155/src/artifacts.ts @@ -8,16 +8,10 @@ import { ContractArtifact } from 'ethereum-types'; import * as DummyERC1155Receiver from '../generated-artifacts/DummyERC1155Receiver.json'; import * as ERC1155 from '../generated-artifacts/ERC1155.json'; import * as ERC1155Mintable from '../generated-artifacts/ERC1155Mintable.json'; -import * as IERC1155 from '../generated-artifacts/IERC1155.json'; -import * as IERC1155Mintable from '../generated-artifacts/IERC1155Mintable.json'; import * as IERC1155Receiver from '../generated-artifacts/IERC1155Receiver.json'; -import * as MixinNonFungibleToken from '../generated-artifacts/MixinNonFungibleToken.json'; export const artifacts = { ERC1155: ERC1155 as ContractArtifact, ERC1155Mintable: ERC1155Mintable as ContractArtifact, - MixinNonFungibleToken: MixinNonFungibleToken as ContractArtifact, - IERC1155: IERC1155 as ContractArtifact, - IERC1155Mintable: IERC1155Mintable as ContractArtifact, IERC1155Receiver: IERC1155Receiver as ContractArtifact, DummyERC1155Receiver: DummyERC1155Receiver as ContractArtifact, }; diff --git a/contracts/erc1155/src/wrappers.ts b/contracts/erc1155/src/wrappers.ts index b7819dfce1..f48fde01c5 100644 --- a/contracts/erc1155/src/wrappers.ts +++ b/contracts/erc1155/src/wrappers.ts @@ -6,7 +6,4 @@ export * from '../generated-wrappers/dummy_erc1155_receiver'; export * from '../generated-wrappers/erc1155'; export * from '../generated-wrappers/erc1155_mintable'; -export * from '../generated-wrappers/i_erc1155_mintable'; export * from '../generated-wrappers/i_erc1155_receiver'; -export * from '../generated-wrappers/ierc1155'; -export * from '../generated-wrappers/mixin_non_fungible_token'; diff --git a/contracts/erc1155/test/erc1155_token.ts b/contracts/erc1155/test/erc1155_token.ts index ef3b2def3e..bf2eda28f5 100644 --- a/contracts/erc1155/test/erc1155_token.ts +++ b/contracts/erc1155/test/erc1155_token.ts @@ -13,14 +13,11 @@ import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; -import { - artifacts, - DummyERC1155ReceiverBatchTokenReceivedEventArgs, - DummyERC1155ReceiverContract, - ERC1155MintableContract, -} from '../src'; +import { ERC1155MintableContract } from '../src/wrappers'; +import { artifacts } from './artifacts'; import { Erc1155Wrapper } from './utils/erc1155_wrapper'; +import { DummyERC1155ReceiverBatchTokenReceivedEventArgs, DummyERC1155ReceiverContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); diff --git a/contracts/erc1155/test/utils/erc1155_wrapper.ts b/contracts/erc1155/test/utils/erc1155_wrapper.ts index 984935db17..3e616792a9 100644 --- a/contracts/erc1155/test/utils/erc1155_wrapper.ts +++ b/contracts/erc1155/test/utils/erc1155_wrapper.ts @@ -5,7 +5,9 @@ import * as chai from 'chai'; import { LogWithDecodedArgs, Provider, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, ERC1155MintableContract, ERC1155TransferSingleEventArgs } from '../../src'; +import { ERC1155MintableContract, ERC1155TransferSingleEventArgs } from '../../src/wrappers'; + +import { artifacts } from '../artifacts'; const expect = chai.expect; diff --git a/contracts/erc1155/tsconfig.json b/contracts/erc1155/tsconfig.json index df202ecd79..751a5cace3 100644 --- a/contracts/erc1155/tsconfig.json +++ b/contracts/erc1155/tsconfig.json @@ -6,10 +6,7 @@ "generated-artifacts/DummyERC1155Receiver.json", "generated-artifacts/ERC1155.json", "generated-artifacts/ERC1155Mintable.json", - "generated-artifacts/IERC1155.json", - "generated-artifacts/IERC1155Mintable.json", "generated-artifacts/IERC1155Receiver.json", - "generated-artifacts/MixinNonFungibleToken.json", "test/generated-artifacts/DummyERC1155Receiver.json", "test/generated-artifacts/ERC1155.json", "test/generated-artifacts/ERC1155Mintable.json", diff --git a/contracts/erc20/package.json b/contracts/erc20/package.json index 68e3c21a24..a74eb8a492 100644 --- a/contracts/erc20/package.json +++ b/contracts/erc20/package.json @@ -35,6 +35,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { + "publicInterfaceContracts": "DummyERC20Token,ERC20Token,WETH9,ZRXToken,DummyNoReturnERC20Token,DummyMultipleReturnERC20Token", "abis": "./test/generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|ERC20Token|IERC20Token|IEtherToken|LibERC20Token|MintableERC20Token|TestLibERC20Token|TestLibERC20TokenTarget|UnlimitedAllowanceERC20Token|UntransferrableDummyERC20Token|WETH9|ZRXToken).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/erc20/src/artifacts.ts b/contracts/erc20/src/artifacts.ts index 8d48dc2753..58950e0e05 100644 --- a/contracts/erc20/src/artifacts.ts +++ b/contracts/erc20/src/artifacts.ts @@ -9,29 +9,13 @@ import * as DummyERC20Token from '../generated-artifacts/DummyERC20Token.json'; import * as DummyMultipleReturnERC20Token from '../generated-artifacts/DummyMultipleReturnERC20Token.json'; import * as DummyNoReturnERC20Token from '../generated-artifacts/DummyNoReturnERC20Token.json'; import * as ERC20Token from '../generated-artifacts/ERC20Token.json'; -import * as IERC20Token from '../generated-artifacts/IERC20Token.json'; -import * as IEtherToken from '../generated-artifacts/IEtherToken.json'; -import * as LibERC20Token from '../generated-artifacts/LibERC20Token.json'; -import * as MintableERC20Token from '../generated-artifacts/MintableERC20Token.json'; -import * as TestLibERC20Token from '../generated-artifacts/TestLibERC20Token.json'; -import * as TestLibERC20TokenTarget from '../generated-artifacts/TestLibERC20TokenTarget.json'; -import * as UnlimitedAllowanceERC20Token from '../generated-artifacts/UnlimitedAllowanceERC20Token.json'; -import * as UntransferrableDummyERC20Token from '../generated-artifacts/UntransferrableDummyERC20Token.json'; import * as WETH9 from '../generated-artifacts/WETH9.json'; import * as ZRXToken from '../generated-artifacts/ZRXToken.json'; export const artifacts = { + DummyERC20Token: DummyERC20Token as ContractArtifact, ERC20Token: ERC20Token as ContractArtifact, - LibERC20Token: LibERC20Token as ContractArtifact, - MintableERC20Token: MintableERC20Token as ContractArtifact, - UnlimitedAllowanceERC20Token: UnlimitedAllowanceERC20Token as ContractArtifact, WETH9: WETH9 as ContractArtifact, ZRXToken: (ZRXToken as any) as ContractArtifact, - IERC20Token: IERC20Token as ContractArtifact, - IEtherToken: IEtherToken as ContractArtifact, - DummyERC20Token: DummyERC20Token as ContractArtifact, - DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, DummyNoReturnERC20Token: DummyNoReturnERC20Token as ContractArtifact, - TestLibERC20Token: TestLibERC20Token as ContractArtifact, - TestLibERC20TokenTarget: TestLibERC20TokenTarget as ContractArtifact, - UntransferrableDummyERC20Token: UntransferrableDummyERC20Token as ContractArtifact, + DummyMultipleReturnERC20Token: DummyMultipleReturnERC20Token as ContractArtifact, }; diff --git a/contracts/erc20/src/wrappers.ts b/contracts/erc20/src/wrappers.ts index e38e07af17..738809db4a 100644 --- a/contracts/erc20/src/wrappers.ts +++ b/contracts/erc20/src/wrappers.ts @@ -7,13 +7,5 @@ export * from '../generated-wrappers/dummy_erc20_token'; export * from '../generated-wrappers/dummy_multiple_return_erc20_token'; export * from '../generated-wrappers/dummy_no_return_erc20_token'; export * from '../generated-wrappers/erc20_token'; -export * from '../generated-wrappers/i_erc20_token'; -export * from '../generated-wrappers/i_ether_token'; -export * from '../generated-wrappers/lib_erc20_token'; -export * from '../generated-wrappers/mintable_erc20_token'; -export * from '../generated-wrappers/test_lib_erc20_token'; -export * from '../generated-wrappers/test_lib_erc20_token_target'; -export * from '../generated-wrappers/unlimited_allowance_erc20_token'; -export * from '../generated-wrappers/untransferrable_dummy_erc20_token'; export * from '../generated-wrappers/weth9'; export * from '../generated-wrappers/zrx_token'; diff --git a/contracts/erc20/test/lib_erc20_token.ts b/contracts/erc20/test/lib_erc20_token.ts index b843867a8c..48c85587ea 100644 --- a/contracts/erc20/test/lib_erc20_token.ts +++ b/contracts/erc20/test/lib_erc20_token.ts @@ -9,7 +9,9 @@ import { } from '@0x/contracts-test-utils'; import { RawRevertError, StringRevertError } from '@0x/utils'; -import { artifacts, TestLibERC20TokenContract, TestLibERC20TokenTargetEvents } from '../src'; +import { TestLibERC20TokenContract, TestLibERC20TokenTargetEvents } from './wrappers'; + +import { artifacts } from './artifacts'; blockchainTests('LibERC20Token', env => { let testContract: TestLibERC20TokenContract; diff --git a/contracts/erc20/test/unlimited_allowance_token.ts b/contracts/erc20/test/unlimited_allowance_token.ts index 9d9de2ab01..34d2e9333f 100644 --- a/contracts/erc20/test/unlimited_allowance_token.ts +++ b/contracts/erc20/test/unlimited_allowance_token.ts @@ -11,7 +11,9 @@ import { RevertReason } from '@0x/types'; import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; -import { artifacts, DummyERC20TokenContract } from '../src'; +import { DummyERC20TokenContract } from './wrappers'; + +import { artifacts } from './artifacts'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/erc20/test/weth9.ts b/contracts/erc20/test/weth9.ts index 602abd29f9..1d766184fe 100644 --- a/contracts/erc20/test/weth9.ts +++ b/contracts/erc20/test/weth9.ts @@ -12,7 +12,9 @@ import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; -import { artifacts, WETH9Contract } from '../src'; +import { WETH9Contract } from './wrappers'; + +import { artifacts } from './artifacts'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/erc20/test/zrx_token.ts b/contracts/erc20/test/zrx_token.ts index a148fc0d85..068d8c5c56 100644 --- a/contracts/erc20/test/zrx_token.ts +++ b/contracts/erc20/test/zrx_token.ts @@ -4,7 +4,9 @@ import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import * as chai from 'chai'; -import { artifacts, ZRXTokenContract } from '../src'; +import { ZRXTokenContract } from './wrappers'; + +import { artifacts } from './artifacts'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/erc20/tsconfig.json b/contracts/erc20/tsconfig.json index 76d201e0c1..f7dc0989b3 100644 --- a/contracts/erc20/tsconfig.json +++ b/contracts/erc20/tsconfig.json @@ -7,14 +7,6 @@ "generated-artifacts/DummyMultipleReturnERC20Token.json", "generated-artifacts/DummyNoReturnERC20Token.json", "generated-artifacts/ERC20Token.json", - "generated-artifacts/IERC20Token.json", - "generated-artifacts/IEtherToken.json", - "generated-artifacts/LibERC20Token.json", - "generated-artifacts/MintableERC20Token.json", - "generated-artifacts/TestLibERC20Token.json", - "generated-artifacts/TestLibERC20TokenTarget.json", - "generated-artifacts/UnlimitedAllowanceERC20Token.json", - "generated-artifacts/UntransferrableDummyERC20Token.json", "generated-artifacts/WETH9.json", "generated-artifacts/ZRXToken.json", "test/generated-artifacts/DummyERC20Token.json", diff --git a/contracts/erc721/package.json b/contracts/erc721/package.json index 8ecbda03c2..5e6a412444 100644 --- a/contracts/erc721/package.json +++ b/contracts/erc721/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "DummyERC721Token,ERC721Token,IERC721Receiver,DummyERC721Receiver", "abis": "./test/generated-artifacts/@(DummyERC721Receiver|DummyERC721Token|ERC721Token|IERC721Receiver|IERC721Token|InvalidERC721Receiver|MintableERC721Token).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/erc721/src/artifacts.ts b/contracts/erc721/src/artifacts.ts index 79a76e21b4..6a7cf0034c 100644 --- a/contracts/erc721/src/artifacts.ts +++ b/contracts/erc721/src/artifacts.ts @@ -9,15 +9,9 @@ import * as DummyERC721Receiver from '../generated-artifacts/DummyERC721Receiver import * as DummyERC721Token from '../generated-artifacts/DummyERC721Token.json'; import * as ERC721Token from '../generated-artifacts/ERC721Token.json'; import * as IERC721Receiver from '../generated-artifacts/IERC721Receiver.json'; -import * as IERC721Token from '../generated-artifacts/IERC721Token.json'; -import * as InvalidERC721Receiver from '../generated-artifacts/InvalidERC721Receiver.json'; -import * as MintableERC721Token from '../generated-artifacts/MintableERC721Token.json'; export const artifacts = { + DummyERC721Token: DummyERC721Token as ContractArtifact, ERC721Token: ERC721Token as ContractArtifact, - MintableERC721Token: MintableERC721Token as ContractArtifact, IERC721Receiver: IERC721Receiver as ContractArtifact, - IERC721Token: IERC721Token as ContractArtifact, DummyERC721Receiver: DummyERC721Receiver as ContractArtifact, - DummyERC721Token: DummyERC721Token as ContractArtifact, - InvalidERC721Receiver: InvalidERC721Receiver as ContractArtifact, }; diff --git a/contracts/erc721/src/wrappers.ts b/contracts/erc721/src/wrappers.ts index 716f6cca4e..0f0bd5c866 100644 --- a/contracts/erc721/src/wrappers.ts +++ b/contracts/erc721/src/wrappers.ts @@ -7,6 +7,3 @@ export * from '../generated-wrappers/dummy_erc721_receiver'; export * from '../generated-wrappers/dummy_erc721_token'; export * from '../generated-wrappers/erc721_token'; export * from '../generated-wrappers/i_erc721_receiver'; -export * from '../generated-wrappers/i_erc721_token'; -export * from '../generated-wrappers/invalid_erc721_receiver'; -export * from '../generated-wrappers/mintable_erc721_token'; diff --git a/contracts/erc721/test/erc721_token.ts b/contracts/erc721/test/erc721_token.ts index b3c0ba4141..04cbc1e549 100644 --- a/contracts/erc721/test/erc721_token.ts +++ b/contracts/erc721/test/erc721_token.ts @@ -15,13 +15,14 @@ import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import { - artifacts, DummyERC721ReceiverContract, DummyERC721ReceiverTokenReceivedEventArgs, DummyERC721TokenContract, DummyERC721TokenTransferEventArgs, InvalidERC721ReceiverContract, -} from '../src'; +} from './wrappers'; + +import { artifacts } from './artifacts'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/erc721/tsconfig.json b/contracts/erc721/tsconfig.json index 9df1c3a825..279937a8d0 100644 --- a/contracts/erc721/tsconfig.json +++ b/contracts/erc721/tsconfig.json @@ -7,9 +7,6 @@ "generated-artifacts/DummyERC721Token.json", "generated-artifacts/ERC721Token.json", "generated-artifacts/IERC721Receiver.json", - "generated-artifacts/IERC721Token.json", - "generated-artifacts/InvalidERC721Receiver.json", - "generated-artifacts/MintableERC721Token.json", "test/generated-artifacts/DummyERC721Receiver.json", "test/generated-artifacts/DummyERC721Token.json", "test/generated-artifacts/ERC721Token.json", diff --git a/contracts/exchange-forwarder/package.json b/contracts/exchange-forwarder/package.json index 5b922fe02d..631872c88d 100644 --- a/contracts/exchange-forwarder/package.json +++ b/contracts/exchange-forwarder/package.json @@ -35,6 +35,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "Forwarder", "abis": "./test/generated-artifacts/@(Forwarder|IAssets|IForwarder|IForwarderCore|LibConstants|LibForwarderRichErrors|MixinAssets|MixinExchangeWrapper|MixinForwarderCore|MixinWeth).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/exchange-forwarder/src/artifacts.ts b/contracts/exchange-forwarder/src/artifacts.ts index 9643be939a..a316777cb3 100644 --- a/contracts/exchange-forwarder/src/artifacts.ts +++ b/contracts/exchange-forwarder/src/artifacts.ts @@ -6,24 +6,4 @@ import { ContractArtifact } from 'ethereum-types'; import * as Forwarder from '../generated-artifacts/Forwarder.json'; -import * as IAssets from '../generated-artifacts/IAssets.json'; -import * as IForwarder from '../generated-artifacts/IForwarder.json'; -import * as IForwarderCore from '../generated-artifacts/IForwarderCore.json'; -import * as LibConstants from '../generated-artifacts/LibConstants.json'; -import * as LibForwarderRichErrors from '../generated-artifacts/LibForwarderRichErrors.json'; -import * as MixinAssets from '../generated-artifacts/MixinAssets.json'; -import * as MixinExchangeWrapper from '../generated-artifacts/MixinExchangeWrapper.json'; -import * as MixinForwarderCore from '../generated-artifacts/MixinForwarderCore.json'; -import * as MixinWeth from '../generated-artifacts/MixinWeth.json'; -export const artifacts = { - Forwarder: Forwarder as ContractArtifact, - MixinAssets: MixinAssets as ContractArtifact, - MixinExchangeWrapper: MixinExchangeWrapper as ContractArtifact, - MixinForwarderCore: MixinForwarderCore as ContractArtifact, - MixinWeth: MixinWeth as ContractArtifact, - IAssets: IAssets as ContractArtifact, - IForwarder: IForwarder as ContractArtifact, - IForwarderCore: IForwarderCore as ContractArtifact, - LibConstants: LibConstants as ContractArtifact, - LibForwarderRichErrors: LibForwarderRichErrors as ContractArtifact, -}; +export const artifacts = { Forwarder: Forwarder as ContractArtifact }; diff --git a/contracts/exchange-forwarder/src/wrappers.ts b/contracts/exchange-forwarder/src/wrappers.ts index 23213da16e..e77944402a 100644 --- a/contracts/exchange-forwarder/src/wrappers.ts +++ b/contracts/exchange-forwarder/src/wrappers.ts @@ -4,12 +4,3 @@ * ----------------------------------------------------------------------------- */ export * from '../generated-wrappers/forwarder'; -export * from '../generated-wrappers/i_assets'; -export * from '../generated-wrappers/i_forwarder'; -export * from '../generated-wrappers/i_forwarder_core'; -export * from '../generated-wrappers/lib_constants'; -export * from '../generated-wrappers/lib_forwarder_rich_errors'; -export * from '../generated-wrappers/mixin_assets'; -export * from '../generated-wrappers/mixin_exchange_wrapper'; -export * from '../generated-wrappers/mixin_forwarder_core'; -export * from '../generated-wrappers/mixin_weth'; diff --git a/contracts/exchange-forwarder/tsconfig.json b/contracts/exchange-forwarder/tsconfig.json index 8f93b0be6d..8186631147 100644 --- a/contracts/exchange-forwarder/tsconfig.json +++ b/contracts/exchange-forwarder/tsconfig.json @@ -4,15 +4,6 @@ "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ "generated-artifacts/Forwarder.json", - "generated-artifacts/IAssets.json", - "generated-artifacts/IForwarder.json", - "generated-artifacts/IForwarderCore.json", - "generated-artifacts/LibConstants.json", - "generated-artifacts/LibForwarderRichErrors.json", - "generated-artifacts/MixinAssets.json", - "generated-artifacts/MixinExchangeWrapper.json", - "generated-artifacts/MixinForwarderCore.json", - "generated-artifacts/MixinWeth.json", "test/generated-artifacts/Forwarder.json", "test/generated-artifacts/IAssets.json", "test/generated-artifacts/IForwarder.json", diff --git a/contracts/exchange-libs/package.json b/contracts/exchange-libs/package.json index a3c961a822..d799efde95 100644 --- a/contracts/exchange-libs/package.json +++ b/contracts/exchange-libs/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "IWallet,LibEIP712ExchangeDomain,LibExchangeRichErrors,LibMath,LibMathRichErrors,LibOrder,LibZeroExTransaction", "abis": "./test/generated-artifacts/@(IWallet|LibEIP712ExchangeDomain|LibExchangeRichErrors|LibFillResults|LibMath|LibMathRichErrors|LibOrder|LibZeroExTransaction|TestLibEIP712ExchangeDomain|TestLibFillResults|TestLibMath|TestLibOrder|TestLibZeroExTransaction).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/exchange-libs/src/artifacts.ts b/contracts/exchange-libs/src/artifacts.ts index 1769fc432a..e511f8c4ac 100644 --- a/contracts/exchange-libs/src/artifacts.ts +++ b/contracts/exchange-libs/src/artifacts.ts @@ -8,28 +8,16 @@ import { ContractArtifact } from 'ethereum-types'; import * as IWallet from '../generated-artifacts/IWallet.json'; import * as LibEIP712ExchangeDomain from '../generated-artifacts/LibEIP712ExchangeDomain.json'; import * as LibExchangeRichErrors from '../generated-artifacts/LibExchangeRichErrors.json'; -import * as LibFillResults from '../generated-artifacts/LibFillResults.json'; import * as LibMath from '../generated-artifacts/LibMath.json'; import * as LibMathRichErrors from '../generated-artifacts/LibMathRichErrors.json'; import * as LibOrder from '../generated-artifacts/LibOrder.json'; import * as LibZeroExTransaction from '../generated-artifacts/LibZeroExTransaction.json'; -import * as TestLibEIP712ExchangeDomain from '../generated-artifacts/TestLibEIP712ExchangeDomain.json'; -import * as TestLibFillResults from '../generated-artifacts/TestLibFillResults.json'; -import * as TestLibMath from '../generated-artifacts/TestLibMath.json'; -import * as TestLibOrder from '../generated-artifacts/TestLibOrder.json'; -import * as TestLibZeroExTransaction from '../generated-artifacts/TestLibZeroExTransaction.json'; export const artifacts = { IWallet: IWallet as ContractArtifact, LibEIP712ExchangeDomain: LibEIP712ExchangeDomain as ContractArtifact, LibExchangeRichErrors: LibExchangeRichErrors as ContractArtifact, - LibFillResults: LibFillResults as ContractArtifact, LibMath: LibMath as ContractArtifact, LibMathRichErrors: LibMathRichErrors as ContractArtifact, LibOrder: LibOrder as ContractArtifact, LibZeroExTransaction: LibZeroExTransaction as ContractArtifact, - TestLibEIP712ExchangeDomain: TestLibEIP712ExchangeDomain as ContractArtifact, - TestLibFillResults: TestLibFillResults as ContractArtifact, - TestLibMath: TestLibMath as ContractArtifact, - TestLibOrder: TestLibOrder as ContractArtifact, - TestLibZeroExTransaction: TestLibZeroExTransaction as ContractArtifact, }; diff --git a/contracts/exchange-libs/src/wrappers.ts b/contracts/exchange-libs/src/wrappers.ts index 695fe2da79..03a7601de2 100644 --- a/contracts/exchange-libs/src/wrappers.ts +++ b/contracts/exchange-libs/src/wrappers.ts @@ -6,13 +6,7 @@ export * from '../generated-wrappers/i_wallet'; export * from '../generated-wrappers/lib_e_i_p712_exchange_domain'; export * from '../generated-wrappers/lib_exchange_rich_errors'; -export * from '../generated-wrappers/lib_fill_results'; export * from '../generated-wrappers/lib_math'; export * from '../generated-wrappers/lib_math_rich_errors'; export * from '../generated-wrappers/lib_order'; export * from '../generated-wrappers/lib_zero_ex_transaction'; -export * from '../generated-wrappers/test_lib_e_i_p712_exchange_domain'; -export * from '../generated-wrappers/test_lib_fill_results'; -export * from '../generated-wrappers/test_lib_math'; -export * from '../generated-wrappers/test_lib_order'; -export * from '../generated-wrappers/test_lib_zero_ex_transaction'; diff --git a/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts b/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts index e608726e47..536aff2f22 100644 --- a/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts +++ b/contracts/exchange-libs/test/lib_eip712_exchange_domain.ts @@ -2,7 +2,9 @@ import { blockchainTests, constants, expect, randomAddress } from '@0x/contracts import { BigNumber, signTypedDataUtils } from '@0x/utils'; import * as ethUtil from 'ethereumjs-util'; -import { artifacts, TestLibEIP712ExchangeDomainContract } from '../src'; +import { TestLibEIP712ExchangeDomainContract } from './wrappers'; + +import { artifacts } from './artifacts'; blockchainTests('LibEIP712ExchangeDomain', env => { describe('constructor', () => { diff --git a/contracts/exchange-libs/test/lib_fill_results.ts b/contracts/exchange-libs/test/lib_fill_results.ts index c62ee15803..8d65b0d0ac 100644 --- a/contracts/exchange-libs/test/lib_fill_results.ts +++ b/contracts/exchange-libs/test/lib_fill_results.ts @@ -13,7 +13,10 @@ import { BigNumber, SafeMathRevertErrors } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import * as _ from 'lodash'; -import { artifacts, ReferenceFunctions, TestLibFillResultsContract } from '../src'; +import { addFillResults, calculateFillResults, getPartialAmountFloor } from '../src/reference_functions'; + +import { artifacts } from './artifacts'; +import { TestLibFillResultsContract } from './wrappers'; blockchainTests('LibFillResults', env => { interface PartialMatchedFillResults { @@ -92,7 +95,7 @@ blockchainTests('LibFillResults', env => { // in any mathematical operation in either the reference TypeScript // implementation or the Solidity implementation of // calculateFillResults. - return ReferenceFunctions.calculateFillResults( + return calculateFillResults( makeOrder(otherAmount, orderTakerAssetAmount, otherAmount, otherAmount), takerAssetFilledAmount, takerAssetFilledAmount, // Using this so that the gas price is distinct from protocolFeeMultiplier @@ -139,7 +142,7 @@ blockchainTests('LibFillResults', env => { takerFee: ONE_ETHER.times(0.0025), }); const takerAssetFilledAmount = ONE_ETHER.dividedToIntegerBy(3); - const expected = ReferenceFunctions.calculateFillResults( + const expected = calculateFillResults( order, takerAssetFilledAmount, DEFAULT_PROTOCOL_FEE_MULTIPLIER, @@ -184,7 +187,7 @@ blockchainTests('LibFillResults', env => { makerFee: MAX_UINT256_ROOT.times(11), }); const takerAssetFilledAmount = MAX_UINT256_ROOT.dividedToIntegerBy(10); - const makerAssetFilledAmount = ReferenceFunctions.getPartialAmountFloor( + const makerAssetFilledAmount = getPartialAmountFloor( takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount, @@ -272,7 +275,7 @@ blockchainTests('LibFillResults', env => { makerFee: new BigNumber(100), }); const takerAssetFilledAmount = order.takerAssetAmount.dividedToIntegerBy(3); - const makerAssetFilledAmount = ReferenceFunctions.getPartialAmountFloor( + const makerAssetFilledAmount = getPartialAmountFloor( takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount, @@ -299,7 +302,7 @@ blockchainTests('LibFillResults', env => { takerFee: new BigNumber(100), }); const takerAssetFilledAmount = order.takerAssetAmount.dividedToIntegerBy(3); - const makerAssetFilledAmount = ReferenceFunctions.getPartialAmountFloor( + const makerAssetFilledAmount = getPartialAmountFloor( takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount, @@ -349,7 +352,7 @@ blockchainTests('LibFillResults', env => { makerFee: new BigNumber(100), }); const takerAssetFilledAmount = order.takerAssetAmount.dividedToIntegerBy(3); - const makerAssetFilledAmount = ReferenceFunctions.getPartialAmountFloor( + const makerAssetFilledAmount = getPartialAmountFloor( takerAssetFilledAmount, order.takerAssetAmount, order.makerAssetAmount, @@ -392,7 +395,7 @@ blockchainTests('LibFillResults', env => { it('matches the output of the reference function', async () => { const [a, b] = DEFAULT_FILL_RESULTS; - const expected = ReferenceFunctions.addFillResults(a, b); + const expected = addFillResults(a, b); const actual = await libsContract.addFillResults.callAsync(a, b); expect(actual).to.deep.equal(expected); }); diff --git a/contracts/exchange-libs/test/lib_math.ts b/contracts/exchange-libs/test/lib_math.ts index 5e9b89023e..a5d1c73a19 100644 --- a/contracts/exchange-libs/test/lib_math.ts +++ b/contracts/exchange-libs/test/lib_math.ts @@ -9,7 +9,17 @@ import { import { LibMathRevertErrors } from '@0x/order-utils'; import { BigNumber, SafeMathRevertErrors } from '@0x/utils'; -import { artifacts, ReferenceFunctions, TestLibMathContract } from '../src'; +import { + getPartialAmountCeil, + getPartialAmountFloor, + isRoundingErrorCeil, + isRoundingErrorFloor, + safeGetPartialAmountCeil, + safeGetPartialAmountFloor, +} from '../src/reference_functions'; + +import { artifacts } from './artifacts'; +import { TestLibMathContract } from './wrappers'; blockchainTests('LibMath', env => { const { ONE_ETHER, MAX_UINT256, MAX_UINT256_ROOT, ZERO_AMOUNT } = constants; @@ -42,7 +52,7 @@ blockchainTests('LibMath', env => { describe.optional('combinatorial tests', () => { testCombinatoriallyWithReferenceFunc( 'getPartialAmountFloor', - createAsyncReferenceFunction(ReferenceFunctions.getPartialAmountFloor), + createAsyncReferenceFunction(getPartialAmountFloor), createContractTestFunction('getPartialAmountFloor'), [uint256Values, uint256Values, uint256Values], ); @@ -53,7 +63,7 @@ blockchainTests('LibMath', env => { const numerator = ONE_ETHER; const denominator = ONE_ETHER.dividedToIntegerBy(2); const target = ONE_ETHER.times(0.01); - const expected = ReferenceFunctions.getPartialAmountFloor(numerator, denominator, target); + const expected = getPartialAmountFloor(numerator, denominator, target); const actual = await libsContract.getPartialAmountFloor.callAsync(numerator, denominator, target); expect(actual).to.bignumber.eq(expected); }); @@ -101,7 +111,7 @@ blockchainTests('LibMath', env => { describe.optional('combinatorial tests', () => { testCombinatoriallyWithReferenceFunc( 'getPartialAmountCeil', - createAsyncReferenceFunction(ReferenceFunctions.getPartialAmountCeil), + createAsyncReferenceFunction(getPartialAmountCeil), createContractTestFunction('getPartialAmountCeil'), [uint256Values, uint256Values, uint256Values], ); @@ -112,7 +122,7 @@ blockchainTests('LibMath', env => { const numerator = ONE_ETHER; const denominator = ONE_ETHER.dividedToIntegerBy(2); const target = ONE_ETHER.times(0.01); - const expected = ReferenceFunctions.getPartialAmountCeil(numerator, denominator, target); + const expected = getPartialAmountCeil(numerator, denominator, target); const actual = await libsContract.getPartialAmountCeil.callAsync(numerator, denominator, target); expect(actual).to.bignumber.eq(expected); }); @@ -161,7 +171,7 @@ blockchainTests('LibMath', env => { describe.optional('combinatorial tests', () => { testCombinatoriallyWithReferenceFunc( 'safeGetPartialAmountFloor', - createAsyncReferenceFunction(ReferenceFunctions.safeGetPartialAmountFloor), + createAsyncReferenceFunction(safeGetPartialAmountFloor), createContractTestFunction('safeGetPartialAmountFloor'), [uint256Values, uint256Values, uint256Values], ); @@ -172,7 +182,7 @@ blockchainTests('LibMath', env => { const numerator = ONE_ETHER; const denominator = ONE_ETHER.dividedToIntegerBy(2); const target = ONE_ETHER.times(0.01); - const expected = ReferenceFunctions.safeGetPartialAmountFloor(numerator, denominator, target); + const expected = safeGetPartialAmountFloor(numerator, denominator, target); const actual = await libsContract.safeGetPartialAmountFloor.callAsync(numerator, denominator, target); expect(actual).to.bignumber.eq(expected); }); @@ -226,7 +236,7 @@ blockchainTests('LibMath', env => { describe.optional('combinatorial tests', () => { testCombinatoriallyWithReferenceFunc( 'safeGetPartialAmountCeil', - createAsyncReferenceFunction(ReferenceFunctions.safeGetPartialAmountCeil), + createAsyncReferenceFunction(safeGetPartialAmountCeil), createContractTestFunction('safeGetPartialAmountCeil'), [uint256Values, uint256Values, uint256Values], ); @@ -237,7 +247,7 @@ blockchainTests('LibMath', env => { const numerator = ONE_ETHER; const denominator = ONE_ETHER.dividedToIntegerBy(2); const target = ONE_ETHER.times(0.01); - const expected = ReferenceFunctions.safeGetPartialAmountCeil(numerator, denominator, target); + const expected = safeGetPartialAmountCeil(numerator, denominator, target); const actual = await libsContract.safeGetPartialAmountCeil.callAsync(numerator, denominator, target); expect(actual).to.bignumber.eq(expected); }); @@ -291,7 +301,7 @@ blockchainTests('LibMath', env => { describe.optional('combinatorial tests', () => { testCombinatoriallyWithReferenceFunc( 'isRoundingErrorFloor', - createAsyncReferenceFunction(ReferenceFunctions.isRoundingErrorFloor), + createAsyncReferenceFunction(isRoundingErrorFloor), createContractTestFunction('isRoundingErrorFloor'), [uint256Values, uint256Values, uint256Values], ); @@ -321,7 +331,7 @@ blockchainTests('LibMath', env => { const denominator = ONE_ETHER.dividedToIntegerBy(2); const target = ONE_ETHER.times(0.01); // tslint:disable-next-line: boolean-naming - const expected = ReferenceFunctions.isRoundingErrorFloor(numerator, denominator, target); + const expected = isRoundingErrorFloor(numerator, denominator, target); // tslint:disable-next-line: boolean-naming const actual = await libsContract.isRoundingErrorFloor.callAsync(numerator, denominator, target); expect(actual).to.eq(expected); @@ -357,7 +367,7 @@ blockchainTests('LibMath', env => { describe.optional('combinatorial tests', () => { testCombinatoriallyWithReferenceFunc( 'isRoundingErrorCeil', - createAsyncReferenceFunction(ReferenceFunctions.isRoundingErrorCeil), + createAsyncReferenceFunction(isRoundingErrorCeil), createContractTestFunction('isRoundingErrorCeil'), [uint256Values, uint256Values, uint256Values], ); @@ -387,7 +397,7 @@ blockchainTests('LibMath', env => { const denominator = ONE_ETHER.dividedToIntegerBy(2); const target = ONE_ETHER.times(0.01); // tslint:disable-next-line: boolean-naming - const expected = ReferenceFunctions.isRoundingErrorCeil(numerator, denominator, target); + const expected = isRoundingErrorCeil(numerator, denominator, target); // tslint:disable-next-line: boolean-naming const actual = await libsContract.isRoundingErrorCeil.callAsync(numerator, denominator, target); expect(actual).to.eq(expected); diff --git a/contracts/exchange-libs/test/lib_order.ts b/contracts/exchange-libs/test/lib_order.ts index ec87e6b4cd..dac5b7e1cf 100644 --- a/contracts/exchange-libs/test/lib_order.ts +++ b/contracts/exchange-libs/test/lib_order.ts @@ -5,7 +5,9 @@ import { BigNumber, signTypedDataUtils } from '@0x/utils'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; -import { artifacts, TestLibOrderContract } from '../src'; +import { TestLibOrderContract } from './wrappers'; + +import { artifacts } from './artifacts'; blockchainTests('LibOrder', env => { let libOrderContract: TestLibOrderContract; diff --git a/contracts/exchange-libs/test/lib_zero_ex_transaction.ts b/contracts/exchange-libs/test/lib_zero_ex_transaction.ts index 00d3446606..1c4b9c8d17 100644 --- a/contracts/exchange-libs/test/lib_zero_ex_transaction.ts +++ b/contracts/exchange-libs/test/lib_zero_ex_transaction.ts @@ -5,7 +5,9 @@ import { BigNumber, signTypedDataUtils } from '@0x/utils'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; -import { artifacts, TestLibZeroExTransactionContract } from '../src'; +import { TestLibZeroExTransactionContract } from './wrappers'; + +import { artifacts } from './artifacts'; blockchainTests('LibZeroExTransaction', env => { let libZeroExTransactionContract: TestLibZeroExTransactionContract; diff --git a/contracts/exchange-libs/tsconfig.json b/contracts/exchange-libs/tsconfig.json index 8babe39b95..26f76e6e57 100644 --- a/contracts/exchange-libs/tsconfig.json +++ b/contracts/exchange-libs/tsconfig.json @@ -6,16 +6,10 @@ "generated-artifacts/IWallet.json", "generated-artifacts/LibEIP712ExchangeDomain.json", "generated-artifacts/LibExchangeRichErrors.json", - "generated-artifacts/LibFillResults.json", "generated-artifacts/LibMath.json", "generated-artifacts/LibMathRichErrors.json", "generated-artifacts/LibOrder.json", "generated-artifacts/LibZeroExTransaction.json", - "generated-artifacts/TestLibEIP712ExchangeDomain.json", - "generated-artifacts/TestLibFillResults.json", - "generated-artifacts/TestLibMath.json", - "generated-artifacts/TestLibOrder.json", - "generated-artifacts/TestLibZeroExTransaction.json", "test/generated-artifacts/IWallet.json", "test/generated-artifacts/LibEIP712ExchangeDomain.json", "test/generated-artifacts/LibExchangeRichErrors.json", diff --git a/contracts/exchange/test/assertion_wrappers/fill_order_wrapper.ts b/contracts/exchange/test/assertion_wrappers/fill_order_wrapper.ts index 1eba3e296f..aac0377a27 100644 --- a/contracts/exchange/test/assertion_wrappers/fill_order_wrapper.ts +++ b/contracts/exchange/test/assertion_wrappers/fill_order_wrapper.ts @@ -14,6 +14,8 @@ import { BigNumber } from '@0x/utils'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; +import { ExchangeContract } from '../wrappers'; + import { BalanceStore, BlockchainBalanceStore, @@ -21,9 +23,7 @@ import { TokenContractsByName, TokenIds, TokenOwnersByName, -} from '../../src'; - -import { ExchangeContract } from '../wrappers'; +} from './../balance_stores'; export class FillOrderWrapper { private readonly _blockchainBalanceStore: BlockchainBalanceStore; diff --git a/contracts/exchange/test/codesize.ts b/contracts/exchange/test/codesize.ts index e7b2d7a498..a3091c6e6c 100644 --- a/contracts/exchange/test/codesize.ts +++ b/contracts/exchange/test/codesize.ts @@ -4,7 +4,7 @@ import * as chai from 'chai'; chaiSetup.configure(); const expect = chai.expect; -import { artifacts } from '../src'; +import { artifacts } from './artifacts'; describe('Contract Size Checks', () => { describe('Exchange', () => { diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index 13f26f5eb9..4464faba0a 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -11,7 +11,7 @@ import { TestStaticCallTargetContract, } from '@0x/contracts-asset-proxy'; import { DevUtilsContract } from '@0x/contracts-dev-utils'; -import { ERC1155MintableContract } from '@0x/contracts-erc1155'; +import { ERC1155MintableContract, Erc1155Wrapper } from '@0x/contracts-erc1155'; import { artifacts as erc20Artifacts, DummyERC20TokenContract, @@ -40,22 +40,11 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; -import { Erc1155Wrapper } from '../../erc1155/lib/src'; +import { ExchangeWrapper, ValidatorWalletAction } from './utils'; -import { - ExchangeWrapper, - ValidatorWalletAction, -} from './utils'; - -import { - artifacts, -} from './artifacts'; +import { artifacts } from './artifacts'; import { FillOrderWrapper } from './assertion_wrappers/fill_order_wrapper'; -import { - ExchangeCancelEventArgs, - ExchangeContract, - TestValidatorWalletContract, -} from './wrappers'; +import { ExchangeCancelEventArgs, ExchangeContract, TestValidatorWalletContract } from './wrappers'; // tslint:disable:no-unnecessary-type-assertion blockchainTests.resets('Exchange core', () => { diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index 9610803c9a..b0542f34df 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "DutchAuction,OrderMatcher,BalanceThresholdFilter", "abis": "./generated-artifacts/@(BalanceThresholdFilter|DutchAuction|Exchange|ExchangeWrapper|OrderMatcher|WETH9).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/extensions/test/balance_threshold_filter.ts b/contracts/extensions/test/balance_threshold_filter.ts index 2ca02c6e3e..311a746076 100644 --- a/contracts/extensions/test/balance_threshold_filter.ts +++ b/contracts/extensions/test/balance_threshold_filter.ts @@ -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, }); diff --git a/contracts/extensions/test/dutch_auction.ts b/contracts/extensions/test/dutch_auction.ts index 25b563642a..ab9598147f 100644 --- a/contracts/extensions/test/dutch_auction.ts +++ b/contracts/extensions/test/dutch_auction.ts @@ -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, diff --git a/contracts/extensions/test/order_matcher.ts b/contracts/extensions/test/order_matcher.ts index 8ddf7519fd..561435373b 100644 --- a/contracts/extensions/test/order_matcher.ts +++ b/contracts/extensions/test/order_matcher.ts @@ -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, diff --git a/contracts/extensions/test/utils/balance_threshold_wrapper.ts b/contracts/extensions/test/utils/balance_threshold_wrapper.ts index 30d1798aeb..627e7c1a30 100644 --- a/contracts/extensions/test/utils/balance_threshold_wrapper.ts +++ b/contracts/extensions/test/utils/balance_threshold_wrapper.ts @@ -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; diff --git a/contracts/integrations/package.json b/contracts/integrations/package.json index 09e02c289a..e8c356b3f9 100644 --- a/contracts/integrations/package.json +++ b/contracts/integrations/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "TestFramework", "abis": "./test/generated-artifacts/@(TestFramework).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/integrations/test/framework-unit-tests/function_assertion_test.ts b/contracts/integrations/test/framework-unit-tests/function_assertion_test.ts index f10ec1efb7..f7e639d655 100644 --- a/contracts/integrations/test/framework-unit-tests/function_assertion_test.ts +++ b/contracts/integrations/test/framework-unit-tests/function_assertion_test.ts @@ -2,9 +2,11 @@ import { blockchainTests, constants, expect, filterLogsToArguments, getRandomInt import { BigNumber, StringRevertError } from '@0x/utils'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import { artifacts, TestFrameworkContract, TestFrameworkEventEventArgs, TestFrameworkEvents } from '../../src'; import { FunctionAssertion, Result } from '../utils/function_assertions'; +import { artifacts } from '../artifacts'; +import { TestFrameworkContract, TestFrameworkEventEventArgs, TestFrameworkEvents } from '../wrappers'; + const { ZERO_AMOUNT, MAX_UINT256 } = constants; blockchainTests.resets('FunctionAssertion Unit Tests', env => { diff --git a/contracts/integrations/test/internal-integration-tests/exchange_wrapper_test.ts b/contracts/integrations/test/internal-integration-tests/exchange_wrapper_test.ts index 2ba36dcce6..dbeed40f75 100644 --- a/contracts/integrations/test/internal-integration-tests/exchange_wrapper_test.ts +++ b/contracts/integrations/test/internal-integration-tests/exchange_wrapper_test.ts @@ -1,6 +1,6 @@ import { artifacts as assetProxyArtifacts } from '@0x/contracts-asset-proxy'; import { DevUtilsContract } from '@0x/contracts-dev-utils'; -import { IERC20TokenEvents, IERC20TokenTransferEventArgs } from '@0x/contracts-erc20'; +import { ERC20TokenEvents, ERC20TokenTransferEventArgs } from '@0x/contracts-erc20'; import { artifacts as exchangeArtifacts, BlockchainBalanceStore, @@ -192,7 +192,7 @@ blockchainTests.resets('Exchange wrappers', env => { function verifyFillEvents(receipt: TransactionReceiptWithDecodedLogs, fillTestInfos: FillTestInfo[]): void { const expectedFillEvents: IExchangeFillEventArgs[] = []; - let expectedTransferEvents: IERC20TokenTransferEventArgs[] = []; + let expectedTransferEvents: ERC20TokenTransferEventArgs[] = []; for (const { signedOrder, expectedFillResults, shouldPayWethFees } of fillTestInfos) { const orderHash = orderHashUtils.getOrderHashHex(signedOrder); @@ -248,7 +248,7 @@ blockchainTests.resets('Exchange wrappers', env => { expectedTransferEvents = expectedTransferEvents.concat(transferEvents); } verifyEvents(receipt, expectedFillEvents, IExchangeEvents.Fill); - verifyEvents(receipt, expectedTransferEvents, IERC20TokenEvents.Transfer); + verifyEvents(receipt, expectedTransferEvents, ERC20TokenEvents.Transfer); } function calculateScaledFillResultsWithMaker(signedOrder: SignedOrder, fillAmount: BigNumber): FillResults { diff --git a/contracts/integrations/test/internal-integration-tests/fillorder_test.ts b/contracts/integrations/test/internal-integration-tests/fillorder_test.ts index db1e40cf75..ed22b09206 100644 --- a/contracts/integrations/test/internal-integration-tests/fillorder_test.ts +++ b/contracts/integrations/test/internal-integration-tests/fillorder_test.ts @@ -1,5 +1,5 @@ import { DevUtilsContract } from '@0x/contracts-dev-utils'; -import { IERC20TokenEvents, IERC20TokenTransferEventArgs } from '@0x/contracts-erc20'; +import { ERC20TokenEvents, ERC20TokenTransferEventArgs } from '@0x/contracts-erc20'; import { BlockchainBalanceStore, ExchangeEvents, @@ -166,7 +166,7 @@ blockchainTests.resets('fillOrder integration tests', env => { ); // Ensure that the transfer events were correctly emitted. - verifyEvents( + verifyEvents( receipt, [ { @@ -180,7 +180,7 @@ blockchainTests.resets('fillOrder integration tests', env => { _value: order.makerAssetAmount, }, ], - IERC20TokenEvents.Transfer, + ERC20TokenEvents.Transfer, ); } diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index 7c6ad6ba9d..e341923265 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -35,6 +35,7 @@ "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { + "publicInterfaceContracts": "MultiSigWalletWithTimeLock,ZeroExGovernor", "abis": "./test/generated-artifacts/@(ContractCallReceiver|MultiSigWallet|MultiSigWalletWithTimeLock|TestRejectEther|TestZeroExGovernor|ZeroExGovernor).json", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually." }, diff --git a/contracts/multisig/src/artifacts.ts b/contracts/multisig/src/artifacts.ts index 8a0baca5d1..b9f2145823 100644 --- a/contracts/multisig/src/artifacts.ts +++ b/contracts/multisig/src/artifacts.ts @@ -5,17 +5,9 @@ */ import { ContractArtifact } from 'ethereum-types'; -import * as ContractCallReceiver from '../generated-artifacts/ContractCallReceiver.json'; -import * as MultiSigWallet from '../generated-artifacts/MultiSigWallet.json'; import * as MultiSigWalletWithTimeLock from '../generated-artifacts/MultiSigWalletWithTimeLock.json'; -import * as TestRejectEther from '../generated-artifacts/TestRejectEther.json'; -import * as TestZeroExGovernor from '../generated-artifacts/TestZeroExGovernor.json'; import * as ZeroExGovernor from '../generated-artifacts/ZeroExGovernor.json'; export const artifacts = { - MultiSigWallet: MultiSigWallet as ContractArtifact, MultiSigWalletWithTimeLock: MultiSigWalletWithTimeLock as ContractArtifact, ZeroExGovernor: ZeroExGovernor as ContractArtifact, - ContractCallReceiver: ContractCallReceiver as ContractArtifact, - TestRejectEther: TestRejectEther as ContractArtifact, - TestZeroExGovernor: TestZeroExGovernor as ContractArtifact, }; diff --git a/contracts/multisig/src/wrappers.ts b/contracts/multisig/src/wrappers.ts index 2bd971f5d3..e4ae7b41c1 100644 --- a/contracts/multisig/src/wrappers.ts +++ b/contracts/multisig/src/wrappers.ts @@ -3,9 +3,5 @@ * Warning: This file is auto-generated by contracts-gen. Don't edit manually. * ----------------------------------------------------------------------------- */ -export * from '../generated-wrappers/contract_call_receiver'; -export * from '../generated-wrappers/multi_sig_wallet'; export * from '../generated-wrappers/multi_sig_wallet_with_time_lock'; -export * from '../generated-wrappers/test_reject_ether'; -export * from '../generated-wrappers/test_zero_ex_governor'; export * from '../generated-wrappers/zero_ex_governor'; diff --git a/contracts/multisig/test/multi_sig_with_time_lock.ts b/contracts/multisig/test/multi_sig_with_time_lock.ts index 6f59a7f60b..b0d0378b0b 100644 --- a/contracts/multisig/test/multi_sig_with_time_lock.ts +++ b/contracts/multisig/test/multi_sig_with_time_lock.ts @@ -15,17 +15,18 @@ import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from './artifacts'; import { - artifacts, MultiSigWalletWithTimeLockConfirmationEventArgs, MultiSigWalletWithTimeLockConfirmationTimeSetEventArgs, MultiSigWalletWithTimeLockContract, MultiSigWalletWithTimeLockExecutionEventArgs, MultiSigWalletWithTimeLockExecutionFailureEventArgs, MultiSigWalletWithTimeLockSubmissionEventArgs, - MultiSigWrapper, TestRejectEtherContract, -} from '../src'; +} from './wrappers'; + +import { MultiSigWrapper } from './utils/multi_sig_wrapper'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/multisig/test/utils/multi_sig_wrapper.ts b/contracts/multisig/test/utils/multi_sig_wrapper.ts index 11f2ce51eb..bc74782000 100644 --- a/contracts/multisig/test/utils/multi_sig_wrapper.ts +++ b/contracts/multisig/test/utils/multi_sig_wrapper.ts @@ -3,8 +3,8 @@ import { BigNumber } from '@0x/utils'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; -import { MultiSigWalletContract, MultiSigWalletWithTimeLockContract } from '../../src'; -import { artifacts } from '../../src/artifacts'; +import { artifacts } from '../artifacts'; +import { MultiSigWalletContract, MultiSigWalletWithTimeLockContract } from '../wrappers'; export class MultiSigWrapper { private readonly _multiSig: MultiSigWalletContract | MultiSigWalletWithTimeLockContract; diff --git a/contracts/multisig/test/utils/zero_ex_governor_wrapper.ts b/contracts/multisig/test/utils/zero_ex_governor_wrapper.ts index 19a0688fd9..a7c20dd07c 100644 --- a/contracts/multisig/test/utils/zero_ex_governor_wrapper.ts +++ b/contracts/multisig/test/utils/zero_ex_governor_wrapper.ts @@ -3,7 +3,7 @@ import { AbiEncoder, BigNumber } from '@0x/utils'; import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { TestZeroExGovernorContract, ZeroExGovernorContract, ZeroExGovernorSubmissionEventArgs } from '../../src'; +import { TestZeroExGovernorContract, ZeroExGovernorContract, ZeroExGovernorSubmissionEventArgs } from '../wrappers'; // tslint:disable: no-unnecessary-type-assertion export class ZeroExGovernorWrapper { diff --git a/contracts/multisig/test/zero_ex_governor.ts b/contracts/multisig/test/zero_ex_governor.ts index 9615070613..77b5359031 100644 --- a/contracts/multisig/test/zero_ex_governor.ts +++ b/contracts/multisig/test/zero_ex_governor.ts @@ -4,15 +4,16 @@ import { BigNumber, LibBytesRevertErrors } from '@0x/utils'; import { LogEntry, LogWithDecodedArgs } from 'ethereum-types'; import * as _ from 'lodash'; +import { ZeroExGovernorWrapper } from './utils/zero_ex_governor_wrapper'; + +import { artifacts } from './artifacts'; import { - artifacts, ContractCallReceiverContract, ContractCallReceiverEventArgs, TestZeroExGovernorContract, ZeroExGovernorExecutionEventArgs, ZeroExGovernorFunctionCallTimeLockRegistrationEventArgs, - ZeroExGovernorWrapper, -} from '../src'; +} from './wrappers'; // tslint:disable: no-unnecessary-type-assertion blockchainTests.resets('ZeroExGovernor', env => { diff --git a/contracts/multisig/tsconfig.json b/contracts/multisig/tsconfig.json index f300bb3934..033cabd126 100644 --- a/contracts/multisig/tsconfig.json +++ b/contracts/multisig/tsconfig.json @@ -3,11 +3,7 @@ "compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "files": [ - "generated-artifacts/ContractCallReceiver.json", - "generated-artifacts/MultiSigWallet.json", "generated-artifacts/MultiSigWalletWithTimeLock.json", - "generated-artifacts/TestRejectEther.json", - "generated-artifacts/TestZeroExGovernor.json", "generated-artifacts/ZeroExGovernor.json", "test/generated-artifacts/ContractCallReceiver.json", "test/generated-artifacts/MultiSigWallet.json", diff --git a/contracts/staking/package.json b/contracts/staking/package.json index c430758c02..e6541bc263 100644 --- a/contracts/staking/package.json +++ b/contracts/staking/package.json @@ -37,6 +37,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "IStaking,IStakingEvents,IStakingProxy,IZrxVault,LibStakingRichErrors,Staking,StakingProxy,ZrxVault,TestStaking", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.", "abis": "./test/generated-artifacts/@(IStaking|IStakingEvents|IStakingProxy|IStorage|IStorageInit|IStructs|IZrxVault|LibCobbDouglas|LibFixedMath|LibFixedMathRichErrors|LibSafeDowncast|LibStakingRichErrors|MixinAbstract|MixinConstants|MixinCumulativeRewards|MixinDeploymentConstants|MixinExchangeFees|MixinExchangeManager|MixinFinalizer|MixinParams|MixinScheduler|MixinStake|MixinStakeBalances|MixinStakeStorage|MixinStakingPool|MixinStakingPoolRewards|MixinStorage|Staking|StakingProxy|TestAssertStorageParams|TestCobbDouglas|TestCumulativeRewardTracking|TestDelegatorRewards|TestExchangeManager|TestFinalizer|TestInitTarget|TestLibFixedMath|TestLibSafeDowncast|TestMixinCumulativeRewards|TestMixinParams|TestMixinScheduler|TestMixinStake|TestMixinStakeBalances|TestMixinStakeStorage|TestMixinStakingPool|TestMixinStakingPoolRewards|TestProtocolFees|TestProxyDestination|TestStaking|TestStakingNoWETH|TestStakingProxy|TestStakingProxyUnit|TestStorageLayoutAndConstants|ZrxVault).json" }, diff --git a/contracts/staking/src/artifacts.ts b/contracts/staking/src/artifacts.ts index 2729748a69..857f91a64b 100644 --- a/contracts/staking/src/artifacts.ts +++ b/contracts/staking/src/artifacts.ts @@ -8,110 +8,20 @@ import { ContractArtifact } from 'ethereum-types'; import * as IStaking from '../generated-artifacts/IStaking.json'; import * as IStakingEvents from '../generated-artifacts/IStakingEvents.json'; import * as IStakingProxy from '../generated-artifacts/IStakingProxy.json'; -import * as IStorage from '../generated-artifacts/IStorage.json'; -import * as IStorageInit from '../generated-artifacts/IStorageInit.json'; -import * as IStructs from '../generated-artifacts/IStructs.json'; import * as IZrxVault from '../generated-artifacts/IZrxVault.json'; -import * as LibCobbDouglas from '../generated-artifacts/LibCobbDouglas.json'; -import * as LibFixedMath from '../generated-artifacts/LibFixedMath.json'; -import * as LibFixedMathRichErrors from '../generated-artifacts/LibFixedMathRichErrors.json'; -import * as LibSafeDowncast from '../generated-artifacts/LibSafeDowncast.json'; import * as LibStakingRichErrors from '../generated-artifacts/LibStakingRichErrors.json'; -import * as MixinAbstract from '../generated-artifacts/MixinAbstract.json'; -import * as MixinConstants from '../generated-artifacts/MixinConstants.json'; -import * as MixinCumulativeRewards from '../generated-artifacts/MixinCumulativeRewards.json'; -import * as MixinDeploymentConstants from '../generated-artifacts/MixinDeploymentConstants.json'; -import * as MixinExchangeFees from '../generated-artifacts/MixinExchangeFees.json'; -import * as MixinExchangeManager from '../generated-artifacts/MixinExchangeManager.json'; -import * as MixinFinalizer from '../generated-artifacts/MixinFinalizer.json'; -import * as MixinParams from '../generated-artifacts/MixinParams.json'; -import * as MixinScheduler from '../generated-artifacts/MixinScheduler.json'; -import * as MixinStake from '../generated-artifacts/MixinStake.json'; -import * as MixinStakeBalances from '../generated-artifacts/MixinStakeBalances.json'; -import * as MixinStakeStorage from '../generated-artifacts/MixinStakeStorage.json'; -import * as MixinStakingPool from '../generated-artifacts/MixinStakingPool.json'; -import * as MixinStakingPoolRewards from '../generated-artifacts/MixinStakingPoolRewards.json'; -import * as MixinStorage from '../generated-artifacts/MixinStorage.json'; import * as Staking from '../generated-artifacts/Staking.json'; import * as StakingProxy from '../generated-artifacts/StakingProxy.json'; -import * as TestAssertStorageParams from '../generated-artifacts/TestAssertStorageParams.json'; -import * as TestCobbDouglas from '../generated-artifacts/TestCobbDouglas.json'; -import * as TestCumulativeRewardTracking from '../generated-artifacts/TestCumulativeRewardTracking.json'; -import * as TestDelegatorRewards from '../generated-artifacts/TestDelegatorRewards.json'; -import * as TestExchangeManager from '../generated-artifacts/TestExchangeManager.json'; -import * as TestFinalizer from '../generated-artifacts/TestFinalizer.json'; -import * as TestInitTarget from '../generated-artifacts/TestInitTarget.json'; -import * as TestLibFixedMath from '../generated-artifacts/TestLibFixedMath.json'; -import * as TestLibSafeDowncast from '../generated-artifacts/TestLibSafeDowncast.json'; -import * as TestMixinCumulativeRewards from '../generated-artifacts/TestMixinCumulativeRewards.json'; -import * as TestMixinParams from '../generated-artifacts/TestMixinParams.json'; -import * as TestMixinScheduler from '../generated-artifacts/TestMixinScheduler.json'; -import * as TestMixinStake from '../generated-artifacts/TestMixinStake.json'; -import * as TestMixinStakeBalances from '../generated-artifacts/TestMixinStakeBalances.json'; -import * as TestMixinStakeStorage from '../generated-artifacts/TestMixinStakeStorage.json'; -import * as TestMixinStakingPool from '../generated-artifacts/TestMixinStakingPool.json'; -import * as TestMixinStakingPoolRewards from '../generated-artifacts/TestMixinStakingPoolRewards.json'; -import * as TestProtocolFees from '../generated-artifacts/TestProtocolFees.json'; -import * as TestProxyDestination from '../generated-artifacts/TestProxyDestination.json'; import * as TestStaking from '../generated-artifacts/TestStaking.json'; -import * as TestStakingNoWETH from '../generated-artifacts/TestStakingNoWETH.json'; -import * as TestStakingProxy from '../generated-artifacts/TestStakingProxy.json'; -import * as TestStakingProxyUnit from '../generated-artifacts/TestStakingProxyUnit.json'; -import * as TestStorageLayoutAndConstants from '../generated-artifacts/TestStorageLayoutAndConstants.json'; import * as ZrxVault from '../generated-artifacts/ZrxVault.json'; export const artifacts = { - Staking: Staking as ContractArtifact, - StakingProxy: StakingProxy as ContractArtifact, - ZrxVault: ZrxVault as ContractArtifact, - MixinExchangeFees: MixinExchangeFees as ContractArtifact, - MixinExchangeManager: MixinExchangeManager as ContractArtifact, - MixinConstants: MixinConstants as ContractArtifact, - MixinDeploymentConstants: MixinDeploymentConstants as ContractArtifact, - MixinStorage: MixinStorage as ContractArtifact, IStaking: IStaking as ContractArtifact, IStakingEvents: IStakingEvents as ContractArtifact, IStakingProxy: IStakingProxy as ContractArtifact, - IStorage: IStorage as ContractArtifact, - IStorageInit: IStorageInit as ContractArtifact, - IStructs: IStructs as ContractArtifact, IZrxVault: IZrxVault as ContractArtifact, - LibCobbDouglas: LibCobbDouglas as ContractArtifact, - LibFixedMath: LibFixedMath as ContractArtifact, - LibFixedMathRichErrors: LibFixedMathRichErrors as ContractArtifact, - LibSafeDowncast: LibSafeDowncast as ContractArtifact, LibStakingRichErrors: LibStakingRichErrors as ContractArtifact, - MixinStake: MixinStake as ContractArtifact, - MixinStakeBalances: MixinStakeBalances as ContractArtifact, - MixinStakeStorage: MixinStakeStorage as ContractArtifact, - MixinCumulativeRewards: MixinCumulativeRewards as ContractArtifact, - MixinStakingPool: MixinStakingPool as ContractArtifact, - MixinStakingPoolRewards: MixinStakingPoolRewards as ContractArtifact, - MixinAbstract: MixinAbstract as ContractArtifact, - MixinFinalizer: MixinFinalizer as ContractArtifact, - MixinParams: MixinParams as ContractArtifact, - MixinScheduler: MixinScheduler as ContractArtifact, - TestAssertStorageParams: TestAssertStorageParams as ContractArtifact, - TestCobbDouglas: TestCobbDouglas as ContractArtifact, - TestCumulativeRewardTracking: TestCumulativeRewardTracking as ContractArtifact, - TestDelegatorRewards: TestDelegatorRewards as ContractArtifact, - TestExchangeManager: TestExchangeManager as ContractArtifact, - TestFinalizer: TestFinalizer as ContractArtifact, - TestInitTarget: TestInitTarget as ContractArtifact, - TestLibFixedMath: TestLibFixedMath as ContractArtifact, - TestLibSafeDowncast: TestLibSafeDowncast as ContractArtifact, - TestMixinCumulativeRewards: TestMixinCumulativeRewards as ContractArtifact, - TestMixinParams: TestMixinParams as ContractArtifact, - TestMixinScheduler: TestMixinScheduler as ContractArtifact, - TestMixinStake: TestMixinStake as ContractArtifact, - TestMixinStakeBalances: TestMixinStakeBalances as ContractArtifact, - TestMixinStakeStorage: TestMixinStakeStorage as ContractArtifact, - TestMixinStakingPool: TestMixinStakingPool as ContractArtifact, - TestMixinStakingPoolRewards: TestMixinStakingPoolRewards as ContractArtifact, - TestProtocolFees: TestProtocolFees as ContractArtifact, - TestProxyDestination: TestProxyDestination as ContractArtifact, + Staking: Staking as ContractArtifact, + StakingProxy: StakingProxy as ContractArtifact, + ZrxVault: ZrxVault as ContractArtifact, TestStaking: TestStaking as ContractArtifact, - TestStakingNoWETH: TestStakingNoWETH as ContractArtifact, - TestStakingProxy: TestStakingProxy as ContractArtifact, - TestStakingProxyUnit: TestStakingProxyUnit as ContractArtifact, - TestStorageLayoutAndConstants: TestStorageLayoutAndConstants as ContractArtifact, }; diff --git a/contracts/staking/src/wrappers.ts b/contracts/staking/src/wrappers.ts index 04657b7802..f331c5466c 100644 --- a/contracts/staking/src/wrappers.ts +++ b/contracts/staking/src/wrappers.ts @@ -6,54 +6,9 @@ export * from '../generated-wrappers/i_staking'; export * from '../generated-wrappers/i_staking_events'; export * from '../generated-wrappers/i_staking_proxy'; -export * from '../generated-wrappers/i_storage'; -export * from '../generated-wrappers/i_storage_init'; -export * from '../generated-wrappers/i_structs'; export * from '../generated-wrappers/i_zrx_vault'; -export * from '../generated-wrappers/lib_cobb_douglas'; -export * from '../generated-wrappers/lib_fixed_math'; -export * from '../generated-wrappers/lib_fixed_math_rich_errors'; -export * from '../generated-wrappers/lib_safe_downcast'; export * from '../generated-wrappers/lib_staking_rich_errors'; -export * from '../generated-wrappers/mixin_abstract'; -export * from '../generated-wrappers/mixin_constants'; -export * from '../generated-wrappers/mixin_cumulative_rewards'; -export * from '../generated-wrappers/mixin_deployment_constants'; -export * from '../generated-wrappers/mixin_exchange_fees'; -export * from '../generated-wrappers/mixin_exchange_manager'; -export * from '../generated-wrappers/mixin_finalizer'; -export * from '../generated-wrappers/mixin_params'; -export * from '../generated-wrappers/mixin_scheduler'; -export * from '../generated-wrappers/mixin_stake'; -export * from '../generated-wrappers/mixin_stake_balances'; -export * from '../generated-wrappers/mixin_stake_storage'; -export * from '../generated-wrappers/mixin_staking_pool'; -export * from '../generated-wrappers/mixin_staking_pool_rewards'; -export * from '../generated-wrappers/mixin_storage'; export * from '../generated-wrappers/staking'; export * from '../generated-wrappers/staking_proxy'; -export * from '../generated-wrappers/test_assert_storage_params'; -export * from '../generated-wrappers/test_cobb_douglas'; -export * from '../generated-wrappers/test_cumulative_reward_tracking'; -export * from '../generated-wrappers/test_delegator_rewards'; -export * from '../generated-wrappers/test_exchange_manager'; -export * from '../generated-wrappers/test_finalizer'; -export * from '../generated-wrappers/test_init_target'; -export * from '../generated-wrappers/test_lib_fixed_math'; -export * from '../generated-wrappers/test_lib_safe_downcast'; -export * from '../generated-wrappers/test_mixin_cumulative_rewards'; -export * from '../generated-wrappers/test_mixin_params'; -export * from '../generated-wrappers/test_mixin_scheduler'; -export * from '../generated-wrappers/test_mixin_stake'; -export * from '../generated-wrappers/test_mixin_stake_balances'; -export * from '../generated-wrappers/test_mixin_stake_storage'; -export * from '../generated-wrappers/test_mixin_staking_pool'; -export * from '../generated-wrappers/test_mixin_staking_pool_rewards'; -export * from '../generated-wrappers/test_protocol_fees'; -export * from '../generated-wrappers/test_proxy_destination'; export * from '../generated-wrappers/test_staking'; -export * from '../generated-wrappers/test_staking_no_w_e_t_h'; -export * from '../generated-wrappers/test_staking_proxy'; -export * from '../generated-wrappers/test_staking_proxy_unit'; -export * from '../generated-wrappers/test_storage_layout_and_constants'; export * from '../generated-wrappers/zrx_vault'; diff --git a/contracts/staking/test/codesize_test.ts b/contracts/staking/test/codesize_test.ts index 2fe4af1b13..21557401ea 100644 --- a/contracts/staking/test/codesize_test.ts +++ b/contracts/staking/test/codesize_test.ts @@ -1,6 +1,6 @@ import { constants, expect, getCodesizeFromArtifact } from '@0x/contracts-test-utils'; -import { artifacts } from '../src'; +import { artifacts } from './artifacts'; describe('Contract Size Checks', () => { describe('Staking', () => { diff --git a/contracts/staking/test/layout_and_constant_regression_test.ts b/contracts/staking/test/layout_and_constant_regression_test.ts index 968200ab1e..4a74d5eacf 100644 --- a/contracts/staking/test/layout_and_constant_regression_test.ts +++ b/contracts/staking/test/layout_and_constant_regression_test.ts @@ -1,6 +1,7 @@ import { blockchainTests } from '@0x/contracts-test-utils'; -import { artifacts, TestStorageLayoutAndConstantsContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestStorageLayoutAndConstantsContract } from './wrappers'; blockchainTests('Storage Layout and Deployment Constants Regression Tests', env => { it('Should successfully deploy the staking contract after running the layout and regression test', async () => { diff --git a/contracts/staking/test/migration_test.ts b/contracts/staking/test/migration_test.ts index d6f9b50f2a..fa67d56d82 100644 --- a/contracts/staking/test/migration_test.ts +++ b/contracts/staking/test/migration_test.ts @@ -3,14 +3,15 @@ import { StakingRevertErrors } from '@0x/order-utils'; import { AuthorizableRevertErrors, BigNumber, StringRevertError } from '@0x/utils'; import { - artifacts, StakingContract, StakingProxyContract, TestAssertStorageParamsContract, TestInitTargetContract, TestStakingProxyContract, TestStakingProxyStakingContractAttachedToProxyEventArgs, -} from '../src/'; +} from './wrappers'; + +import { artifacts } from './artifacts'; import { constants as stakingConstants } from './utils/constants'; diff --git a/contracts/staking/test/unit_tests/delegator_reward_test.ts b/contracts/staking/test/unit_tests/delegator_reward_test.ts index 58e4855e20..de36003a9a 100644 --- a/contracts/staking/test/unit_tests/delegator_reward_test.ts +++ b/contracts/staking/test/unit_tests/delegator_reward_test.ts @@ -12,19 +12,19 @@ import { import { BigNumber } from '@0x/utils'; import { LogEntry } from 'ethereum-types'; -import { - artifacts, - TestDelegatorRewardsContract, - TestDelegatorRewardsEvents, - TestDelegatorRewardsTransferEventArgs, -} from '../../src'; - +import { artifacts } from '../artifacts'; import { assertIntegerRoughlyEquals as assertRoughlyEquals, getRandomInteger, toBaseUnitAmount, } from '../utils/number_utils'; +import { + TestDelegatorRewardsContract, + TestDelegatorRewardsEvents, + TestDelegatorRewardsTransferEventArgs, +} from '../wrappers'; + blockchainTests.resets('Delegator rewards unit tests', env => { let testContract: TestDelegatorRewardsContract; diff --git a/contracts/staking/test/unit_tests/exchange_test.ts b/contracts/staking/test/unit_tests/exchange_test.ts index 6f21999d87..54a4263e21 100644 --- a/contracts/staking/test/unit_tests/exchange_test.ts +++ b/contracts/staking/test/unit_tests/exchange_test.ts @@ -3,12 +3,12 @@ import { StakingRevertErrors } from '@0x/order-utils'; import { AuthorizableRevertErrors } from '@0x/utils'; import { LogWithDecodedArgs, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; +import { artifacts } from '../artifacts'; import { - artifacts, TestExchangeManagerContract, TestExchangeManagerExchangeAddedEventArgs, TestExchangeManagerExchangeRemovedEventArgs, -} from '../../src'; +} from '../wrappers'; blockchainTests.resets('Exchange Unit Tests', env => { // Addresses diff --git a/contracts/staking/test/unit_tests/finalizer_test.ts b/contracts/staking/test/unit_tests/finalizer_test.ts index 8143917b34..5653bf8210 100644 --- a/contracts/staking/test/unit_tests/finalizer_test.ts +++ b/contracts/staking/test/unit_tests/finalizer_test.ts @@ -12,8 +12,11 @@ import { BigNumber } from '@0x/utils'; import { LogEntry } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from '../artifacts'; +import { constants as stakingConstants } from '../utils/constants'; +import { assertIntegerRoughlyEquals, getRandomInteger, toBaseUnitAmount } from '../utils/number_utils'; + import { - artifacts, IStakingEventsEpochEndedEventArgs, IStakingEventsEpochFinalizedEventArgs, IStakingEventsEvents, @@ -21,9 +24,7 @@ import { TestFinalizerContract, TestFinalizerDepositStakingPoolRewardsEventArgs as DepositStakingPoolRewardsEventArgs, TestFinalizerEvents, -} from '../../src'; -import { constants as stakingConstants } from '../utils/constants'; -import { assertIntegerRoughlyEquals, getRandomInteger, toBaseUnitAmount } from '../utils/number_utils'; +} from '../wrappers'; blockchainTests.resets('Finalizer unit tests', env => { const { ZERO_AMOUNT } = constants; diff --git a/contracts/staking/test/unit_tests/lib_cobb_douglas_test.ts b/contracts/staking/test/unit_tests/lib_cobb_douglas_test.ts index e0080e560e..f37fbc4751 100644 --- a/contracts/staking/test/unit_tests/lib_cobb_douglas_test.ts +++ b/contracts/staking/test/unit_tests/lib_cobb_douglas_test.ts @@ -2,10 +2,11 @@ import { blockchainTests, Numberish } from '@0x/contracts-test-utils'; import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; -import { artifacts, TestCobbDouglasContract } from '../../src/'; - import { assertRoughlyEquals, getRandomInteger, getRandomPortion, toDecimal } from '../utils/number_utils'; +import { artifacts } from '../artifacts'; +import { TestCobbDouglasContract } from '../wrappers'; + // tslint:disable: no-unnecessary-type-assertion blockchainTests('LibCobbDouglas unit tests', env => { const FUZZ_COUNT = 1024; diff --git a/contracts/staking/test/unit_tests/lib_fixed_math_test.ts b/contracts/staking/test/unit_tests/lib_fixed_math_test.ts index 2e98089a67..43aeface8c 100644 --- a/contracts/staking/test/unit_tests/lib_fixed_math_test.ts +++ b/contracts/staking/test/unit_tests/lib_fixed_math_test.ts @@ -3,10 +3,11 @@ import { BigNumber, FixedMathRevertErrors } from '@0x/utils'; import { Decimal } from 'decimal.js'; import * as _ from 'lodash'; -import { artifacts, TestLibFixedMathContract } from '../../src'; - import { assertRoughlyEquals, fromFixed, toDecimal, toFixed } from '../utils/number_utils'; +import { artifacts } from '../artifacts'; +import { TestLibFixedMathContract } from '../wrappers'; + blockchainTests('LibFixedMath unit tests', env => { let testContract: TestLibFixedMathContract; diff --git a/contracts/staking/test/unit_tests/lib_safe_downcast_test.ts b/contracts/staking/test/unit_tests/lib_safe_downcast_test.ts index 9a3ac8931e..4cc19e4d38 100644 --- a/contracts/staking/test/unit_tests/lib_safe_downcast_test.ts +++ b/contracts/staking/test/unit_tests/lib_safe_downcast_test.ts @@ -1,7 +1,8 @@ import { blockchainTests, expect, Numberish } from '@0x/contracts-test-utils'; import { BigNumber, SafeMathRevertErrors } from '@0x/utils'; -import { artifacts, TestLibSafeDowncastContract } from '../../src/'; +import { artifacts } from '../artifacts'; +import { TestLibSafeDowncastContract } from '../wrappers'; blockchainTests('LibSafeDowncast unit tests', env => { let testContract: TestLibSafeDowncastContract; diff --git a/contracts/staking/test/unit_tests/mixin_cumulative_rewards_test.ts b/contracts/staking/test/unit_tests/mixin_cumulative_rewards_test.ts index 97dcb1753c..da70af2c8a 100644 --- a/contracts/staking/test/unit_tests/mixin_cumulative_rewards_test.ts +++ b/contracts/staking/test/unit_tests/mixin_cumulative_rewards_test.ts @@ -2,11 +2,12 @@ import { blockchainTests, expect } from '@0x/contracts-test-utils'; import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; -import { artifacts, TestMixinCumulativeRewardsContract } from '../../src'; - import { constants as stakingConstants } from '../utils/constants'; import { toBaseUnitAmount } from '../utils/number_utils'; +import { artifacts } from '../artifacts'; +import { TestMixinCumulativeRewardsContract } from '../wrappers'; + blockchainTests.resets('MixinCumulativeRewards unit tests', env => { const ZERO = new BigNumber(0); const testRewards = [ diff --git a/contracts/staking/test/unit_tests/mixin_scheduler_test.ts b/contracts/staking/test/unit_tests/mixin_scheduler_test.ts index b8e49225b8..6e2e702440 100644 --- a/contracts/staking/test/unit_tests/mixin_scheduler_test.ts +++ b/contracts/staking/test/unit_tests/mixin_scheduler_test.ts @@ -3,14 +3,14 @@ import { StakingRevertErrors } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; import { LogWithDecodedArgs } from 'ethereum-types'; +import { constants as stakingConstants } from '../utils/constants'; + +import { artifacts } from '../artifacts'; import { - artifacts, TestMixinSchedulerContract, TestMixinSchedulerEvents, TestMixinSchedulerGoToNextEpochTestInfoEventArgs, -} from '../../src'; - -import { constants as stakingConstants } from '../utils/constants'; +} from '../wrappers'; blockchainTests.resets('MixinScheduler unit tests', env => { let testContract: TestMixinSchedulerContract; diff --git a/contracts/staking/test/unit_tests/mixin_stake_storage_test.ts b/contracts/staking/test/unit_tests/mixin_stake_storage_test.ts index 066e4077a4..31a5e186e1 100644 --- a/contracts/staking/test/unit_tests/mixin_stake_storage_test.ts +++ b/contracts/staking/test/unit_tests/mixin_stake_storage_test.ts @@ -2,10 +2,11 @@ import { blockchainTests, expect, Numberish } from '@0x/contracts-test-utils'; import { StakingRevertErrors } from '@0x/order-utils'; import { BigNumber } from '@0x/utils'; +import { constants } from '../utils/constants'; import { StoredBalance } from '../utils/types'; -import { artifacts, TestMixinStakeStorageContract } from '../../src'; -import { constants } from '../utils/constants'; +import { artifacts } from '../artifacts'; +import { TestMixinStakeStorageContract } from '../wrappers'; blockchainTests.resets('MixinStakeStorage unit tests', env => { let testContract: TestMixinStakeStorageContract; diff --git a/contracts/staking/test/unit_tests/mixin_staking_pool_rewards.ts b/contracts/staking/test/unit_tests/mixin_staking_pool_rewards.ts index 88e344f3be..d2b84a0ec4 100644 --- a/contracts/staking/test/unit_tests/mixin_staking_pool_rewards.ts +++ b/contracts/staking/test/unit_tests/mixin_staking_pool_rewards.ts @@ -16,7 +16,8 @@ import { LogEntry, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import { StoredBalance } from '../utils/types'; -import { artifacts, TestMixinStakingPoolRewardsContract, TestMixinStakingPoolRewardsEvents as Events } from '../../src'; +import { artifacts } from '../artifacts'; +import { TestMixinStakingPoolRewardsContract, TestMixinStakingPoolRewardsEvents as Events } from '../wrappers'; blockchainTests.resets('MixinStakingPoolRewards unit tests', env => { let testContract: TestMixinStakingPoolRewardsContract; diff --git a/contracts/staking/test/unit_tests/params_test.ts b/contracts/staking/test/unit_tests/params_test.ts index e49a46a141..ebca87e66a 100644 --- a/contracts/staking/test/unit_tests/params_test.ts +++ b/contracts/staking/test/unit_tests/params_test.ts @@ -3,7 +3,8 @@ import { AuthorizableRevertErrors, BigNumber } from '@0x/utils'; import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, IStakingEventsParamsSetEventArgs, TestMixinParamsContract } from '../../src/'; +import { artifacts } from '../artifacts'; +import { IStakingEventsParamsSetEventArgs, TestMixinParamsContract } from '../wrappers'; import { constants as stakingConstants } from '../utils/constants'; import { StakingParams } from '../utils/types'; diff --git a/contracts/staking/test/unit_tests/protocol_fees_test.ts b/contracts/staking/test/unit_tests/protocol_fees_test.ts index 1c027fad3a..fc082262ba 100644 --- a/contracts/staking/test/unit_tests/protocol_fees_test.ts +++ b/contracts/staking/test/unit_tests/protocol_fees_test.ts @@ -12,14 +12,14 @@ import { BigNumber } from '@0x/utils'; import { LogEntry } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from '../artifacts'; import { - artifacts, IStakingEventsEvents, IStakingEventsStakingPoolEarnedRewardsInEpochEventArgs, TestProtocolFeesContract, TestProtocolFeesERC20ProxyTransferFromEventArgs, TestProtocolFeesEvents, -} from '../../src'; +} from '../wrappers'; import { getRandomInteger } from '../utils/number_utils'; diff --git a/contracts/staking/test/unit_tests/stake_balances_test.ts b/contracts/staking/test/unit_tests/stake_balances_test.ts index 019a4487b1..7e6b50db63 100644 --- a/contracts/staking/test/unit_tests/stake_balances_test.ts +++ b/contracts/staking/test/unit_tests/stake_balances_test.ts @@ -8,7 +8,9 @@ import { } from '@0x/contracts-test-utils'; import { BigNumber, SafeMathRevertErrors } from '@0x/utils'; -import { artifacts, TestMixinStakeBalancesContract } from '../../src'; +import { artifacts } from '../artifacts'; +import { TestMixinStakeBalancesContract } from '../wrappers'; + import { constants as stakingConstants } from '../utils/constants'; import { StakeStatus, StoredBalance } from '../utils/types'; diff --git a/contracts/staking/test/unit_tests/stake_test.ts b/contracts/staking/test/unit_tests/stake_test.ts index 76e5dd5d47..d17c212ac3 100644 --- a/contracts/staking/test/unit_tests/stake_test.ts +++ b/contracts/staking/test/unit_tests/stake_test.ts @@ -15,8 +15,8 @@ import * as _ from 'lodash'; import { StakeStatus } from '../utils/types'; +import { artifacts } from '../artifacts'; import { - artifacts, TestMixinStakeContract, TestMixinStakeDecreaseCurrentAndNextBalanceEventArgs as DecreaseCurrentAndNextBalanceEventArgs, TestMixinStakeDecreaseNextBalanceEventArgs as DecreaseNextBalanceEventArgs, @@ -30,7 +30,7 @@ import { TestMixinStakeWithdrawAndSyncDelegatorRewardsEventArgs as WithdrawAndSyncDelegatorRewardsEventArgs, TestMixinStakeZrxVaultDepositFromEventArgs as ZrxVaultDepositFromEventArgs, TestMixinStakeZrxVaultWithdrawFromEventArgs as ZrxVaultWithdrawFromEventArgs, -} from '../../src'; +} from '../wrappers'; blockchainTests.resets('MixinStake unit tests', env => { let testContract: TestMixinStakeContract; diff --git a/contracts/staking/test/unit_tests/staking_pool_test.ts b/contracts/staking/test/unit_tests/staking_pool_test.ts index fef82105fb..b39bfa15d2 100644 --- a/contracts/staking/test/unit_tests/staking_pool_test.ts +++ b/contracts/staking/test/unit_tests/staking_pool_test.ts @@ -12,12 +12,12 @@ import { StakingRevertErrors } from '@0x/order-utils'; import { BigNumber, SafeMathRevertErrors } from '@0x/utils'; import * as _ from 'lodash'; +import { artifacts } from '../artifacts'; import { - artifacts, TestMixinStakingPoolContract, TestMixinStakingPoolEvents, TestMixinStakingPoolStakingPoolCreatedEventArgs as StakingPoolCreated, -} from '../../src'; +} from '../wrappers'; blockchainTests.resets('MixinStakingPool unit tests', env => { let testContract: TestMixinStakingPoolContract; diff --git a/contracts/staking/test/unit_tests/staking_proxy_test.ts b/contracts/staking/test/unit_tests/staking_proxy_test.ts index 825ed7f2bb..53744112da 100644 --- a/contracts/staking/test/unit_tests/staking_proxy_test.ts +++ b/contracts/staking/test/unit_tests/staking_proxy_test.ts @@ -3,13 +3,13 @@ import { StakingRevertErrors } from '@0x/order-utils'; import { AuthorizableRevertErrors, BigNumber } from '@0x/utils'; import * as _ from 'lodash'; +import { artifacts } from '../artifacts'; import { - artifacts, StakingProxyEvents, TestProxyDestinationContract, TestProxyDestinationEvents, TestStakingProxyUnitContract, -} from '../../src'; +} from '../wrappers'; import { constants as stakingConstants } from '../utils/constants'; diff --git a/contracts/staking/test/unit_tests/zrx_vault_test.ts b/contracts/staking/test/unit_tests/zrx_vault_test.ts index 6c2209ce44..e31d52e0f6 100644 --- a/contracts/staking/test/unit_tests/zrx_vault_test.ts +++ b/contracts/staking/test/unit_tests/zrx_vault_test.ts @@ -15,15 +15,15 @@ import { TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import { constants as stakingConstants } from '../utils/constants'; +import { artifacts } from '../artifacts'; import { - artifacts, ZrxVaultContract, ZrxVaultDepositEventArgs, ZrxVaultInCatastrophicFailureModeEventArgs, ZrxVaultStakingProxySetEventArgs, ZrxVaultWithdrawEventArgs, ZrxVaultZrxProxySetEventArgs, -} from '../../src'; +} from '../wrappers'; blockchainTests.resets('ZrxVault unit tests', env => { let accounts: string[]; diff --git a/contracts/staking/test/utils/api_wrapper.ts b/contracts/staking/test/utils/api_wrapper.ts index 11fba1b467..b186cfe9d1 100644 --- a/contracts/staking/test/utils/api_wrapper.ts +++ b/contracts/staking/test/utils/api_wrapper.ts @@ -6,8 +6,8 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import { BlockParamLiteral, ContractArtifact, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; +import { artifacts } from '../artifacts'; import { - artifacts, IStakingEventsEpochEndedEventArgs, IStakingEventsStakingPoolEarnedRewardsInEpochEventArgs, StakingProxyContract, @@ -15,7 +15,7 @@ import { TestStakingContract, TestStakingEvents, ZrxVaultContract, -} from '../../src'; +} from '../wrappers'; import { constants as stakingConstants } from './constants'; import { DecodedLogs, EndOfEpochInfo, StakingParams } from './types'; diff --git a/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts b/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts index e16f12c323..c7f591e28a 100644 --- a/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts +++ b/contracts/staking/test/utils/cumulative_reward_tracking_simulation.ts @@ -3,7 +3,8 @@ import { BigNumber } from '@0x/utils'; import { DecodedLogEntry, TransactionReceiptWithDecodedLogs } from 'ethereum-types'; import * as _ from 'lodash'; -import { artifacts, TestCumulativeRewardTrackingContract, TestCumulativeRewardTrackingEvents } from '../../src'; +import { artifacts } from '../artifacts'; +import { TestCumulativeRewardTrackingContract, TestCumulativeRewardTrackingEvents } from '../wrappers'; import { StakingApiWrapper } from './api_wrapper'; import { toBaseUnitAmount } from './number_utils'; diff --git a/contracts/staking/tsconfig.json b/contracts/staking/tsconfig.json index 92bb839e10..5f0be618eb 100644 --- a/contracts/staking/tsconfig.json +++ b/contracts/staking/tsconfig.json @@ -6,56 +6,11 @@ "generated-artifacts/IStaking.json", "generated-artifacts/IStakingEvents.json", "generated-artifacts/IStakingProxy.json", - "generated-artifacts/IStorage.json", - "generated-artifacts/IStorageInit.json", - "generated-artifacts/IStructs.json", "generated-artifacts/IZrxVault.json", - "generated-artifacts/LibCobbDouglas.json", - "generated-artifacts/LibFixedMath.json", - "generated-artifacts/LibFixedMathRichErrors.json", - "generated-artifacts/LibSafeDowncast.json", "generated-artifacts/LibStakingRichErrors.json", - "generated-artifacts/MixinAbstract.json", - "generated-artifacts/MixinConstants.json", - "generated-artifacts/MixinCumulativeRewards.json", - "generated-artifacts/MixinDeploymentConstants.json", - "generated-artifacts/MixinExchangeFees.json", - "generated-artifacts/MixinExchangeManager.json", - "generated-artifacts/MixinFinalizer.json", - "generated-artifacts/MixinParams.json", - "generated-artifacts/MixinScheduler.json", - "generated-artifacts/MixinStake.json", - "generated-artifacts/MixinStakeBalances.json", - "generated-artifacts/MixinStakeStorage.json", - "generated-artifacts/MixinStakingPool.json", - "generated-artifacts/MixinStakingPoolRewards.json", - "generated-artifacts/MixinStorage.json", "generated-artifacts/Staking.json", "generated-artifacts/StakingProxy.json", - "generated-artifacts/TestAssertStorageParams.json", - "generated-artifacts/TestCobbDouglas.json", - "generated-artifacts/TestCumulativeRewardTracking.json", - "generated-artifacts/TestDelegatorRewards.json", - "generated-artifacts/TestExchangeManager.json", - "generated-artifacts/TestFinalizer.json", - "generated-artifacts/TestInitTarget.json", - "generated-artifacts/TestLibFixedMath.json", - "generated-artifacts/TestLibSafeDowncast.json", - "generated-artifacts/TestMixinCumulativeRewards.json", - "generated-artifacts/TestMixinParams.json", - "generated-artifacts/TestMixinScheduler.json", - "generated-artifacts/TestMixinStake.json", - "generated-artifacts/TestMixinStakeBalances.json", - "generated-artifacts/TestMixinStakeStorage.json", - "generated-artifacts/TestMixinStakingPool.json", - "generated-artifacts/TestMixinStakingPoolRewards.json", - "generated-artifacts/TestProtocolFees.json", - "generated-artifacts/TestProxyDestination.json", "generated-artifacts/TestStaking.json", - "generated-artifacts/TestStakingNoWETH.json", - "generated-artifacts/TestStakingProxy.json", - "generated-artifacts/TestStakingProxyUnit.json", - "generated-artifacts/TestStorageLayoutAndConstants.json", "generated-artifacts/ZrxVault.json", "test/generated-artifacts/IStaking.json", "test/generated-artifacts/IStakingEvents.json", diff --git a/contracts/test-utils/test/mocha_blockchain.ts b/contracts/test-utils/test/mocha_blockchain.ts index 15c4ea43e5..9e84f28524 100644 --- a/contracts/test-utils/test/mocha_blockchain.ts +++ b/contracts/test-utils/test/mocha_blockchain.ts @@ -1,7 +1,9 @@ import * as _ from 'lodash'; import * as process from 'process'; -import { blockchainTests, constants, describe, expect } from '../src'; +import { expect } from '../src/chai_setup'; +import { constants } from '../src/constants'; +import { blockchainTests, describe } from '../src/mocha_blockchain'; blockchainTests('mocha blockchain extensions', env => { describe('blockchainTests()', () => { diff --git a/contracts/test-utils/test/subtests/mocha_blockchain_1.ts b/contracts/test-utils/test/subtests/mocha_blockchain_1.ts index 8c2fb0aae0..1af57b7380 100644 --- a/contracts/test-utils/test/subtests/mocha_blockchain_1.ts +++ b/contracts/test-utils/test/subtests/mocha_blockchain_1.ts @@ -1,4 +1,5 @@ -import { blockchainTests, BlockchainTestsEnvironment, expect } from '../../src'; +import { expect } from '../../src/chai_setup'; +import { blockchainTests, BlockchainTestsEnvironment } from '../../src/mocha_blockchain'; // tslint:disable: no-default-export completed-docs export function append(env: BlockchainTestsEnvironment): void { diff --git a/contracts/test-utils/test/test_with_reference.ts b/contracts/test-utils/test/test_with_reference.ts index 7407bf0c93..45c577e452 100644 --- a/contracts/test-utils/test/test_with_reference.ts +++ b/contracts/test-utils/test/test_with_reference.ts @@ -1,6 +1,7 @@ import { AnyRevertError, StringRevertError } from '@0x/utils'; -import { expect } from '../src'; +import { expect } from '../src/chai_setup'; + import { testWithReferenceFuncAsync } from '../src/test_with_reference'; async function divAsync(x: number, y: number): Promise { diff --git a/contracts/utils/package.json b/contracts/utils/package.json index d64c103771..5f8e564272 100644 --- a/contracts/utils/package.json +++ b/contracts/utils/package.json @@ -36,6 +36,7 @@ "compile:truffle": "truffle compile" }, "config": { + "publicInterfaceContracts": "Authorizable,IAuthorizable,IOwnable,LibAddress,LibAddressArray,LibAddressArrayRichErrors,LibAuthorizableRichErrors,LibBytes,LibBytesRichErrors,LibEIP1271,LibEIP712,LibFractions,LibOwnableRichErrors,LibReentrancyGuardRichErrors,LibRichErrors,LibSafeMath,LibSafeMathRichErrors,Ownable,ReentrancyGuard,Refundable", "abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually.", "abis": "./test/generated-artifacts/@(Authorizable|IAuthorizable|IOwnable|LibAddress|LibAddressArray|LibAddressArrayRichErrors|LibAuthorizableRichErrors|LibBytes|LibBytesRichErrors|LibEIP1271|LibEIP712|LibFractions|LibOwnableRichErrors|LibReentrancyGuardRichErrors|LibRichErrors|LibSafeMath|LibSafeMathRichErrors|Ownable|ReentrancyGuard|Refundable|TestLibAddress|TestLibAddressArray|TestLibBytes|TestLibEIP712|TestLibRichErrors|TestLibSafeMath|TestLogDecoding|TestLogDecodingDownstream|TestOwnable|TestReentrancyGuard|TestRefundable|TestRefundableReceiver).json" }, diff --git a/contracts/utils/src/artifacts.ts b/contracts/utils/src/artifacts.ts index 983f2951ed..9a894a4f0f 100644 --- a/contracts/utils/src/artifacts.ts +++ b/contracts/utils/src/artifacts.ts @@ -25,20 +25,10 @@ import * as LibSafeMathRichErrors from '../generated-artifacts/LibSafeMathRichEr import * as Ownable from '../generated-artifacts/Ownable.json'; import * as ReentrancyGuard from '../generated-artifacts/ReentrancyGuard.json'; import * as Refundable from '../generated-artifacts/Refundable.json'; -import * as TestLibAddress from '../generated-artifacts/TestLibAddress.json'; -import * as TestLibAddressArray from '../generated-artifacts/TestLibAddressArray.json'; -import * as TestLibBytes from '../generated-artifacts/TestLibBytes.json'; -import * as TestLibEIP712 from '../generated-artifacts/TestLibEIP712.json'; -import * as TestLibRichErrors from '../generated-artifacts/TestLibRichErrors.json'; -import * as TestLibSafeMath from '../generated-artifacts/TestLibSafeMath.json'; -import * as TestLogDecoding from '../generated-artifacts/TestLogDecoding.json'; -import * as TestLogDecodingDownstream from '../generated-artifacts/TestLogDecodingDownstream.json'; -import * as TestOwnable from '../generated-artifacts/TestOwnable.json'; -import * as TestReentrancyGuard from '../generated-artifacts/TestReentrancyGuard.json'; -import * as TestRefundable from '../generated-artifacts/TestRefundable.json'; -import * as TestRefundableReceiver from '../generated-artifacts/TestRefundableReceiver.json'; export const artifacts = { Authorizable: Authorizable as ContractArtifact, + IAuthorizable: IAuthorizable as ContractArtifact, + IOwnable: IOwnable as ContractArtifact, LibAddress: LibAddress as ContractArtifact, LibAddressArray: LibAddressArray as ContractArtifact, LibAddressArrayRichErrors: LibAddressArrayRichErrors as ContractArtifact, @@ -56,18 +46,4 @@ export const artifacts = { Ownable: Ownable as ContractArtifact, ReentrancyGuard: ReentrancyGuard as ContractArtifact, Refundable: Refundable as ContractArtifact, - IAuthorizable: IAuthorizable as ContractArtifact, - IOwnable: IOwnable as ContractArtifact, - TestLibAddress: TestLibAddress as ContractArtifact, - TestLibAddressArray: TestLibAddressArray as ContractArtifact, - TestLibBytes: TestLibBytes as ContractArtifact, - TestLibEIP712: TestLibEIP712 as ContractArtifact, - TestLibRichErrors: TestLibRichErrors as ContractArtifact, - TestLibSafeMath: TestLibSafeMath as ContractArtifact, - TestLogDecoding: TestLogDecoding as ContractArtifact, - TestLogDecodingDownstream: TestLogDecodingDownstream as ContractArtifact, - TestOwnable: TestOwnable as ContractArtifact, - TestReentrancyGuard: TestReentrancyGuard as ContractArtifact, - TestRefundable: TestRefundable as ContractArtifact, - TestRefundableReceiver: TestRefundableReceiver as ContractArtifact, }; diff --git a/contracts/utils/src/wrappers.ts b/contracts/utils/src/wrappers.ts index da266a03dd..fe1277f8e8 100644 --- a/contracts/utils/src/wrappers.ts +++ b/contracts/utils/src/wrappers.ts @@ -23,15 +23,3 @@ export * from '../generated-wrappers/lib_safe_math_rich_errors'; export * from '../generated-wrappers/ownable'; export * from '../generated-wrappers/reentrancy_guard'; export * from '../generated-wrappers/refundable'; -export * from '../generated-wrappers/test_lib_address'; -export * from '../generated-wrappers/test_lib_address_array'; -export * from '../generated-wrappers/test_lib_bytes'; -export * from '../generated-wrappers/test_lib_e_i_p712'; -export * from '../generated-wrappers/test_lib_rich_errors'; -export * from '../generated-wrappers/test_lib_safe_math'; -export * from '../generated-wrappers/test_log_decoding'; -export * from '../generated-wrappers/test_log_decoding_downstream'; -export * from '../generated-wrappers/test_ownable'; -export * from '../generated-wrappers/test_reentrancy_guard'; -export * from '../generated-wrappers/test_refundable'; -export * from '../generated-wrappers/test_refundable_receiver'; diff --git a/contracts/utils/test/authorizable.ts b/contracts/utils/test/authorizable.ts index b2a1a46876..5a7df0c885 100644 --- a/contracts/utils/test/authorizable.ts +++ b/contracts/utils/test/authorizable.ts @@ -4,7 +4,8 @@ import { AuthorizableRevertErrors, BigNumber, OwnableRevertErrors } from '@0x/ut import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, AuthorizableContract } from '../src'; +import { artifacts } from './artifacts'; +import { AuthorizableContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/utils/test/lib_address.ts b/contracts/utils/test/lib_address.ts index a538e610c0..32f2742142 100644 --- a/contracts/utils/test/lib_address.ts +++ b/contracts/utils/test/lib_address.ts @@ -2,7 +2,8 @@ import { chaiSetup, provider, txDefaults, web3Wrapper } from '@0x/contracts-test import { BlockchainLifecycle } from '@0x/dev-utils'; import * as chai from 'chai'; -import { artifacts, TestLibAddressContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestLibAddressContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/utils/test/lib_address_array.ts b/contracts/utils/test/lib_address_array.ts index 5f74cc3659..0999ba506a 100644 --- a/contracts/utils/test/lib_address_array.ts +++ b/contracts/utils/test/lib_address_array.ts @@ -4,7 +4,8 @@ import { BigNumber, LibAddressArrayRevertErrors } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, TestLibAddressArrayContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestLibAddressArrayContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/utils/test/lib_bytes.ts b/contracts/utils/test/lib_bytes.ts index 541ea43dff..c0498f4430 100644 --- a/contracts/utils/test/lib_bytes.ts +++ b/contracts/utils/test/lib_bytes.ts @@ -4,7 +4,8 @@ import BN = require('bn.js'); import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; -import { artifacts, TestLibBytesContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestLibBytesContract } from './wrappers'; // BUG: Ideally we would use fromHex(memory).toString('hex') // https://github.com/Microsoft/TypeScript/issues/23155 diff --git a/contracts/utils/test/lib_eip712.ts b/contracts/utils/test/lib_eip712.ts index 34c46eedbb..75c559091c 100644 --- a/contracts/utils/test/lib_eip712.ts +++ b/contracts/utils/test/lib_eip712.ts @@ -5,7 +5,8 @@ import * as chai from 'chai'; import * as ethUtil from 'ethereumjs-util'; import * as _ from 'lodash'; -import { artifacts, TestLibEIP712Contract } from '../src'; +import { artifacts } from './artifacts'; +import { TestLibEIP712Contract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/utils/test/lib_rich_errors.ts b/contracts/utils/test/lib_rich_errors.ts index 3e796ca119..7d5ed539d7 100644 --- a/contracts/utils/test/lib_rich_errors.ts +++ b/contracts/utils/test/lib_rich_errors.ts @@ -1,7 +1,8 @@ import { blockchainTests, expect, hexRandom } from '@0x/contracts-test-utils'; import { coerceThrownErrorAsRevertError, StringRevertError } from '@0x/utils'; -import { artifacts, TestLibRichErrorsContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestLibRichErrorsContract } from './wrappers'; blockchainTests('LibRichErrors', env => { let lib: TestLibRichErrorsContract; diff --git a/contracts/utils/test/lib_safe_math.ts b/contracts/utils/test/lib_safe_math.ts index 39e1ae5d1a..8724479a62 100644 --- a/contracts/utils/test/lib_safe_math.ts +++ b/contracts/utils/test/lib_safe_math.ts @@ -2,9 +2,11 @@ import { blockchainTests, constants, describe, expect } from '@0x/contracts-test import { BigNumber, SafeMathRevertErrors } from '@0x/utils'; import * as _ from 'lodash'; -import { artifacts, TestLibSafeMathContract } from '../src'; import * as ReferenceFunctions from '../src/reference_functions'; +import { artifacts } from './artifacts'; +import { TestLibSafeMathContract } from './wrappers'; + function toBigNumber(a: number | string): BigNumber { return new BigNumber(a); } diff --git a/contracts/utils/test/log_decoding.ts b/contracts/utils/test/log_decoding.ts index 13d9d14971..ebf3e3b533 100644 --- a/contracts/utils/test/log_decoding.ts +++ b/contracts/utils/test/log_decoding.ts @@ -4,7 +4,8 @@ import { BigNumber } from '@0x/utils'; import * as chai from 'chai'; import { DecodedLogArgs, LogWithDecodedArgs } from 'ethereum-types'; -import { artifacts, TestLogDecodingContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestLogDecodingContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/utils/test/ownable.ts b/contracts/utils/test/ownable.ts index d4859f730f..76bc98f55e 100644 --- a/contracts/utils/test/ownable.ts +++ b/contracts/utils/test/ownable.ts @@ -1,7 +1,8 @@ import { blockchainTests, constants, expect, filterLogsToArguments } from '@0x/contracts-test-utils'; import { OwnableRevertErrors } from '@0x/utils'; -import { artifacts, IOwnableEvents, IOwnableOwnershipTransferredEventArgs, TestOwnableContract } from '../src'; +import { artifacts } from './artifacts'; +import { IOwnableEvents, IOwnableOwnershipTransferredEventArgs, TestOwnableContract } from './wrappers'; blockchainTests.resets('Ownable', env => { let ownable: TestOwnableContract; diff --git a/contracts/utils/test/reentrancy_guard.ts b/contracts/utils/test/reentrancy_guard.ts index 9018e6f4c0..6356e27cf0 100644 --- a/contracts/utils/test/reentrancy_guard.ts +++ b/contracts/utils/test/reentrancy_guard.ts @@ -4,7 +4,8 @@ import { ReentrancyGuardRevertErrors } from '@0x/utils'; import * as chai from 'chai'; import * as _ from 'lodash'; -import { artifacts, TestReentrancyGuardContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestReentrancyGuardContract } from './wrappers'; chaiSetup.configure(); const expect = chai.expect; diff --git a/contracts/utils/test/refundable.ts b/contracts/utils/test/refundable.ts index 8411716231..497a1f0f32 100644 --- a/contracts/utils/test/refundable.ts +++ b/contracts/utils/test/refundable.ts @@ -2,7 +2,8 @@ import { blockchainTests, constants } from '@0x/contracts-test-utils'; import { BigNumber } from '@0x/utils'; import * as _ from 'lodash'; -import { artifacts, TestRefundableContract, TestRefundableReceiverContract } from '../src'; +import { artifacts } from './artifacts'; +import { TestRefundableContract, TestRefundableReceiverContract } from './wrappers'; blockchainTests('Refundable', env => { let refundable: TestRefundableContract; diff --git a/contracts/utils/tsconfig.json b/contracts/utils/tsconfig.json index 393c332fdf..5f15b82479 100644 --- a/contracts/utils/tsconfig.json +++ b/contracts/utils/tsconfig.json @@ -23,18 +23,6 @@ "generated-artifacts/Ownable.json", "generated-artifacts/ReentrancyGuard.json", "generated-artifacts/Refundable.json", - "generated-artifacts/TestLibAddress.json", - "generated-artifacts/TestLibAddressArray.json", - "generated-artifacts/TestLibBytes.json", - "generated-artifacts/TestLibEIP712.json", - "generated-artifacts/TestLibRichErrors.json", - "generated-artifacts/TestLibSafeMath.json", - "generated-artifacts/TestLogDecoding.json", - "generated-artifacts/TestLogDecodingDownstream.json", - "generated-artifacts/TestOwnable.json", - "generated-artifacts/TestReentrancyGuard.json", - "generated-artifacts/TestRefundable.json", - "generated-artifacts/TestRefundableReceiver.json", "test/generated-artifacts/Authorizable.json", "test/generated-artifacts/IAuthorizable.json", "test/generated-artifacts/IOwnable.json", diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 01a63721d0..06bdd91c9b 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -42,7 +42,7 @@ "coverage:report:text": "istanbul report text", "coverage:report:html": "istanbul report html && open coverage/index.html", "profiler:report:html": "istanbul report html && open coverage/index.html", - "contracts:gen": "contracts-gen" + "contracts:gen": "contracts-gen generate" }, "config": { "abis": "./test-cli/fixtures/artifacts/@(AbiGenDummy|LibDummy|TestLibDummy).json", diff --git a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts index 151addd23b..456d93e761 100644 --- a/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts +++ b/packages/subproviders/test/unit/mnemonic_wallet_subprovider_test.ts @@ -4,6 +4,7 @@ import { JSONRPCResponsePayload } from 'ethereum-types'; import * as ethUtils from 'ethereumjs-util'; import { GanacheSubprovider, MnemonicWalletSubprovider, Web3ProviderEngine } from '../../src/'; + import { DoneCallback, WalletSubproviderErrors } from '../../src/types'; import { chaiSetup } from '../chai_setup'; import { fixtureData } from '../utils/fixture_data';