update eth-provider to support different providers
Ideally eth-provider checks which connection is available and uses the available one. frame => local node => infura But it seems there is still a bug and it raises an error if frame is not available. But at least we can use frame now for testnet/mainnet deployments
This commit is contained in:
parent
38079d07db
commit
c568263fea
@ -35,7 +35,7 @@
|
||||
"@aragon/kits-base": "^1.0.0",
|
||||
"@aragon/os": "^4.1.0",
|
||||
"async-each-series": "^1.1.0",
|
||||
"eth-provider": "^0.2.1",
|
||||
"eth-provider": "^0.2.2",
|
||||
"openzeppelin-solidity": "^2.2.0",
|
||||
"promptly": "^3.0.3",
|
||||
"solc": "^0.4.25"
|
||||
|
@ -21,7 +21,14 @@ const providerForNetwork = (network) => (
|
||||
if (settings) {
|
||||
return new HDWalletProviderPrivkey(settings.keys, settings.rpc)
|
||||
} else {
|
||||
return provider('frame');
|
||||
let preset;
|
||||
if (network === 'mainnet') {
|
||||
preset = 'infura';
|
||||
} else {
|
||||
let [first, ...rest] = network;
|
||||
preset = `infura${first.toUpperCase()}${rest.join('')}`;
|
||||
}
|
||||
return provider('frame', 'local', preset);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user