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

Introduce capability to get anchor peer nodes in a channel #133

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

nidhi-singh02
Copy link
Contributor

No description provided.

@nidhi-singh02 nidhi-singh02 requested a review from a team as a code owner February 12, 2024 10:09
@nidhi-singh02 nidhi-singh02 force-pushed the showAnchor branch 2 times, most recently from fa6fff6 to 4f0716b Compare February 12, 2024 10:15
Signed-off-by: n0s09by <Nidhi.singh0@walmart.com>
Copy link
Contributor

@nithin-pankaj nithin-pankaj left a comment

Choose a reason for hiding this comment

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

Looks good, addressing the open nitpick comments would improve the readability.

@Override
public ResponseEntity<ClientResponseModel> getAnchorPeerForChannel(String channelName) {
Network network = gateway.getNetwork(channelName);
Set<String> anchorPeersSet = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

[nitpick] declare just before where this Set will get used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting it here as it is getting used outside the try-catch blocks as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can return it directly from line # 107 instead of performing an assignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed, Thanks :)

Signed-off-by: n0s09by <Nidhi.singh0@walmart.com>
@nidhi-singh02 nidhi-singh02 force-pushed the showAnchor branch 4 times, most recently from ae8f289 to 82a0239 Compare February 20, 2024 06:56
@Override
public ResponseEntity<ClientResponseModel> getAnchorPeerForChannel(String channelName) {
Network network = gateway.getNetwork(channelName);
Set<String> anchorPeersSet = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

you can return it directly from line # 107 instead of performing an assignment.

Signed-off-by: n0s09by <Nidhi.singh0@walmart.com>
@nidhi-singh02 nidhi-singh02 merged commit eea75e0 into hyperledger-labs:main Feb 20, 2024
4 checks passed
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.

3 participants