From 3a7bb97ad1182eb9c718797bda8dca5eb5d7f9cd Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 3 Oct 2018 16:21:17 -0700 Subject: Remove artifacts from migrations package and update contract-wrappers accordingly --- packages/contract-wrappers/test/subscription_test.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'packages/contract-wrappers/test/subscription_test.ts') diff --git a/packages/contract-wrappers/test/subscription_test.ts b/packages/contract-wrappers/test/subscription_test.ts index 6ec7519fe..b728fc50e 100644 --- a/packages/contract-wrappers/test/subscription_test.ts +++ b/packages/contract-wrappers/test/subscription_test.ts @@ -1,11 +1,17 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; +import { getContractAddresses } from '@0xproject/migrations'; import { DoneCallback } from '@0xproject/types'; import * as _ from 'lodash'; import 'mocha'; import * as Sinon from 'sinon'; -import { ContractWrappers, ERC20TokenApprovalEventArgs, ERC20TokenEvents } from '../src'; -import { DecodedLogEvent } from '../src/types'; +import { + ContractWrappers, + ContractWrappersConfig, + DecodedLogEvent, + ERC20TokenApprovalEventArgs, + ERC20TokenEvents, +} from '../src'; import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; @@ -17,10 +23,13 @@ const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); describe('SubscriptionTest', () => { let contractWrappers: ContractWrappers; - const config = { - networkId: constants.TESTRPC_NETWORK_ID, - }; + let config: ContractWrappersConfig; + before(async () => { + config = { + networkId: constants.TESTRPC_NETWORK_ID, + contractAddresses: getContractAddresses(), + }; contractWrappers = new ContractWrappers(provider, config); }); beforeEach(async () => { -- cgit v1.2.3 From a48e0a08bf4ea8a8fb0f08cfe5187a6291378afb Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Tue, 9 Oct 2018 13:52:40 -0700 Subject: Add new runMigrationsOnce method to migrations. Update contract-wrappers to use it. --- packages/contract-wrappers/test/subscription_test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/contract-wrappers/test/subscription_test.ts') diff --git a/packages/contract-wrappers/test/subscription_test.ts b/packages/contract-wrappers/test/subscription_test.ts index b728fc50e..40921bce8 100644 --- a/packages/contract-wrappers/test/subscription_test.ts +++ b/packages/contract-wrappers/test/subscription_test.ts @@ -1,5 +1,4 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; -import { getContractAddresses } from '@0xproject/migrations'; import { DoneCallback } from '@0xproject/types'; import * as _ from 'lodash'; import 'mocha'; @@ -15,6 +14,7 @@ import { import { chaiSetup } from './utils/chai_setup'; import { constants } from './utils/constants'; +import { migrateOnceAsync } from './utils/migrate'; import { tokenUtils } from './utils/token_utils'; import { provider, web3Wrapper } from './utils/web3_wrapper'; @@ -26,9 +26,10 @@ describe('SubscriptionTest', () => { let config: ContractWrappersConfig; before(async () => { + const contractAddresses = await migrateOnceAsync(); config = { networkId: constants.TESTRPC_NETWORK_ID, - contractAddresses: getContractAddresses(), + contractAddresses, }; contractWrappers = new ContractWrappers(provider, config); }); -- cgit v1.2.3