diff --git a/cucumber/helpers/walletAndIdentityHelper.ts b/cucumber/helpers/walletAndIdentityHelper.ts index e834327e16..9e12a1747b 100644 --- a/cucumber/helpers/walletAndIdentityHelper.ts +++ b/cucumber/helpers/walletAndIdentityHelper.ts @@ -91,7 +91,7 @@ export class WalletAndIdentityHelper { if (identityExists) { this.userInputUtilHelper.showWalletsQuickPickStub.withArgs('Choose the wallet containing the identity that you want to delete').resolves({ - label: FabricWalletUtil.LOCAL_WALLET, + label: FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME, data: walletEntry }); this.userInputUtilHelper.showIdentitiesQuickPickStub.withArgs('Choose the identities to delete').resolves([name]); diff --git a/extension/commands/UserInputUtil.ts b/extension/commands/UserInputUtil.ts index 54fb2098ed..0786859d6e 100644 --- a/extension/commands/UserInputUtil.ts +++ b/extension/commands/UserInputUtil.ts @@ -38,6 +38,7 @@ import { FabricEnvironment } from '../fabric/FabricEnvironment'; import { FabricEnvironmentRegistry } from '../registries/FabricEnvironmentRegistry'; import { FabricRuntimeUtil } from '../fabric/FabricRuntimeUtil'; import { FabricChaincode } from '../fabric/FabricChaincode'; +import { FabricWalletUtil } from '../fabric/FabricWalletUtil'; export interface IBlockchainQuickPickItem extends vscode.QuickPickItem { data: T; @@ -870,7 +871,7 @@ export class UserInputUtil { const wallets: Array = await FabricWalletRegistry.instance().getAll(showLocalWallet); for (const walletRegistryEntry of wallets) { walletQuickPickItems.push({ - label: walletRegistryEntry.name, + label: walletRegistryEntry.name !== FabricWalletUtil.LOCAL_WALLET ? walletRegistryEntry.name : FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME, data: walletRegistryEntry }); } diff --git a/extension/commands/deleteIdentityCommand.ts b/extension/commands/deleteIdentityCommand.ts index 98a81bc8bc..086b62715d 100644 --- a/extension/commands/deleteIdentityCommand.ts +++ b/extension/commands/deleteIdentityCommand.ts @@ -48,14 +48,14 @@ export async function deleteIdentity(treeItem: IdentityTreeItem): Promise walletPath = wallet.getWalletPath(); let identityNames: string[] = await wallet.getIdentityNames(); - if (chosenWallet.label === FabricWalletUtil.LOCAL_WALLET) { + if (chosenWallet.label === FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME) { // If the local wallet was selected, we should filter out the admin identity identityNames = identityNames.filter((identity: string) => { return identity !== FabricRuntimeUtil.ADMIN_USER; }); } - if (chosenWallet.label === FabricWalletUtil.LOCAL_WALLET && identityNames.length === 0) { + if (chosenWallet.label === FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME && identityNames.length === 0) { outputAdapter.log(LogType.ERROR, `No identities to delete in wallet: ${chosenWallet.label}. The ${FabricRuntimeUtil.ADMIN_USER} identity cannot be deleted.`, `No identities to delete in wallet: ${chosenWallet.label}. The ${FabricRuntimeUtil.ADMIN_USER} identity cannot be deleted.`); return; } else if (identityNames.length === 0) { diff --git a/test/commands/UserInputUtil.test.ts b/test/commands/UserInputUtil.test.ts index 72c29e33dd..6192eb58db 100644 --- a/test/commands/UserInputUtil.test.ts +++ b/test/commands/UserInputUtil.test.ts @@ -1853,7 +1853,7 @@ describe('UserInputUtil', () => { quickPickStub.resolves(); await UserInputUtil.showWalletsQuickPickBox('Choose a wallet', false, true); quickPickStub.should.have.been.calledWith([ - { label: localWalletEntry.name, data: localWalletEntry }, + { label: FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME, data: localWalletEntry }, { label: walletEntryTwo.name, data: walletEntryTwo }, { label: walletEntryOne.name, data: walletEntryOne }]); }); diff --git a/test/commands/deleteIdentityCommand.test.ts b/test/commands/deleteIdentityCommand.test.ts index 55243eeb43..ffa73e0921 100644 --- a/test/commands/deleteIdentityCommand.test.ts +++ b/test/commands/deleteIdentityCommand.test.ts @@ -189,12 +189,12 @@ describe('deleteIdentityCommand', () => { const runtimeWalletRegistryEntry: FabricWalletRegistryEntry = new FabricWalletRegistryEntry(); - runtimeWalletRegistryEntry.name = FabricWalletUtil.LOCAL_WALLET; + runtimeWalletRegistryEntry.name = FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME; runtimeWalletRegistryEntry.walletPath = 'wallet_path'; runtimeWalletRegistryEntry.managedWallet = true; showWalletsQuickPickStub.resolves({ - label: FabricWalletUtil.LOCAL_WALLET, + label: runtimeWalletRegistryEntry.name, data: runtimeWalletRegistryEntry }); walletIdentitiesStub.resolves([]); @@ -255,7 +255,7 @@ describe('deleteIdentityCommand', () => { runtimeWalletRegistryEntry.managedWallet = true; showWalletsQuickPickStub.resolves({ - label: FabricWalletUtil.LOCAL_WALLET, + label: FabricWalletUtil.LOCAL_WALLET_DISPLAY_NAME, data: runtimeWalletRegistryEntry }); walletIdentitiesStub.resolves([FabricRuntimeUtil.ADMIN_USER, identityName]);