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

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

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 = [

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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;

View File

@@ -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;

View File

@@ -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';

View File

@@ -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[];