-
Notifications
You must be signed in to change notification settings - Fork 445
Upgrade Backend of Chaincode Approve #671
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
Upgrade Backend of Chaincode Approve #671
Conversation
Signed-off-by: YoungHypo <[email protected]>
Signed-off-by: YoungHypo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aims to upgrade the chaincode approve workflow by updating the API view, serializer, and underlying peer chaincode library.
- Updated views to compute orderer_url and include an additional init_flag parameter.
- Removed the redundant orderer_url field and added init_flag to the serializer.
- Modified the lifecycle_approve_for_my_org method to adjust argument order and build the subprocess command dynamically.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/api-engine/api/routes/chaincode/views.py | Adjusted the parameter order and removed the need to pass orderer_url from serializer. |
| src/api-engine/api/routes/chaincode/serializers.py | Removed the orderer_url field and added the init_flag field for request validation. |
| src/api-engine/api/lib/peer/chaincode.py | Changed the method signature and argument order in lifecycle_approve_for_my_org, and updated subprocess command construction. |
Comments suppressed due to low confidence (2)
src/api-engine/api/lib/peer/chaincode.py:73
- Using a list as the command with shell=True can lead to unexpected behavior. Consider setting shell=False or converting the command list into a single string.
res = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
src/api-engine/api/lib/peer/chaincode.py:176
- Using a list as the command with shell=True may not work as intended. It is recommended to either use shell=False with the list or join the list into a command string when shell=True is required.
res = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Signed-off-by: YoungHypo <[email protected]>
c908ab3 to
6e8ada1
Compare
Do not merge. There are still bugs, and I try to fix it.