Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 305a389

Browse files
authored
Fixed Playground Orderers Import Bug (#1020)
1 parent f933e11 commit 305a389

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/composer-playground/src/app/add-connection-profile/add-connection-profile.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ describe('AddConnectionProfileComponent', () => {
566566
invokeWaitTime: WAIT_TIME,
567567
keyValStore: KEY_VAL_STORE,
568568
mspID: MSPID,
569-
orderers: ORDERERS,
569+
orderers: [{url: 'orderers', cert: '', hostnameOverride: ''}],
570570
peers: PEERS,
571571
type: 'hlfv1'
572572
}

packages/composer-playground/src/app/add-connection-profile/add-connection-profile.component.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,22 @@ export class AddConnectionProfileComponent {
212212
certificatePath: this.addConnectionProfileCertificatePath
213213
};
214214
} else if (this.version === 'v1' || this.addConnectionProfileType === 'hlfv1') {
215+
216+
// If the orderers are a list of strings, we need to convert it to a list of objects.
217+
// Doing this allows the rest of the code to work as usual
218+
let newOrderersList = [];
219+
for (let x = 0; x < this.addConnectionProfileOrderers.length; x++) {
220+
if (typeof this.addConnectionProfileOrderers[x] === 'string') {
221+
newOrderersList.push({url: this.addConnectionProfileOrderers[x], cert: '', hostnameOverride: ''});
222+
} else {
223+
newOrderersList.push(this.addConnectionProfileOrderers[x]);
224+
}
225+
}
226+
215227
connectionProfile = {
216228
description: this.addConnectionProfileDescription,
217229
type: 'hlfv1',
218-
orderers: this.addConnectionProfileOrderers,
230+
orderers: newOrderersList,
219231
ca: this.addConnectionProfileCertificateAuthority,
220232
peers: this.addConnectionProfilePeers,
221233
keyValStore: this.addConnectionProfileKeyValStore,

0 commit comments

Comments
 (0)