Skip to content

Commit 7c3a27d

Browse files
cdaughtrgaborh-da
authored andcommitted
node-SDK: Change hfc getMember description
The description needs to clearly convey that calling getMember with an undefined member will create a new member, since this is not an intuitive design. https://jira.hyperledger.org/browse/FAB-125 Change-Id: Ic10cf8743f65ae030a345effa408d37cfd0c0957 Signed-off-by: Caroline Daughtrey <[email protected]>
1 parent af5f75d commit 7c3a27d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sdk/node/src/hfc.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ export class Chain {
603603
}
604604

605605
/**
606-
* Get the user member named 'name'.
606+
* Get the user member named 'name' or create
607+
* a new member if the member does not exist.
607608
* @param cb Callback of form "function(err,Member)"
608609
*/
609610
getMember(name:string, cb:GetMemberCallback):void {
@@ -627,7 +628,11 @@ export class Chain {
627628
}
628629

629630
// Try to get the member from cache.
630-
// If not found, create a new one, restore the state if found, and then store in cache.
631+
// If not found, create a new one.
632+
// If member is found in the key value store,
633+
// restore the state to the new member, store in cache and return the member.
634+
// If there are no errors and member is not found in the key value store,
635+
// return the new member.
631636
private getMemberHelper(name:string, cb:GetMemberCallback) {
632637
let self = this;
633638
// Try to get the member state from the cache

0 commit comments

Comments
 (0)