protocol/packages/migrations/test/snapshot_addresses_test.ts
Lawrence Forman a5a68acfec
Add Exchange Proxy to Ganache snapshot (#2612)
* `@0x/contracts-zero-ex`: Expose migration tools.

* `@0x/contract-addresses`: Update ganache snapshot Exchange Proxy addresses

* `@0x/migrations`: Add Exchange Proxy migration
2020-06-25 13:52:01 +10:00

25 lines
933 B
TypeScript

import { ChainId, getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
import { devConstants, web3Factory } from '@0x/dev-utils';
import * as chai from 'chai';
import * as dirtyChai from 'dirty-chai';
import 'mocha';
import { runMigrationsAsync } from '../src/migration';
chai.use(dirtyChai);
const expect = chai.expect;
describe('addresses', () => {
it('should contain the same addresses as contract-addresses', async () => {
const providerConfigs = { shouldUseInProcessGanache: true };
const provider = web3Factory.getRpcProvider(providerConfigs);
const txDefaults = {
from: devConstants.TESTRPC_FIRST_ADDRESS,
};
const migrationAddresses = await runMigrationsAsync(provider, txDefaults);
const expectedAddresses = getContractAddressesForChainOrThrow(ChainId.Ganache);
expect(migrationAddresses).to.deep.eq(expectedAddresses);
});
});