Skip to content

Commit f034087

Browse files
Fix fabric-network dependency to 1.4.7 (#4)
1.4.6 version of fabric-ca-client was bad. Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
1 parent aeabc9f commit f034087

File tree

3 files changed

+433
-369
lines changed

3 files changed

+433
-369
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ used with the Hyperledger Fabric version 2.0 SDK for Node.
77
import { WalletStores } from "fabric-wallet-migration";
88
import { Wallet, Wallets } from "fabric-network";
99

10-
const walletStore = WalletStores.newFileSystemWalletStore(oldWalletDirectory);
11-
const oldWallet = new Wallet(walletStore);
10+
async function migrateWallet(oldWalletDirectory: string, newWalletDirectory: string) {
11+
const walletStore = WalletStores.newFileSystemWalletStore(oldWalletDirectory);
12+
const oldWallet = new Wallet(walletStore);
1213

13-
const newWallet = await Wallets.newFileSystemWallet(newWalletDirectory);
14+
const newWallet = await Wallets.newFileSystemWallet(newWalletDirectory);
1415

15-
const identityLabels = await oldWallet.list();
16-
for (const label of identityLabels) {
17-
const identity = await oldWallet.get(label);
18-
await newWallet.put(label, identity);
16+
const identityLabels = await oldWallet.list();
17+
for (const label of identityLabels) {
18+
const identity = await oldWallet.get(label);
19+
if (identity) {
20+
await newWallet.put(label, identity);
21+
}
22+
}
1923
}
2024
```

0 commit comments

Comments
 (0)