Skip to content

Commit

Permalink
Address CCP modification introduced. (hyperledger-archives#3354)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Kelsey <[email protected]>
  • Loading branch information
Dave Kelsey authored Feb 7, 2018
1 parent 626caf2 commit 3ed5816
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class HLFConnectionManager extends ConnectionManager {
await HLFConnectionManager.setupWallet(client, wallet);
} else {
await client.initCredentialStores();
delete ccp.client.credentialStore;
}
}
} catch(err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Wallet = require('composer-common').Wallet;
const fsextra = require('fs-extra');

const chai = require('chai');
chai.should();
const should = chai.should();
chai.use(require('chai-as-promised'));
const sinon = require('sinon');

Expand Down Expand Up @@ -166,12 +166,14 @@ describe('HLFConnectionManager', () => {
sandbox.stub(Client, 'loadFromConfig').withArgs(ccp).returns(mockClient);
sandbox.stub(Wallet, 'getWallet').returns(null);
sandbox.stub(HLFConnectionManager, 'setupWallet').resolves();
sandbox.stub(path, 'join').returns('something');
let client = await HLFConnectionManager.createClient(ccp, true);
client.should.be.an.instanceOf(Client);
should.not.exist(ccp.client.credentialStore);

sinon.assert.calledOnce(Client.loadFromConfig);
sinon.assert.calledWith(Client.loadFromConfig, sinon.match.has('client', sinon.match.has('credentialStore', sinon.match.has('path', sinon.match(/composer\/client-data\/acard/)))));
sinon.assert.calledWith(Client.loadFromConfig, sinon.match.has('client', sinon.match.has('credentialStore', sinon.match.has('cryptoStore', sinon.match.has('path', sinon.match(/composer\/client-data\/acard/))))));
sinon.assert.calledOnce(path.join);
sinon.assert.calledWith(path.join, sinon.match.any, sinon.match.string, sinon.match.string, 'acard');
sinon.assert.notCalled(HLFConnectionManager.setupWallet);
sinon.assert.calledOnce(mockClient.initCredentialStores);
});
Expand Down

0 comments on commit 3ed5816

Please sign in to comment.