Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Init funtion params optional & accept endorsement policy as String for Approval and Commit #67

Closed

Conversation

nithin-pankaj
Copy link
Contributor

This PR contains the changes for the following behavior

  • Init chaincode endpoint to make Requestbody optional to handle SC inits for init functions with no parameters.
  • SC Approve & Commit endpoint will now accept endorsement policy as a String.

@nithin-pankaj nithin-pankaj requested a review from a team as a code owner November 7, 2022 05:12
“Nithin added 2 commits November 7, 2022 10:43
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
Signed-off-by: “Nithin <nithin.pankaj@walmartlabs.com>
@nithin-pankaj nithin-pankaj changed the title Make Init funtion param optional & accept endorsement policy as String for Approval and Commit Make Init funtion params optional & accept endorsement policy as String for Approval and Commit Nov 7, 2022
@@ -252,6 +259,13 @@ private String approveChaincode(Channel channel, ChaincodeOperations chaincodeOp
lifecycleApproveChaincodeDefinitionForMyOrgRequest.setInitRequired(
chaincodeOperationsModel.getInitRequired());

if (StringUtils.isNotBlank(chaincodeOperationsModel.getStringifiedPolicy())) {
String stringifiedPolicy = chaincodeOperationsModel.getStringifiedPolicy();
lifecycleApproveChaincodeDefinitionForMyOrgRequest.setChaincodeEndorsementPolicy(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been tested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants