-
Notifications
You must be signed in to change notification settings - Fork 63
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
Feature/route finder single route #568
Feature/route finder single route #568
Conversation
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.
Good work. However, how can we test this?
pkg/route-finder/client/client.go
Outdated
MaxHops: maxHops, | ||
// FindRoutes returns routes from source skywire visor to destiny, that has at least the given minHops and as much | ||
// the given maxHops. | ||
func (c *apiClient) FindRoutes(ctx context.Context, rts [][2]cipher.PubKey, opts *RouteOptions) ([][]routing.Route, error) { |
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.
Have the following changes:
- Create a new type
type Path []routing.Hop
- Use the following as the output:
map[[2]cipher.PubKey][]routing.Path
We can run integration tests, no matter which one as long as we test that routes are being created. They are working on my tests. Basically run the following:
For unit testing the API however I think it would be better to write them on the server side. |
@nkryuchkov please give this a review and see if we can merge this into your work so far. Thanks! |
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.
Great job!
return nil, err | ||
} | ||
res := bytes.NewBuffer(b1) | ||
res.WriteString(":") // nolint |
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.
Although both WriteString
and Write
of bytes.Buffer
always return nil
as an error, I would explicitly check for an error here and below.
@evanlinjin I've already merged it into my work |
Should we close this PR then? |
@evanlinjin If it's to be merged in my work only, then yes. |
Already merged into #562 |
Closes #567