Fix migrations
This commit is contained in:
@@ -7,8 +7,9 @@ lib
|
||||
/packages/fill-scenarios/src/generated_contract_wrappers/
|
||||
/packages/order-watcher/src/generated_contract_wrappers/
|
||||
/packages/order-utils/src/generated_contract_wrappers/
|
||||
/packages/migrations/src/v1/contract_wrappers
|
||||
/packages/migrations/src/v2/contract_wrappers
|
||||
/packages/migrations/src/1.0.0/contract_wrappers
|
||||
/packages/migrations/src/2.0.0/contract_wrappers
|
||||
/packages/migrations/src/2.0.0-beta-testnet/contract_wrappers
|
||||
/packages/0x.js/test/artifacts
|
||||
/packages/contracts/src/artifacts
|
||||
/packages/metacoin/artifacts
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,6 +9,7 @@ import { runV1MigrationsAsync } from './1.0.0/migration';
|
||||
import { runV2TestnetMigrationsAsync } from './2.0.0-beta-testnet/migration';
|
||||
import { runV2MigrationsAsync } from './2.0.0/migration';
|
||||
|
||||
import { constants } from './utils/constants';
|
||||
import { providerFactory } from './utils/provider_factory';
|
||||
|
||||
enum ContractVersions {
|
||||
@@ -39,6 +40,7 @@ const args = yargs.argv;
|
||||
const accounts = await web3Wrapper.getAvailableAddressesAsync();
|
||||
const testnetTxDefaults = {
|
||||
from: accounts[0],
|
||||
gas: devConstants.GAS_LIMIT,
|
||||
};
|
||||
await runV2TestnetMigrationsAsync(ledgerProvider, artifactsDir, testnetTxDefaults);
|
||||
break;
|
||||
|
||||
@@ -12,4 +12,5 @@ export const constants = {
|
||||
ERC721_PROXY_ID: '0x08e937fa',
|
||||
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
|
||||
RPC_URL: 'http://localhost:8545',
|
||||
KOVAN_NETWORK_ID: 42,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { LedgerSubprovider } from '@0xproject/subproviders';
|
||||
import { Web3Wrapper } from '@0xproject/web3-wrapper';
|
||||
import Eth from '@ledgerhq/hw-app-eth';
|
||||
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
|
||||
import { Provider } from 'ethereum-types';
|
||||
@@ -18,19 +17,17 @@ async function ledgerEthereumNodeJsClientFactoryAsync(): Promise<LedgerEthereumC
|
||||
export const providerFactory = {
|
||||
async getLedgerProviderAsync(): Promise<Provider> {
|
||||
const provider = new ProviderEngine();
|
||||
const ledgerWalletConfigs = {
|
||||
networkId: constants.KOVAN_NETWORK_ID,
|
||||
ledgerEthereumClientFactoryAsync: ledgerEthereumNodeJsClientFactoryAsync,
|
||||
};
|
||||
const ledgerSubprovider = new LedgerSubprovider(ledgerWalletConfigs);
|
||||
provider.addProvider(ledgerSubprovider);
|
||||
provider.addProvider(
|
||||
new RpcSubprovider({
|
||||
rpcUrl: constants.RPC_URL,
|
||||
}),
|
||||
);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const networkId = await web3Wrapper.getNetworkIdAsync();
|
||||
const ledgerWalletConfigs = {
|
||||
networkId,
|
||||
ledgerEthereumClientFactoryAsync: ledgerEthereumNodeJsClientFactoryAsync,
|
||||
};
|
||||
const ledgerSubprovider = new LedgerSubprovider(ledgerWalletConfigs);
|
||||
provider.addProvider(ledgerSubprovider);
|
||||
provider.start();
|
||||
return provider;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user