From ed18541e447b4dcaa36393118561242e450c9ae4 Mon Sep 17 00:00:00 2001
From: josh <josh@elixxir.io>
Date: Wed, 14 Apr 2021 13:29:06 -0700
Subject: [PATCH] Fix tests for comms and xxcomms refactor

---
 api/client.go                        | 12 ++++++------
 api/results_test.go                  |  8 ++++----
 api/utils_test.go                    |  5 +++--
 bindings/callback.go                 |  7 +++----
 go.mod                               |  4 ++--
 go.sum                               |  6 ++++++
 interfaces/params/network.go         | 14 +++++++-------
 interfaces/params/rounds.go          |  6 +++---
 keyExchange/confirm_test.go          | 10 ++++++++--
 keyExchange/exchange.go              |  4 ++--
 keyExchange/trigger_test.go          | 13 +++++++++----
 keyExchange/utils_test.go            |  9 ++++++---
 network/checkedRounds.go             | 29 ++++++++++++++--------------
 network/ephemeral/tracker_test.go    |  4 ++--
 network/follow.go                    | 23 +++++++++++-----------
 network/node/register.go             |  2 +-
 network/rounds/check.go              | 10 +++++-----
 network/rounds/historical.go         | 18 ++++++++---------
 network/rounds/manager.go            |  2 +-
 network/rounds/utils_test.go         |  1 +
 permissioning/permissioning_test.go  |  4 +++-
 stoppable/cleanup.go                 |  2 +-
 storage/cmix/store_test.go           |  1 -
 storage/e2e/relationship.go          |  4 ++--
 storage/e2e/relationship_test.go     |  2 +-
 storage/e2e/session.go               |  6 +++---
 storage/e2e/session_test.go          |  6 +++---
 storage/e2e/store.go                 |  4 ++--
 storage/rounds/unknownRounds_test.go |  6 +++---
 29 files changed, 121 insertions(+), 101 deletions(-)

diff --git a/api/client.go b/api/client.go
index e70241ec7..eb1206022 100644
--- a/api/client.go
+++ b/api/client.go
@@ -210,7 +210,7 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie
 	}
 
 	u := c.storage.GetUser()
