-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract identities from a version specific wallet and store in the in memory wallet #1055
Extract identities from a version specific wallet and store in the in memory wallet #1055
Conversation
Signed-off-by: RosieMurphy0 <[email protected]>
… memory wallet Signed-off-by: RosieMurphy0 <[email protected]>
… memory wallet Signed-off-by: RosieMurphy0 <[email protected]>
Signed-off-by: RosieMurphy0 <[email protected]>
Signed-off-by: RosieMurphy0 <[email protected]>
@@ -191,7 +191,14 @@ class IdentityManager { | |||
* @private | |||
*/ | |||
async _extractIdentitiesFromWallet(mspId, wallet) { | |||
// TODO: To be implemented | |||
const walletFacade = await this.walletFacadeFactory.create(wallet.path); | |||
const allIDNames = await walletFacade.getAllIdentityNames(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you change allIDNames
to allIdentityNames
as we don't want to use abbreviations
const walletFacade = await this.walletFacadeFactory.create(wallet.path); | ||
const allIDNames = await walletFacade.getAllIdentityNames(); | ||
// eslint-disable-next-line no-console | ||
console.log({allIDNames}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you left some debug code in, could you delete the console.log and the comment above it as well.
const allIDNames = await walletFacade.getAllIdentityNames(); | ||
// eslint-disable-next-line no-console | ||
console.log({allIDNames}); | ||
for (const identityName in allIDNames){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allIDNames
to allIdentityNames
here too, plus change the in
to of
which means you will get the individual identityName as it loops round
console.log({allIDNames}); | ||
for (const identityName in allIDNames){ | ||
const identity = await walletFacade.export(identityName); | ||
await this._addToWallet(identity.mspid, allIDNames[identityName], identity.certificate, identity.privateKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the change to of
in the for loop, you can replace the allIDNames[identityName]
with just identityName
Implemented the _extractIdentitiesFromWallet method in the identity manager and the associated tests for the method. Takes identities from a wallet and stores them in the in memory wallet using an existing method.
contributes to #940