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

MYST-420 / manager.Connect now sets itself into Connecting state #206

Merged
merged 3 commits into from Mar 19, 2018

Conversation

Projects
None yet
4 participants
@ignasbernotas
Copy link
Member

commented Mar 14, 2018

No description provided.

@tadovas

This comment has been minimized.

Copy link
Member

commented Mar 14, 2018

What about a test case -> trying to connect, errors occurs - state reverts to not connected ?

manager.status = statusConnecting()
defer func() {
if err != nil {
manager.status = statusNotConnected()

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 14, 2018

Member

Would be nice this assert this status in tests

This comment has been minimized.

Copy link
@ignasbernotas

ignasbernotas Mar 15, 2018

Author Member

It was already covered, but I cleaned up the tests

This comment has been minimized.

Copy link
@ignasbernotas

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 16, 2018

Member

Anyway missing test about status Connecting

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 19, 2018

Member

Added test case. @Waldz up to you now.

@@ -43,11 +43,18 @@ func NewManager(mysteriumClient server.Client, dialogEstablisherCreator DialogEs
}
}

func (manager *connectionManager) Connect(consumerID, providerID identity.Identity) error {
func (manager *connectionManager) Connect(consumerID, providerID identity.Identity) (err error) {

This comment has been minimized.

Copy link
@donce

donce Mar 15, 2018

Contributor

It seems this method always returns error explicily (i.e. return err). Why do we need this var here?

This comment has been minimized.

Copy link
@ignasbernotas

ignasbernotas Mar 16, 2018

Author Member

Due to the deferred closure, it needs to know whether there was an error

@tadovas
Copy link
Member

left a comment

LGTM

@tadovas tadovas merged commit 13f5432 into master Mar 19, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@tadovas tadovas deleted the feature/MYST-420-connecting-status branch Mar 19, 2018

@tadovas tadovas restored the feature/MYST-420-connecting-status branch May 2, 2018

@tadovas tadovas deleted the feature/MYST-420-connecting-status branch May 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.