This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Merged
Conversation
6 tasks
holisticode
reviewed
Aug 16, 2019
swap/swap.go
Outdated
| return s.sendCheque(peer.ID()) | ||
| swapPeer, ok := s.getPeer(peer.ID()) | ||
| if !ok { | ||
| return fmt.Errorf("error while getting peer: %s", peer) |
Contributor
There was a problem hiding this comment.
This should actually be "no peer found", as we don't print any error in the text
Contributor
Author
There was a problem hiding this comment.
you mean something like return fmt.Errorf("peer %s not found", peer)?
holisticode
reviewed
Aug 16, 2019
swap/swap.go
Outdated
| } | ||
| cheque, err := s.createCheque(peer) | ||
| func (s *Swap) sendCheque(swapPeer *Peer) error { | ||
| peer := swapPeer.Peer.ID() |
Contributor
There was a problem hiding this comment.
You should be able to just call swapPeer.ID() (Peer is embedded)
holisticode
reviewed
Aug 16, 2019
swap/swap.go
Outdated
| if !ok { | ||
| return nil, fmt.Errorf("error while getting peer: %s", peer) | ||
| } | ||
| peer := swapPeer.Peer.ID() |
holisticode
approved these changes
Aug 16, 2019
Contributor
holisticode
left a comment
There was a problem hiding this comment.
Just address the minor things commented and its good to go
…simplify swapPeer.Peer.ID() calls
holisticode
pushed a commit
that referenced
this pull request
Aug 20, 2019
* swap: refactor createCheque and sendCheque functions to receive *Peer variables instead of IDs * swap: rename peerID variables to peer for consistency in swap.go * swap: change error message when failing to get peer in Add function, simplify swapPeer.Peer.ID() calls
holisticode
pushed a commit
that referenced
this pull request
Aug 26, 2019
* swap: refactor createCheque and sendCheque functions to receive *Peer variables instead of IDs * swap: rename peerID variables to peer for consistency in swap.go * swap: change error message when failing to get peer in Add function, simplify swapPeer.Peer.ID() calls
holisticode
pushed a commit
that referenced
this pull request
Aug 27, 2019
* swap: refactor createCheque and sendCheque functions to receive *Peer variables instead of IDs * swap: rename peerID variables to peer for consistency in swap.go * swap: change error message when failing to get peer in Add function, simplify swapPeer.Peer.ID() calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the comments originally posted by @zelig in PR #1554:
and
Also, for
swap.go, I am renaming ID-typed variables calledpeerIDtopeerfor nomenclature consistency.