-	jww.INFO.Printf("Client Logged in: \n\tTransmisstionID: %s " +
+	jww.INFO.Printf("Client Logged in: \n\tTransmisstionID: %s "+
 		"\n\tReceptionID: %s", u.TransmissionID, u.ReceptionID)
 
 	//Attach the services interface
@@ -392,7 +392,7 @@ func (c *Client) initPermissioning(def *ndf.NetworkDefinition) error {
 //      Handles both auth confirm and requests
 func (c *Client) StartNetworkFollower() (<-chan interfaces.ClientError, error) {
 	u := c.GetUser()
-	jww.INFO.Printf("StartNetworkFollower() \n\tTransmisstionID: %s " +
+	jww.INFO.Printf("StartNetworkFollower() \n\tTransmisstionID: %s "+
 		"\n\tReceptionID: %s", u.TransmissionID, u.ReceptionID)
 
 	c.clientErrorChannel = make(chan interfaces.ClientError, 1000)
@@ -537,13 +537,13 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) {
 	cmixStore := c.storage.Cmix()
 
 	var numRegistered int
-	for i, n := range nodes{
+	for i, n := range nodes {
 		nid, err := id.Unmarshal(n.ID)
-		if err!=nil{
-			return 0,0, errors.Errorf("Failed to unmarshal node ID %v " +
+		if err != nil {
+			return 0, 0, errors.Errorf("Failed to unmarshal node ID %v "+
 				"(#%d): %s", n.ID, i, err.Error())
 		}
-		if cmixStore.Has(nid){
+		if cmixStore.Has(nid) {
 			numRegistered++
 		}
 	}
diff --git a/api/results_test.go b/api/results_test.go
index 54433f2e9..68e21e9ac 100644
--- a/api/results_test.go
+++ b/api/results_test.go
@@ -40,7 +40,7 @@ func TestClient_GetRoundResults(t *testing.T) {
 	// Create a new copy of the test client for this test
 	client, err := newTestingClient(t)
 	if err != nil {
-		t.Errorf("Failed in setup: %v", err)
+		t.Fatalf("Failed in setup: %v", err)
 	}
 
 	// Construct the round call back function signature
@@ -103,7 +103,7 @@ func TestClient_GetRoundResults_FailedRounds(t *testing.T) {
 	// Create a new copy of the test client for this test
 	client, err := newTestingClient(t)
 	if err != nil {
-		t.Errorf("Failed in setup: %v", err)
+		t.Fatalf("Failed in setup: %v", err)
 	}
 
 	// Construct the round call back function signature
@@ -161,7 +161,7 @@ func TestClient_GetRoundResults_HistoricalRounds(t *testing.T) {
 	// Create a new copy of the test client for this test
 	client, err := newTestingClient(t)
 	if err != nil {
-		t.Errorf("Failed in setup: %v", err)
+		t.Fatalf("Failed in setup: %v", err)
 	}
 
 	// Overpopulate the round buffer, ensuring a circle back of the ring buffer
@@ -219,7 +219,7 @@ func TestClient_GetRoundResults_Timeout(t *testing.T) {
 	// Create a new copy of the test client for this test
 	client, err := newTestingClient(t)
 	if err != nil {
-		t.Errorf("Failed in setup: %v", err)
+		t.Fatalf("Failed in setup: %v", err)
 	}
 
 	// Construct the round call back function signature
diff --git a/api/utils_test.go b/api/utils_test.go
index 31e09e2d4..ab2079ba3 100644
--- a/api/utils_test.go
+++ b/api/utils_test.go
@@ -61,7 +61,7 @@ func newTestingClient(face interface{}) (*Client, error) {
 
 	thisInstance, err := network.NewInstanceTesting(instanceComms, def, def, nil, nil, face)
 	if err != nil {
-		return nil, nil
+		return nil, err
 	}
 
 	c.network = &testNetworkManagerGeneric{instance: thisInstance}
@@ -83,6 +83,7 @@ func getNDF(face interface{}) *ndf.NetworkDefinition {
 	return &ndf.NetworkDefinition{
 		Registration: ndf.Registration{
 			TlsCertificate: string(cert),
+			EllipticPubKey: "/WRtT+mDZGC3FXQbvuQgfqOonAjJ47IKE0zhaGTQQ70=",
 		},
 		Nodes: []ndf.Node{
 			{
@@ -147,6 +148,6 @@ func signRoundInfo(ri *pb.RoundInfo) error {
 
 	ourPrivateKey := &rsa.PrivateKey{PrivateKey: *pk}
 
-	return signature.Sign(ri, ourPrivateKey)
+	return signature.SignRsa(ri, ourPrivateKey)
 
 }
diff --git a/bindings/callback.go b/bindings/callback.go
index 34d26eccc..d0fe898c2 100644
--- a/bindings/callback.go
+++ b/bindings/callback.go
@@ -97,16 +97,15 @@ type ClientError interface {
 	Report(source, message, trace string)
 }
 
-
-type LogWriter interface{
+type LogWriter interface {
 	Log(string)
 }
 
-type writerAdapter struct{
+type writerAdapter struct {
 	lw LogWriter
 }
 
-func (wa *writerAdapter)Write(p []byte) (n int, err error){
+func (wa *writerAdapter) Write(p []byte) (n int, err error) {
 	wa.lw.Log(string(p))
 	return len(p), nil
 }
diff --git a/go.mod b/go.mod
index 62f9d2992..c3fcb8243 100644
--- a/go.mod
+++ b/go.mod
@@ -19,11 +19,11 @@ require (
 	github.com/spf13/jwalterweatherman v1.1.0
 	github.com/spf13/viper v1.7.1
 	gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228
-	gitlab.com/elixxir/comms v0.0.4-0.20210413194022-f5422be88efb
+	gitlab.com/elixxir/comms v0.0.4-0.20210414200820-10e888270d4d
 	gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803
 	gitlab.com/elixxir/ekv v0.1.4
 	gitlab.com/elixxir/primitives v0.0.3-0.20210409190923-7bf3cd8d97e7
-	gitlab.com/xx_network/comms v0.0.4-0.20210413200413-41a493c32b06
+	gitlab.com/xx_network/comms v0.0.4-0.20210414191603-0904bc6eeda2
 	gitlab.com/xx_network/crypto v0.0.5-0.20210413200952-56bd15ec9d99
 	gitlab.com/xx_network/primitives v0.0.4-0.20210412170941-7ef69bce5a5c
 	golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
diff --git a/go.sum b/go.sum
index 0cbd894a3..bc295f668 100644
--- a/go.sum
+++ b/go.sum
@@ -283,6 +283,10 @@ gitlab.com/elixxir/comms v0.0.4-0.20210405183148-930ea17a1b5f h1:ZUY46FcnA7BOd9p
 gitlab.com/elixxir/comms v0.0.4-0.20210405183148-930ea17a1b5f/go.mod h1:jqqUYnsftpfQXJ57BPYp5A+i7qfA5IXhKUE9ZOSrqaE=
 gitlab.com/elixxir/comms v0.0.4-0.20210413194022-f5422be88efb h1:mPwoG9nAhihK4Rfl6Hph/DzMmkePv4zJ4nzTC+ewnEc=
 gitlab.com/elixxir/comms v0.0.4-0.20210413194022-f5422be88efb/go.mod h1:2meX6DKpVJAUcgt1d727t1I28C8qsZNSn9Vm8dlkgmA=
+gitlab.com/elixxir/comms v0.0.4-0.20210414195240-0a29afe5c282 h1:sv1Yiv18o8Q/tpBSP3Bpm2GrbQYdWcGaXELIU6OGxVc=
+gitlab.com/elixxir/comms v0.0.4-0.20210414195240-0a29afe5c282/go.mod h1:K0sExgT6vTjMY/agP7hRSutveJzGSNOuFjSsAl2vmz8=
+gitlab.com/elixxir/comms v0.0.4-0.20210414200820-10e888270d4d h1:bHhOyckCTs0mRdgasEWgyxSz3JgK1J0ZBaV5cp2IjLk=
+gitlab.com/elixxir/comms v0.0.4-0.20210414200820-10e888270d4d/go.mod h1:K0sExgT6vTjMY/agP7hRSutveJzGSNOuFjSsAl2vmz8=
 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/crypto v0.0.3 h1:znCt/x2bL4y8czTPaaFkwzdgSgW3BJc/1+dxyf1jqVw=
@@ -311,6 +315,8 @@ gitlab.com/xx_network/comms v0.0.4-0.20210401160731-7b8890cdd8ad/go.mod h1:inre/
 gitlab.com/xx_network/comms v0.0.4-0.20210407173545-dafd47029306/go.mod h1:PXbUpBMUcDygpEV1ptEc/pych07YkYQ/tv0AQPw+BRk=
 gitlab.com/xx_network/comms v0.0.4-0.20210413200413-41a493c32b06 h1:ejoRHig0h5oEXLbEqQbE3wjcJtEoK0q7mHkfZjphtRo=
 gitlab.com/xx_network/comms v0.0.4-0.20210413200413-41a493c32b06/go.mod h1:PXbUpBMUcDygpEV1ptEc/pych07YkYQ/tv0AQPw+BRk=
+gitlab.com/xx_network/comms v0.0.4-0.20210414191603-0904bc6eeda2 h1:4Xhw5zO9ggeD66z5SajzRcgkQ0RNdAENETwPlawo5aU=
+gitlab.com/xx_network/comms v0.0.4-0.20210414191603-0904bc6eeda2/go.mod h1:PXbUpBMUcDygpEV1ptEc/pych07YkYQ/tv0AQPw+BRk=
 gitlab.com/xx_network/crypto v0.0.3/go.mod h1:DF2HYvvCw9wkBybXcXAgQMzX+MiGbFPjwt3t17VRqRE=
 gitlab.com/xx_network/crypto v0.0.4 h1:lpKOL5mTJ2awWMfgBy30oD/UvJVrWZzUimSHlOdZZxo=
 gitlab.com/xx_network/crypto v0.0.4/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk=
diff --git a/interfaces/params/network.go b/interfaces/params/network.go
index 95e3bad0c..2f11441ea 100644
--- a/interfaces/params/network.go
+++ b/interfaces/params/network.go
@@ -39,14 +39,14 @@ type Network struct {
 
 func GetDefaultNetwork() Network {
 	n := Network{
-		TrackNetworkPeriod:   100 * time.Millisecond,
-		MaxCheckedRounds:     500,
-		RegNodesBufferLen:    500,
-		NetworkHealthTimeout: 30 * time.Second,
-		E2EParams:            GetDefaultE2ESessionParams(),
+		TrackNetworkPeriod:        100 * time.Millisecond,
+		MaxCheckedRounds:          500,
+		RegNodesBufferLen:         500,
+		NetworkHealthTimeout:      30 * time.Second,
+		E2EParams:                 GetDefaultE2ESessionParams(),
 		ParallelNodeRegistrations: 8,
-		KnownRoundsThreshold: 1500, //5 rounds/sec * 60 sec/min * 5 min
-		FastPolling: true,
+		KnownRoundsThreshold:      1500, //5 rounds/sec * 60 sec/min * 5 min
+		FastPolling:               true,
 	}
 	n.Rounds = GetDefaultRounds()
 	n.Messages = GetDefaultMessage()
diff --git a/interfaces/params/rounds.go b/interfaces/params/rounds.go
index 87fa53fc0..07c4c3c25 100644
--- a/interfaces/params/rounds.go
+++ b/interfaces/params/rounds.go
@@ -39,9 +39,9 @@ func GetDefaultRounds() Rounds {
 		HistoricalRoundsPeriod:     100 * time.Millisecond,
 		NumMessageRetrievalWorkers: 8,
 
-		HistoricalRoundsBufferLen: 1000,
-		LookupRoundsBufferLen:     2000,
-		ForceHistoricalRounds:     false,
+		HistoricalRoundsBufferLen:  1000,
+		LookupRoundsBufferLen:      2000,
+		ForceHistoricalRounds:      false,
 		MaxHistoricalRoundsRetries: 3,
 	}
 }
diff --git a/keyExchange/confirm_test.go b/keyExchange/confirm_test.go
index 8cef6f6f6..10c5ab525 100644
--- a/keyExchange/confirm_test.go
+++ b/keyExchange/confirm_test.go
@@ -20,8 +20,14 @@ import (
 // Smoke test for handleTrigger
 func TestHandleConfirm(t *testing.T) {
 	// Generate alice and bob's session
-	aliceSession, _ := InitTestingContextGeneric(t)
-	bobSession, _ := InitTestingContextGeneric(t)
+	aliceSession, _, err := InitTestingContextGeneric(t)
+	if err != nil {
+		t.Fatalf("Failed to create alice session: %v", err)
+	}
+	bobSession, _, err := InitTestingContextGeneric(t)
+	if err != nil {
+		t.Fatalf("Failed to create bob session: %v", err)
+	}
 
 	// Maintain an ID for bob
 	bobID := id.NewIdFromBytes([]byte("test"), t)
diff --git a/keyExchange/exchange.go b/keyExchange/exchange.go
index d94e8800f..42b7a177e 100644
--- a/keyExchange/exchange.go
+++ b/keyExchange/exchange.go
@@ -32,7 +32,7 @@ func Start(switchboard *switchboard.Switchboard, sess *storage.Session, net inte
 	// create the trigger stoppable
 	triggerStop := stoppable.NewSingle(keyExchangeTriggerName)
 
-	cleanupTrigger := func(){
+	cleanupTrigger := func() {
 		switchboard.Unregister(triggerID)
 	}
 
@@ -46,7 +46,7 @@ func Start(switchboard *switchboard.Switchboard, sess *storage.Session, net inte
 
 	// register the confirm stoppable
 	confirmStop := stoppable.NewSingle(keyExchangeConfirmName)
-	cleanupConfirm := func(){
+	cleanupConfirm := func() {
 		switchboard.Unregister(confirmID)
 	}
 
diff --git a/keyExchange/trigger_test.go b/keyExchange/trigger_test.go
index 430bba91a..5dce2d6a7 100644
--- a/keyExchange/trigger_test.go
+++ b/keyExchange/trigger_test.go
@@ -23,9 +23,14 @@ import (
 // Smoke test for handleTrigger
 func TestHandleTrigger(t *testing.T) {
 	// Generate alice and bob's session
-	aliceSession, aliceManager := InitTestingContextGeneric(t)
-	bobSession, _ := InitTestingContextGeneric(t)
-
+	aliceSession, aliceManager, err := InitTestingContextGeneric(t)
+	if err != nil {
+		t.Fatalf("Failed to create alice session: %v", err)
+	}
+	bobSession, _, err := InitTestingContextGeneric(t)
+	if err != nil {
+		t.Fatalf("Failed to create bob session: %v", err)
+	}
 	// Pull the keys for Alice and Bob
 	alicePrivKey := aliceSession.E2e().GetDHPrivateKey()
 	bobPubKey := bobSession.E2e().GetDHPublicKey()
@@ -62,7 +67,7 @@ func TestHandleTrigger(t *testing.T) {
 	// Handle the trigger and check for an error
 	rekeyParams := params.GetDefaultRekey()
 	rekeyParams.RoundTimeout = 0 * time.Second
-	err := handleTrigger(aliceSession, aliceManager, receiveMsg, rekeyParams)
+	err = handleTrigger(aliceSession, aliceManager, receiveMsg, rekeyParams)
 	if err != nil {
 		t.Errorf("Handle trigger error: %v", err)
 	}
diff --git a/keyExchange/utils_test.go b/keyExchange/utils_test.go
index a1447b990..f02e05665 100644
--- a/keyExchange/utils_test.go
+++ b/keyExchange/utils_test.go
@@ -103,7 +103,7 @@ func (t *testNetworkManagerGeneric) InProgressRegistrations() int {
 	return 0
 }
 
-func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) {
+func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager, error) {
 	switch i.(type) {
 	case *testing.T, *testing.M, *testing.B, *testing.PB:
 		break
@@ -120,12 +120,12 @@ func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.Netw
 
 	thisInstance, err := network.NewInstanceTesting(instanceComms, def, def, nil, nil, i)
 	if err != nil {
-		return nil, nil
+		return nil, nil, err
 	}
 
 	thisManager := &testNetworkManagerGeneric{instance: thisInstance}
 
-	return thisSession, thisManager
+	return thisSession, thisManager, nil
 
 }
 
@@ -295,5 +295,8 @@ func getNDF() *ndf.NetworkDefinition {
 				"BA9AE3F1DD2487199874393CD4D832186800654760E1E34C09E4D155179F9EC0" +
 				"DC4473F996BDCE6EED1CABED8B6F116F7AD9CF505DF0F998E34AB27514B0FFE7",
 		},
+		Registration: ndf.Registration{
+			EllipticPubKey: "/WRtT+mDZGC3FXQbvuQgfqOonAjJ47IKE0zhaGTQQ70=",
+		},
 	}
 }
diff --git a/network/checkedRounds.go b/network/checkedRounds.go
index 8ffa9ba39..d104ac958 100644
--- a/network/checkedRounds.go
+++ b/network/checkedRounds.go
@@ -7,36 +7,35 @@ import (
 	"gitlab.com/xx_network/primitives/id"
 )
 
-
 type idFingerprint [16]byte
 
-type checkedRounds struct{
+type checkedRounds struct {
 	lookup map[idFingerprint]*checklist
 }
 
-type checklist struct{
+type checklist struct {
 	m map[id.Round]interface{}
 	l *list.List
 }
 
-func newCheckedRounds()*checkedRounds{
+func newCheckedRounds() *checkedRounds {
 	return &checkedRounds{
 		lookup: make(map[idFingerprint]*checklist),
 	}
 }
 
-func (cr *checkedRounds)Check(identity reception.IdentityUse, rid id.Round)bool{
+func (cr *checkedRounds) Check(identity reception.IdentityUse, rid id.Round) bool {
 	idFp := getIdFingerprint(identity)
 	cl, exists := cr.lookup[idFp]
-	if !exists{
+	if !exists {
 		cl = &checklist{
 			m: make(map[id.Round]interface{}),
 			l: list.New().Init(),
 		}
-		cr.lookup[idFp]=cl
+		cr.lookup[idFp] = cl
 	}
 
-	if _, exists := cl.m[rid]; !exists{
+	if _, exists := cl.m[rid]; !exists {
 		cl.m[rid] = nil
 		cl.l.PushBack(rid)
 		return true
@@ -44,7 +43,7 @@ func (cr *checkedRounds)Check(identity reception.IdentityUse, rid id.Round)bool{
 	return false
 }
 
-func (cr *checkedRounds)Prune(identity reception.IdentityUse, earliestAllowed id.Round){
+func (cr *checkedRounds) Prune(identity reception.IdentityUse, earliestAllowed id.Round) {
 	idFp := getIdFingerprint(identity)
 	cl, exists := cr.lookup[idFp]
 	if !exists {
@@ -52,19 +51,19 @@ func (cr *checkedRounds)Prune(identity reception.IdentityUse, earliestAllowed id
 	}
 
 	e := cl.l.Front()
-	for e!=nil {
-		if  e.Value.(id.Round)<earliestAllowed{
-			delete(cl.m,e.Value.(id.Round))
+	for e != nil {
+		if e.Value.(id.Round) < earliestAllowed {
+			delete(cl.m, e.Value.(id.Round))
 			lastE := e
 			e = e.Next()
 			cl.l.Remove(lastE)
-		}else{
+		} else {
 			break
 		}
 	}
 }
 
-func getIdFingerprint(identity reception.IdentityUse)idFingerprint{
+func getIdFingerprint(identity reception.IdentityUse) idFingerprint {
 	h := md5.New()
 	h.Write(identity.EphId[:])
 	h.Write(identity.Source[:])
@@ -72,4 +71,4 @@ func getIdFingerprint(identity reception.IdentityUse)idFingerprint{
 	fp := idFingerprint{}
 	copy(fp[:], h.Sum(nil))
 	return fp
-}
\ No newline at end of file
+}
diff --git a/network/ephemeral/tracker_test.go b/network/ephemeral/tracker_test.go
index aa4589ebe..e6c3e11f8 100644
--- a/network/ephemeral/tracker_test.go
+++ b/network/ephemeral/tracker_test.go
@@ -105,7 +105,7 @@ func setupInstance(instance interfaces.NetworkManager) error {
 	if err != nil {
 		return errors.Errorf("Failed to load cert from from file: %v", err)
 	}
-	if err = signature.Sign(ri, testCert); err != nil {
+	if err = signature.SignRsa(ri, testCert); err != nil {
 		return errors.Errorf("Failed to sign round info: %v", err)
 	}
 	if err = instance.GetInstance().RoundUpdate(ri); err != nil {
@@ -115,7 +115,7 @@ func setupInstance(instance interfaces.NetworkManager) error {
 	ri = &mixmessages.RoundInfo{
 		ID: 2,
 	}
-	if err = signature.Sign(ri, testCert); err != nil {
+	if err = signature.SignRsa(ri, testCert); err != nil {
 		return errors.Errorf("Failed to sign round info: %v", err)
 	}
 	if err = instance.GetInstance().RoundUpdate(ri); err != nil {
diff --git a/network/follow.go b/network/follow.go
index 5e6f6f1b4..ebf06e5db 100644
--- a/network/follow.go
+++ b/network/follow.go
@@ -189,8 +189,8 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source,
 					update.State = uint32(states.FAILED)
 					rnd, err := m.Instance.GetWrappedRound(id.Round(update.ID))
 					if err != nil {
-						jww.ERROR.Printf("Failed to report client error: " +
-							"Could not get round for event triggering: " +
+						jww.ERROR.Printf("Failed to report client error: "+
+							"Could not get round for event triggering: "+
 							"Unable to get round %d from instance: %+v",
 							id.Round(update.ID), err)
 						break
@@ -261,24 +261,24 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source,
 	earliestRemaining, roundsWithMessages, roundsUnknown := gwRoundsState.RangeUnchecked(updated,
 		m.param.KnownRoundsThreshold, roundChecker)
 	_, changed := identity.ER.Set(earliestRemaining)
-	if changed{
+	if changed {
 		jww.TRACE.Printf("External returns of RangeUnchecked: %d, %v, %v", earliestRemaining, roundsWithMessages, roundsUnknown)
 		jww.DEBUG.Printf("New Earliest Remaining: %d", earliestRemaining)
 	}
 
-	roundsWithMessages2 := identity.UR.Iterate(func(rid id.Round)bool{
-		if gwRoundsState.Checked(rid){
+	roundsWithMessages2 := identity.UR.Iterate(func(rid id.Round) bool {
+		if gwRoundsState.Checked(rid) {
 			return rounds.Checker(rid, filterList)
 		}
 		return false
 	}, roundsUnknown)
 
-	for _, rid := range roundsWithMessages{
-		if m.checked.Check(identity, rid){
+	for _, rid := range roundsWithMessages {
+		if m.checked.Check(identity, rid) {
 			m.round.GetMessagesFromRound(rid, identity)
 		}
 	}
-	for _, rid := range roundsWithMessages2{
+	for _, rid := range roundsWithMessages2 {
 		m.round.GetMessagesFromRound(rid, identity)
 	}
 
@@ -289,10 +289,9 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source,
 
 }
 
-
-func getEarliestToKeep(delta uint, lastchecked id.Round)id.Round{
-	if uint(lastchecked)<delta{
+func getEarliestToKeep(delta uint, lastchecked id.Round) id.Round {
+	if uint(lastchecked) < delta {
 		return 0
 	}
-	return  lastchecked - id.Round(delta)
+	return lastchecked - id.Round(delta)
 }
diff --git a/network/node/register.go b/network/node/register.go
index 2b59d1e7f..a27529b6e 100644
--- a/network/node/register.go
+++ b/network/node/register.go
@@ -45,7 +45,7 @@ func StartRegistration(instance *network.Instance, session *storage.Session, rng
 
 	multi := stoppable.NewMulti("NodeRegistrations")
 
-	for i:=uint(0);i<numParallel;i++{
+	for i := uint(0); i < numParallel; i++ {
 		stop := stoppable.NewSingle(fmt.Sprintf("NodeRegistration %d", i))
 
 		go registerNodes(session, rngGen, comms, stop, c)
diff --git a/network/rounds/check.go b/network/rounds/check.go
index 9deb3ec6c..a22bafd8e 100644
--- a/network/rounds/check.go
+++ b/network/rounds/check.go
@@ -47,9 +47,9 @@ func serializeRound(roundId id.Round) []byte {
 	return b
 }
 
-func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.IdentityUse){
+func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.IdentityUse) {
 	ri, err := m.Instance.GetRound(roundID)
-	if err !=nil || m.params.ForceHistoricalRounds {
+	if err != nil || m.params.ForceHistoricalRounds {
 		if m.params.ForceHistoricalRounds {
 			jww.WARN.Printf("Forcing use of historical rounds for round ID %d.",
 				roundID)
@@ -59,8 +59,8 @@ func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.Iden
 			identity.Source)
 		// If we didn't find it, send to Historical Rounds Retrieval
 		m.historicalRounds <- historicalRoundRequest{
-			rid:      roundID,
-			identity: identity,
+			rid:         roundID,
+			identity:    identity,
 			numAttempts: 0,
 		}
 	} else {
@@ -74,4 +74,4 @@ func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.Iden
 		}
 	}
 
-}
\ No newline at end of file
+}
diff --git a/network/rounds/historical.go b/network/rounds/historical.go
index d5451989c..6d2d76de3 100644
--- a/network/rounds/historical.go
+++ b/network/rounds/historical.go
@@ -34,8 +34,8 @@ type historicalRoundsComms interface {
 
 //structure which contains a historical round lookup
 type historicalRoundRequest struct {
-	rid      id.Round
-	identity reception.IdentityUse
+	rid         id.Round
+	identity    reception.IdentityUse
 	numAttempts uint
 }
 
@@ -124,19 +124,19 @@ func (m *Manager) processHistoricalRounds(comm historicalRoundsComms, quitCh <-c
 			// pick them up in the future.
 			if roundInfo == nil {
 				roundRequests[i].numAttempts++
-				if roundRequests[i].numAttempts==m.params.MaxHistoricalRoundsRetries{
-					jww.ERROR.Printf("Failed to retreive historical " +
+				if roundRequests[i].numAttempts == m.params.MaxHistoricalRoundsRetries {
+					jww.ERROR.Printf("Failed to retreive historical "+
 						"round %d on last attempt, will not try again",
 						roundRequests[i].rid)
-				}else{
+				} else {
 					select {
-					case m.historicalRounds <-roundRequests[i]:
-						jww.WARN.Printf("Failed to retreive historical " +
+					case m.historicalRounds <- roundRequests[i]:
+						jww.WARN.Printf("Failed to retreive historical "+
 							"round %d, will try up to %d more times",
 							roundRequests[i].rid, m.params.MaxHistoricalRoundsRetries-roundRequests[i].numAttempts)
 					default:
-						jww.WARN.Printf("Failed to retreive historical " +
-							"round %d, failed to try again, round will not be " +
+						jww.WARN.Printf("Failed to retreive historical "+
+							"round %d, failed to try again, round will not be "+
 							"retreived", roundRequests[i].rid)
 					}
 				}
diff --git a/network/rounds/manager.go b/network/rounds/manager.go
index 177c1c318..6e94ef391 100644
--- a/network/rounds/manager.go
+++ b/network/rounds/manager.go
@@ -55,4 +55,4 @@ func (m *Manager) StartProcessors() stoppable.Stoppable {
 		multi.Add(stopper)
 	}
 	return multi
-}
\ No newline at end of file
+}
diff --git a/network/rounds/utils_test.go b/network/rounds/utils_test.go
index 69c5925ed..c963199be 100644
--- a/network/rounds/utils_test.go
+++ b/network/rounds/utils_test.go
@@ -38,6 +38,7 @@ const ReturningGateway = "GetMessageRequest"
 const FalsePositive = "FalsePositive"
 const PayloadMessage = "Payload"
 const ErrorGateway = "Error"
+
 type mockMessageRetrievalComms struct {
 	testingSignature *testing.T
 }
diff --git a/permissioning/permissioning_test.go b/permissioning/permissioning_test.go
index 7f691f3a4..dc3e73c2e 100644
--- a/permissioning/permissioning_test.go
+++ b/permissioning/permissioning_test.go
@@ -22,7 +22,9 @@ func TestInit(t *testing.T) {
 		t.Fatal(err)
 	}
 	def := &ndf.NetworkDefinition{
-		Registration: ndf.Registration{},
+		Registration: ndf.Registration{
+			EllipticPubKey: "MqaJJ3GjFisNRM6LRedRnooi14gepMaQxyWctXVU",
+		},
 	}
 	reg, err := Init(comms, def)
 	if err != nil {
diff --git a/stoppable/cleanup.go b/stoppable/cleanup.go
index 8111abe20..b1e2c4561 100644
--- a/stoppable/cleanup.go
+++ b/stoppable/cleanup.go
@@ -87,7 +87,7 @@ func (c *Cleanup) Close(timeout time.Duration) error {
 			}
 		})
 
-	if err!=nil{
+	if err != nil {
 		jww.ERROR.Printf(err.Error())
 	}
 
diff --git a/storage/cmix/store_test.go b/storage/cmix/store_test.go
index f4dfc3a7a..63329b769 100644
--- a/storage/cmix/store_test.go
+++ b/storage/cmix/store_test.go
@@ -70,7 +70,6 @@ func TestStore_AddRemove(t *testing.T) {
 	}
 }
 
-
 // Happy path Add/Has test
 func TestStore_AddHas(t *testing.T) {
 	// Uncomment to print keys that Set and Get are called on
diff --git a/storage/e2e/relationship.go b/storage/e2e/relationship.go
index 6efd7081b..a492a72ed 100644
--- a/storage/e2e/relationship.go
+++ b/storage/e2e/relationship.go
@@ -303,9 +303,9 @@ func (r *relationship) getNewestRekeyableSession() *Session {
 		// always valid. It isn't clear it can fail though because we are
 		// accessing the data in the same order it would be written (i think)
 		if s.Status() != RekeyEmpty {
-			if s.IsConfirmed(){
+			if s.IsConfirmed() {
 				return s
-			}else if unconfirmed == nil{
+			} else if unconfirmed == nil {
 				unconfirmed = s
 			}
 		}
diff --git a/storage/e2e/relationship_test.go b/storage/e2e/relationship_test.go
index 49fa51de4..457e4f6dc 100644
--- a/storage/e2e/relationship_test.go
+++ b/storage/e2e/relationship_test.go
@@ -571,4 +571,4 @@ func Test_relationship_getNewestRekeyableSession(t *testing.T) {
 			}
 		})
 	}
-}
\ No newline at end of file
+}
diff --git a/storage/e2e/session.go b/storage/e2e/session.go
index 5f0344378..ad684725a 100644
--- a/storage/e2e/session.go
+++ b/storage/e2e/session.go
@@ -119,7 +119,7 @@ func newSession(ship *relationship, t RelationshipType, myPrivKey, partnerPubKey
 		relationshipFingerprint: relationshipFingerprint,
 		negotiationStatus:       negotiationStatus,
 		partnerSource:           trigger,
-		partner: 				 ship.manager.partner.DeepCopy(),
+		partner:                 ship.manager.partner.DeepCopy(),
 	}
 
 	session.kv = session.generate(ship.kv)
@@ -173,8 +173,8 @@ func loadSession(ship *relationship, kv *versioned.KV,
 	}
 	session.relationshipFingerprint = relationshipFingerprint
 
-	if !session.partner.Cmp(ship.manager.partner){
-		return nil, errors.Errorf("Stored partner (%s) did not match " +
+	if !session.partner.Cmp(ship.manager.partner) {
+		return nil, errors.Errorf("Stored partner (%s) did not match "+
 			"relationship partner (%s)", session.partner, ship.manager.partner)
 	}
 
diff --git a/storage/e2e/session_test.go b/storage/e2e/session_test.go
index 800cac541..258cea9ed 100644
--- a/storage/e2e/session_test.go
+++ b/storage/e2e/session_test.go
@@ -628,8 +628,8 @@ func makeTestSession() (*Session, *context) {
 		e2eParams:     params.GetDefaultE2ESessionParams(),
 		relationship: &relationship{
 			manager: &Manager{
-				ctx: ctx,
-				kv:  kv,
+				ctx:     ctx,
+				kv:      kv,
 				partner: &id.ID{},
 			},
 			kv: kv,
@@ -638,7 +638,7 @@ func makeTestSession() (*Session, *context) {
 		t:                 Receive,
 		negotiationStatus: Confirmed,
 		rekeyThreshold:    5,
-		partner: &id.ID{},
+		partner:           &id.ID{},
 	}
 	var err error
 	s.keyState, err = newStateVector(s.kv,
diff --git a/storage/e2e/store.go b/storage/e2e/store.go
index a0a427e0a..e647cacab 100644
--- a/storage/e2e/store.go
+++ b/storage/e2e/store.go
@@ -260,8 +260,8 @@ func (s *Store) unmarshal(b []byte) error {
 				partnerID, err.Error())
 		}
 
-		if !manager.GetPartnerID().Cmp(partnerID){
-			jww.FATAL.Panicf("Loaded a manager with the wrong partner " +
+		if !manager.GetPartnerID().Cmp(partnerID) {
+			jww.FATAL.Panicf("Loaded a manager with the wrong partner "+
 				"ID: \n\t loaded: %s \n\t present: %s",
 				partnerID, manager.GetPartnerID())
 		}
diff --git a/storage/rounds/unknownRounds_test.go b/storage/rounds/unknownRounds_test.go
index ffc9bdd46..f437e0839 100644
--- a/storage/rounds/unknownRounds_test.go
+++ b/storage/rounds/unknownRounds_test.go
@@ -27,7 +27,7 @@ func TestNewUnknownRoundsStore(t *testing.T) {
 		params: DefaultUnknownRoundsParams(),
 	}
 
-	store := NewUnknownRounds(kv,  DefaultUnknownRoundsParams())
+	store := NewUnknownRounds(kv, DefaultUnknownRoundsParams())
 
 	// Compare manually created object with NewUnknownRoundsStore
 	if !reflect.DeepEqual(expectedStore, store) {
@@ -60,7 +60,7 @@ func TestNewUnknownRoundsStore(t *testing.T) {
 // Full test
 func TestUnknownRoundsStore_Iterate(t *testing.T) {
 	kv := versioned.NewKV(make(ekv.Memstore))
-	store := NewUnknownRounds(kv,  DefaultUnknownRoundsParams())
+	store := NewUnknownRounds(kv, DefaultUnknownRoundsParams())
 
 	// Return true only for rounds that are even
 	mockChecker := func(rid id.Round) bool {
@@ -116,7 +116,7 @@ func TestUnknownRoundsStore_Iterate(t *testing.T) {
 	// Iterate over map until all rounds have checks incremented over
 	// maxCheck
 	for i := 0; i < defaultMaxCheck+1; i++ {
-		_ = store.Iterate(mockChecker,[]id.Round{})
+		_ = store.Iterate(mockChecker, []id.Round{})
 
 	}
 
-- 
GitLab