Skip to content

Commit 4f9318f

Browse files
committed
Document KeyEndorsementPolicy class for SBE #307
Signed-off-by: Sourav <souravkjha2007@gmail.com>
1 parent c560719 commit 4f9318f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

docs/_jsdoc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"../libraries/fabric-shim/lib/chaincode.js",
66
"../libraries/fabric-shim/lib/stub.js",
77
"../libraries/fabric-shim/lib/iterators.js",
8+
"../libraries/fabric-shim/lib/utils/statebased.js",
89
"../apis/fabric-contract-api/lib"
910
]
1011
},

libraries/fabric-shim/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
# SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
module.exports = require('./lib/chaincode.js');
7+
const shim = require('./lib/chaincode.js');
8+
module.exports = shim;
9+
module.exports.KeyEndorsementPolicy = shim.KeyEndorsementPolicy;

libraries/fabric-shim/lib/utils/statebased.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const ROLE_TYPE_PEER = 'PEER';
1717
* of the MSP identifiers of organizations.
1818
* For more informations, please read the [documents]{@link https://hyperledger-fabric.readthedocs.io/en/latest/endorsement-policies.html#setting-key-level-endorsement-policies}
1919
*
20-
* @class
20+
* @class KeyEndorsementPolicy
21+
* @memberof fabric-shim
2122
*/
2223
class KeyEndorsementPolicy {
2324
/**
@@ -35,7 +36,7 @@ class KeyEndorsementPolicy {
3536

3637
/**
3738
* returns the endorsement policy as bytes
38-
* @returns {Buffer} the endorsement policy
39+
* @returns {Uint8Array} the serialized signature policy envelope
3940
*/
4041
getPolicy() {
4142
const spe = this._getPolicyFromMspId();
@@ -45,7 +46,7 @@ class KeyEndorsementPolicy {
4546
/**
4647
* adds the specified orgs to the list of orgs that are required
4748
* to endorse
48-
* @param {string} role the role of the new org(s). i.e., MEMBER or PEER
49+
* @param {string} role the role of the new org(s). i.e., 'MEMBER' or 'PEER'
4950
* @param {...string} neworgs the new org(s) to be added to the endorsement policy
5051
*/
5152
addOrgs(role, ...neworgs) {

0 commit comments

Comments
 (0)