Skip to content

Commit

Permalink
Fixed Playground Orderers Import Bug (hyperledger-archives#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeeyturner authored May 17, 2017
1 parent f933e11 commit 305a389
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ describe('AddConnectionProfileComponent', () => {
invokeWaitTime: WAIT_TIME,
keyValStore: KEY_VAL_STORE,
mspID: MSPID,
orderers: ORDERERS,
orderers: [{url: 'orderers', cert: '', hostnameOverride: ''}],
peers: PEERS,
type: 'hlfv1'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,22 @@ export class AddConnectionProfileComponent {
certificatePath: this.addConnectionProfileCertificatePath
};
} else if (this.version === 'v1' || this.addConnectionProfileType === 'hlfv1') {

// If the orderers are a list of strings, we need to convert it to a list of objects.
// Doing this allows the rest of the code to work as usual
let newOrderersList = [];
for (let x = 0; x < this.addConnectionProfileOrderers.length; x++) {
if (typeof this.addConnectionProfileOrderers[x] === 'string') {
newOrderersList.push({url: this.addConnectionProfileOrderers[x], cert: '', hostnameOverride: ''});
} else {
newOrderersList.push(this.addConnectionProfileOrderers[x]);
}
}

connectionProfile = {
description: this.addConnectionProfileDescription,
type: 'hlfv1',
orderers: this.addConnectionProfileOrderers,
orderers: newOrderersList,
ca: this.addConnectionProfileCertificateAuthority,
peers: this.addConnectionProfilePeers,
keyValStore: this.addConnectionProfileKeyValStore,
Expand Down

0 comments on commit 305a389

Please sign in to comment.