From 2698de38161c87ac8f6e9f15ae563e862f19424f Mon Sep 17 00:00:00 2001
From: josh <josh@elixxir.io>
Date: Thu, 6 Aug 2020 10:55:58 -0700
Subject: [PATCH] Fix tests in bindings

---
 api/client.go           |  2 +-
 api/register.go         |  4 ++--
 bindings/client_test.go |  5 +++++
 globals/version_vars.go | 17 +++++++++--------
 go.mod                  |  8 ++++----
 go.sum                  | 12 ++++++++----
 user/session.go         |  1 -
 version_vars.go.bak     | 17 +++++++++--------
 8 files changed, 38 insertions(+), 28 deletions(-)

diff --git a/api/client.go b/api/client.go
index 67ca651f5..34fc45bfe 100644
--- a/api/client.go
+++ b/api/client.go
@@ -170,7 +170,7 @@ func (cl *Client) Login(password string) (*id.ID, error) {
 	cl.sessionV2 = io.SessionV2
 
 	regState, err := io.SessionV2.GetRegState()
-	if err != nil && os.IsNotExist(err)  {
+	if err != nil && os.IsNotExist(err) {
 		return nil, errors.Wrap(err, "Login: Could not login: Could not get regState")
 	}
 
diff --git a/api/register.go b/api/register.go
index bce3172f0..7dd5c28a7 100644
--- a/api/register.go
+++ b/api/register.go
@@ -19,9 +19,9 @@ import (
 	"gitlab.com/elixxir/crypto/registration"
 	"gitlab.com/elixxir/crypto/signature/rsa"
 	"gitlab.com/elixxir/crypto/tls"
-	"os"
 	"gitlab.com/xx_network/primitives/id"
 	"gitlab.com/xx_network/primitives/ndf"
+	"os"
 	"sync"
 	"time"
 )
@@ -181,7 +181,7 @@ func (cl *Client) RegisterWithNodes() error {
 	usr := session.GetCurrentUser()
 	//Load the registration signature
 	regSignature, err := io.SessionV2.GetRegValidationSig()
-	if err != nil && !os.IsNotExist(err){
+	if err != nil && !os.IsNotExist(err) {
 		return errors.Errorf("Failed to get registration signature: %v", err)
 	}
 
diff --git a/bindings/client_test.go b/bindings/client_test.go
index ca6602d76..a0fbf4ba7 100644
--- a/bindings/client_test.go
+++ b/bindings/client_test.go
@@ -349,6 +349,8 @@ func TestClient_Send(t *testing.T) {
 		t.Errorf("Could not generate Keys: %+v", err)
 	}
 
+	io.SessionV2.SetRegState(user.KeyGenComplete)
+
 	// Register with a valid registration code
 	userID, err := testClient.RegisterWithPermissioning(true, ValidRegCode)
 
@@ -430,6 +432,7 @@ func TestLoginLogout(t *testing.T) {
 		t.Errorf("Could not generate Keys: %+v", err)
 	}
 
+	io.SessionV2.SetRegState(user.KeyGenComplete)
 	regRes, err := client.RegisterWithPermissioning(true, ValidRegCode)
 	loginRes, err2 := client.Login(regRes, "password")
 	if err2 != nil {
@@ -478,6 +481,7 @@ func TestListen(t *testing.T) {
 		t.Errorf("Could not generate Keys: %+v", err)
 	}
 
+	io.SessionV2.SetRegState(user.KeyGenComplete)
 	regRes, _ := client.RegisterWithPermissioning(true, ValidRegCode)
 	_, err = client.Login(regRes, "password")
 
@@ -525,6 +529,7 @@ func TestStopListening(t *testing.T) {
 		t.Errorf("Could not generate Keys: %+v", err)
 	}
 
+	io.SessionV2.SetRegState(user.KeyGenComplete)
 	regRes, _ := client.RegisterWithPermissioning(true, ValidRegCode)
 
 	_, err = client.Login(regRes, "password")
diff --git a/globals/version_vars.go b/globals/version_vars.go
index e95dd6b1a..e20266b2b 100644
--- a/globals/version_vars.go
+++ b/globals/version_vars.go
@@ -1,9 +1,9 @@
 // Code generated by go generate; DO NOT EDIT.
 // This file was generated by robots at
-// 2020-08-04 16:00:18.998691 -0700 PDT m=+0.035383254
+// 2020-08-06 10:52:35.96635741 -0700 PDT m=+0.008615574
 package globals
 
-const GITVERSION = `8a10037 rerun go mod`
+const GITVERSION = `d97700f Merge branch 'XX-2418/ClientStorage-Registration' of gitlab.com:elixxir/client into XX-2418/ClientStorage-Registration`
 const SEMVER = "1.4.0"
 const DEPENDENCIES = `module gitlab.com/elixxir/client
 
@@ -22,13 +22,14 @@ require (
 	github.com/spf13/jwalterweatherman v1.1.0
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.6.2
-	gitlab.com/elixxir/comms v0.0.0-20200804225939-84dbe3cccc62
-	gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4
-	gitlab.com/elixxir/ekv v0.0.0-20200729182028-159355ea5842
-	gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40
-	gitlab.com/xx_network/comms v0.0.0-20200804225654-09a9af23d699
+	gitlab.com/elixxir/comms v0.0.0-20200805174832-240bba97beaa
+	gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d
+	gitlab.com/elixxir/ekv v0.1.1
+	gitlab.com/elixxir/primitives v0.0.0-20200805174810-86b366d1dd2d
+	gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023
 	gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da
-	golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
+	golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
+	golang.org/x/sys v0.0.0-20200806125547-5acd03effb82 // indirect
 	gopkg.in/ini.v1 v1.52.0 // indirect
 )
 
diff --git a/go.mod b/go.mod
index 8deb186d1..dd4027a24 100644
--- a/go.mod
+++ b/go.mod
@@ -15,11 +15,11 @@ require (
 	github.com/spf13/jwalterweatherman v1.1.0
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.6.2
-	gitlab.com/elixxir/comms v0.0.0-20200804225939-84dbe3cccc62
-	gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4
+	gitlab.com/elixxir/comms v0.0.0-20200805174832-240bba97beaa
+	gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d
 	gitlab.com/elixxir/ekv v0.1.1
-	gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40
-	gitlab.com/xx_network/comms v0.0.0-20200804225654-09a9af23d699
+	gitlab.com/elixxir/primitives v0.0.0-20200805174810-86b366d1dd2d
+	gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023
 	gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da
 	golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
 	golang.org/x/sys v0.0.0-20200806125547-5acd03effb82 // indirect
diff --git a/go.sum b/go.sum
index 3c3ceaecf..6daefd75f 100644
--- a/go.sum
+++ b/go.sum
@@ -161,12 +161,12 @@ github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6/go.mod h1:yssERNPivll
 github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
 github.com/zeebo/blake3 v0.0.4/go.mod h1:YOZo8A49yNqM0X/Y+JmDUZshJWLt1laHsNSn5ny2i34=
 github.com/zeebo/pcg v0.0.0-20181207190024-3cdc6b625a05/go.mod h1:Gr+78ptB0MwXxm//LBaEvBiaXY7hXJ6KGe2V32X2F6E=
-gitlab.com/elixxir/comms v0.0.0-20200804225939-84dbe3cccc62 h1:Xpz8ToqH2fMfZRhWZ+qLRpE2LQD3ct14ciF1S4Ma5Uk=
-gitlab.com/elixxir/comms v0.0.0-20200804225939-84dbe3cccc62/go.mod h1:Wc6fZyP/M4sBjnzb9pRScLeqwMOCv6DRXoTOd07bO3g=
+gitlab.com/elixxir/comms v0.0.0-20200805174832-240bba97beaa h1:yn5FW/zPPKb0DYbN1HvhudYkCrXhpBK4CrZGeUKCGu4=
+gitlab.com/elixxir/comms v0.0.0-20200805174832-240bba97beaa/go.mod h1:Wc6fZyP/M4sBjnzb9pRScLeqwMOCv6DRXoTOd07bO3g=
 gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4 h1:28ftZDeYEko7xptCZzeFWS1Iam95dj46TWFVVlKmw6A=
 gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c=
-gitlab.com/elixxir/ekv v0.0.0-20200729182028-159355ea5842 h1:m1zDQ6UadpuMnV7nvnyR+DUXE3AisRnVjajTb1xZE4c=
-gitlab.com/elixxir/ekv v0.0.0-20200729182028-159355ea5842/go.mod h1:bXY0kgbV5BHYda4YY5/hiG5bjimGK+R3PYub5yM9C/s=
+gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d h1:3+o6r8a0o9/HIpBzlGCCiwuPN8OdEX3cHzdnCNqKDAw=
+gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d/go.mod h1:cu6uNoANVLV0J6HyTL6KqVtVyh9SHU1RjJhytYlsbVQ=
 gitlab.com/elixxir/ekv v0.1.1 h1:Em3rF8sv+tNbQGXbcpYzAS2blWRAP708JGhYlkN74Kg=
 gitlab.com/elixxir/ekv v0.1.1/go.mod h1:bXY0kgbV5BHYda4YY5/hiG5bjimGK+R3PYub5yM9C/s=
 gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d h1:OKWTmYN5q8XVHo8JXThIH0TCuvl/fLXR7MGVacpqfRg=
@@ -175,9 +175,13 @@ gitlab.com/elixxir/primitives v0.0.0-20200804170709-a1896d262cd9 h1:o0P00afLOlI3
 gitlab.com/elixxir/primitives v0.0.0-20200804170709-a1896d262cd9/go.mod h1:p0VelQda72OzoUckr1O+vPW0AiFe0nyKQ6gYcmFSuF8=
 gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40 h1:S1cyRivF4MywQX10K8cGXux6Pbwy5dbWhsxs56G+8hs=
 gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc=
+gitlab.com/elixxir/primitives v0.0.0-20200804231232-ad79a9e8f113/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc=
 gitlab.com/elixxir/primitives v0.0.0-20200805174810-86b366d1dd2d h1:ky5oz0D2EmOzk2n/A6Ugwj7S1B6rftxMJwc19sjGkz8=
+gitlab.com/elixxir/primitives v0.0.0-20200805174810-86b366d1dd2d/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc=
 gitlab.com/xx_network/comms v0.0.0-20200804225654-09a9af23d699 h1:e9rzUjMxt/4iQ5AVXVgwANvbgxxXgWEbvApgd6P72jU=
 gitlab.com/xx_network/comms v0.0.0-20200804225654-09a9af23d699/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw=
+gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023 h1:fQPaxyuXyH3vl8qFlFDBEx8rlEzBnXBNy74K8ItFRM4=
+gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw=
 gitlab.com/xx_network/primitives v0.0.0-20200803231956-9b192c57ea7c/go.mod h1:wtdCMr7DPePz9qwctNoAUzZtbOSHSedcK++3Df3psjA=
 gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da h1:CCVslUwNC7Ul7NG5nu3ThGTSVUt1TxNRX+47f5TUwnk=
 gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da/go.mod h1:OK9xevzWCaPO7b1wiluVJGk7R5ZsuC7pHY5hteZFQug=
diff --git a/user/session.go b/user/session.go
index e78af4898..948208bf3 100644
--- a/user/session.go
+++ b/user/session.go
@@ -494,7 +494,6 @@ func (s *SessionObj) SetRegState(rs uint32) error {
 
 func (s *SessionObj) ChangeUsername(username string) error {
 
-
 	s.CurrentUser.Username = username
 	return nil
 }
diff --git a/version_vars.go.bak b/version_vars.go.bak
index 2edb6b985..5167c98b9 100644
--- a/version_vars.go.bak
+++ b/version_vars.go.bak
@@ -1,9 +1,9 @@
 // Code generated by go generate; DO NOT EDIT.
 // This file was generated by robots at
-// 2020-08-04 16:00:18.998691 -0700 PDT m=+0.035383254
+// 2020-08-06 10:52:35.96635741 -0700 PDT m=+0.008615574
 package cmd
 
-const GITVERSION = `8a10037 rerun go mod`
+const GITVERSION = `d97700f Merge branch 'XX-2418/ClientStorage-Registration' of gitlab.com:elixxir/client into XX-2418/ClientStorage-Registration`
 const SEMVER = "1.4.0"
 const DEPENDENCIES = `module gitlab.com/elixxir/client
 
@@ -22,13 +22,14 @@ require (
 	github.com/spf13/jwalterweatherman v1.1.0
 	github.com/spf13/pflag v1.0.5 // indirect
 	github.com/spf13/viper v1.6.2
-	gitlab.com/elixxir/comms v0.0.0-20200804225939-84dbe3cccc62
-	gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4
-	gitlab.com/elixxir/ekv v0.0.0-20200729182028-159355ea5842
-	gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40
-	gitlab.com/xx_network/comms v0.0.0-20200804225654-09a9af23d699
+	gitlab.com/elixxir/comms v0.0.0-20200805174832-240bba97beaa
+	gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d
+	gitlab.com/elixxir/ekv v0.1.1
+	gitlab.com/elixxir/primitives v0.0.0-20200805174810-86b366d1dd2d
+	gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023
 	gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da
-	golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899
+	golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
+	golang.org/x/sys v0.0.0-20200806125547-5acd03effb82 // indirect
 	gopkg.in/ini.v1 v1.52.0 // indirect
 )
 
-- 
GitLab