Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Fix web3-subprovider to return subprovider (no longer async)
Browse files Browse the repository at this point in the history
  • Loading branch information
gre committed Feb 16, 2018
1 parent b53fa01 commit 83d8423
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/create-dapp/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"react-scripts": "1.1.0",
"truffle-contract": "^3.0.3",
"prop-types": "^15.2.0",
"@ledgerhq/web3-subprovider": "^4.0.0",
"@ledgerhq/web3-subprovider": "^4.1.0",
"@ledgerhq/hw-transport-u2f": "^4.0.0",
"web3": "^1.0.0-beta.29"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/create-dapp/template/src/wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export default [
{
name: "Ledger device",
// create a web3 with the ledger device
getWeb3: async () => {
getWeb3: () => {
const engine = new ProviderEngine();
const getTransport = () => TransportU2F.create();
const ledger = await createLedgerSubprovider(getTransport, {
const ledger = createLedgerSubprovider(getTransport, {
networkId,
accountsLength: 5
});
Expand Down
3 changes: 2 additions & 1 deletion packages/web3-subprovider/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ engine.addProvider(new RpcSubprovider({ rpcUrl }));
engine.start();
const web3 = new Web3(engine);
*/
export default async function createLedgerSubprovider(
export default function createLedgerSubprovider(
getTransport: () => Transport<*>,
options?: SubproviderOptions
): HookedWalletSubprovider {
Expand Down Expand Up @@ -191,5 +191,6 @@ export default async function createLedgerSubprovider(
.catch(err => callback(err, null));
}
});

return subprovider;
}

0 comments on commit 83d8423

Please sign in to comment.