From 24fc1395e2f94d09fd5e2bcd5877a19f13e6b8da Mon Sep 17 00:00:00 2001
From: "Richard T. Carback III" <rick.carback@gmail.com>
Date: Wed, 6 Jul 2022 19:15:51 +0000
Subject: [PATCH] Add headers and perform a light refactor to remove some files
 with 'Tracker' internal-only code, moving them to the bottom of the main
 file.

---
 bindings/authenticatedConnection.go   |  7 +++
 bindings/cmix.go                      | 66 +++++++++++++++++++++-
 bindings/cmixTracker.go               | 54 ------------------
 bindings/connect.go                   | 81 +++++++++++++++++++++++----
 bindings/connect_test.go              | 14 ++++-
 bindings/connectionTracker.go         | 54 ------------------
 bindings/delivery.go                  | 10 +++-
 bindings/e2e.go                       | 62 ++++++++++++++++++--
 bindings/e2eHandler.go                | 11 ++--
 bindings/e2eTracker.go                | 61 --------------------
 bindings/fileTransfer.go              | 10 +++-
 bindings/fileTransfer_test.go         | 10 +++-
 bindings/follow.go                    | 10 +++-
 bindings/identity.go                  |  8 +++
 bindings/identity_test.go             | 10 +++-
 bindings/listener.go                  |  8 +++
 bindings/listener_test.go             | 12 +++-
 bindings/{utilities.go => logging.go} | 12 +++-
 bindings/ndf.go                       |  7 +++
 bindings/ndf_test.go                  | 12 +++-
 bindings/restlike.go                  | 12 ++--
 bindings/restlikeSingle.go            |  8 +++
 bindings/secrets.go                   |  7 +++
 bindings/secrets_test.go              |  7 +++
 bindings/single.go                    |  8 +++
 bindings/single_test.go               | 12 +++-
 bindings/version.go                   | 13 +++--
 27 files changed, 367 insertions(+), 219 deletions(-)
 delete mode 100644 bindings/cmixTracker.go
 delete mode 100644 bindings/connectionTracker.go
 delete mode 100644 bindings/e2eTracker.go
 rename bindings/{utilities.go => logging.go} (76%)

diff --git a/bindings/authenticatedConnection.go b/bindings/authenticatedConnection.go
index ce33daf0e..5f41453a5 100644
--- a/bindings/authenticatedConnection.go
+++ b/bindings/authenticatedConnection.go
@@ -1,3 +1,10 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
diff --git a/bindings/cmix.go b/bindings/cmix.go
index 5c1790738..e22bb9364 100644
--- a/bindings/cmix.go
+++ b/bindings/cmix.go
@@ -1,7 +1,15 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"fmt"
+	"sync"
 
 	"github.com/pkg/errors"
 	jww "github.com/spf13/jwalterweatherman"
@@ -50,9 +58,14 @@ func NewKeystore(network, storageDir string, password []byte, regCode string) er
 // Login does not block on network connection, and instead loads and
 // starts subprocesses to perform network operations.
 // TODO: add in custom parameters instead of the default
-func Login(storageDir string, password []byte) (*Cmix, error) {
-	paramsJSON := GetDefaultCMixParams()
-	params, err := parseCMixParams(paramsJSON)
+func Login(storageDir string, password []byte, cmixParamsJSON []byte) (*Cmix,
+	error) {
+	if len(cmixParamsJSON) == 0 {
+		jww.WARN.Printf("cmix params not specified, using defaults...")
+		cmixParamsJSON = GetDefaultCMixParams()
+	}
+
+	params, err := parseCMixParams(cmixParamsJSON)
 	if err != nil {
 		return nil, err
 	}
@@ -68,3 +81,50 @@ func Login(storageDir string, password []byte) (*Cmix, error) {
 func (c *Cmix) GetID() int {
 	return c.id
 }
+
+// cmixTracker is a singleton used to keep track of extant Cmix objects,
+// preventing race conditions created by passing it over the bindings
+type cmixTracker struct {
+	clients map[int]*Cmix
+	count   int
+	mux     sync.RWMutex
+}
+
+// make a Cmix from an xxdk.Cmix, assigns it a unique ID,
+// and adds it to the cmixTracker
+func (ct *cmixTracker) make(c *xxdk.Cmix) *Cmix {
+	ct.mux.Lock()
+	defer ct.mux.Unlock()
+
+	id := ct.count
+	ct.count++
+
+	ct.clients[id] = &Cmix{
+		api: c,
+		id:  id,
+	}
+
+	return ct.clients[id]
+}
+
+// get a Cmix from the cmixTracker given its ID
+func (ct *cmixTracker) get(id int) (*Cmix, error) {
+	ct.mux.RLock()
+	defer ct.mux.RUnlock()
+
+	c, exist := ct.clients[id]
+	if !exist {
+		return nil, errors.Errorf("Cannot get client for id %d, client "+
+			"does not exist", id)
+	}
+
+	return c, nil
+}
+
+// delete a Cmix if it exists in the cmixTracker
+func (ct *cmixTracker) delete(id int) {
+	ct.mux.Lock()
+	defer ct.mux.Unlock()
+
+	delete(ct.clients, id)
+}
diff --git a/bindings/cmixTracker.go b/bindings/cmixTracker.go
deleted file mode 100644
index cb7d215a0..000000000
--- a/bindings/cmixTracker.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package bindings
-
-import (
-	"github.com/pkg/errors"
-	"gitlab.com/elixxir/client/xxdk"
-	"sync"
-)
-
-// cmixTracker is a singleton used to keep track of extant Cmix objects,
-// preventing race conditions created by passing it over the bindings
-type cmixTracker struct {
-	clients map[int]*Cmix
-	count   int
-	mux     sync.RWMutex
-}
-
-// make a Cmix from an xxdk.Cmix, assigns it a unique ID,
-// and adds it to the cmixTracker
-func (ct *cmixTracker) make(c *xxdk.Cmix) *Cmix {
-	ct.mux.Lock()
-	defer ct.mux.Unlock()
-
-	id := ct.count
-	ct.count++
-
-	ct.clients[id] = &Cmix{
-		api: c,
-		id:  id,
-	}
-
-	return ct.clients[id]
-}
-
-// get a Cmix from the cmixTracker given its ID
-func (ct *cmixTracker) get(id int) (*Cmix, error) {
-	ct.mux.RLock()
-	defer ct.mux.RUnlock()
-
-	c, exist := ct.clients[id]
-	if !exist {
-		return nil, errors.Errorf("Cannot get client for id %d, client "+
-			"does not exist", id)
-	}
-
-	return c, nil
-}
-
-// delete a Cmix if it exists in the cmixTracker
-func (ct *cmixTracker) delete(id int) {
-	ct.mux.Lock()
-	defer ct.mux.Unlock()
-
-	delete(ct.clients, id)
-}
diff --git a/bindings/connect.go b/bindings/connect.go
index 94d13cba8..85c25b4ee 100644
--- a/bindings/connect.go
+++ b/bindings/connect.go
@@ -1,10 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+	"sync"
 
+	"github.com/pkg/errors"
+	jww "github.com/spf13/jwalterweatherman"
 	"gitlab.com/elixxir/client/catalog"
 	"gitlab.com/elixxir/client/connect"
+	"gitlab.com/elixxir/client/xxdk"
 	"gitlab.com/elixxir/crypto/contact"
 )
 
@@ -19,6 +30,7 @@ var connectionTrackerSingleton = &connectionTracker{
 type Connection struct {
 	connection connect.Connection
 	id         int
+	params     xxdk.E2EParams
 }
 
 // GetId returns the Connection.id
@@ -32,9 +44,12 @@ func (c *Connection) GetId() int {
 // partner.Manager is confirmed.
 // recipientContact - marshalled contact.Contact object
 // myIdentity - marshalled ReceptionIdentity object
-func (c *Cmix) Connect(e2eId int, recipientContact []byte) (
+func (c *Cmix) Connect(e2eId int, recipientContact, e2eParamsJSON []byte) (
 	*Connection, error) {
-	paramsJSON := GetDefaultE2EParams()
+	if len(e2eParamsJSON) == 0 {
+		jww.WARN.Printf("e2e params not specified, using defaults...")
+		e2eParamsJSON = GetDefaultE2EParams()
+	}
 	cont, err := contact.Unmarshal(recipientContact)
 	if err != nil {
 		return nil, err
@@ -45,7 +60,7 @@ func (c *Cmix) Connect(e2eId int, recipientContact []byte) (
 		return nil, err
 	}
 
-	p, err := parseE2EParams(paramsJSON)
+	p, err := parseE2EParams(e2eParamsJSON)
 	if err != nil {
 		return nil, err
 	}
@@ -55,21 +70,14 @@ func (c *Cmix) Connect(e2eId int, recipientContact []byte) (
 		return nil, err
 	}
 
-	return connectionTrackerSingleton.make(connection), nil
+	return connectionTrackerSingleton.make(connection, p), nil
 }
 
 // SendE2E is a wrapper for sending specifically to the Connection's partner.Manager
 // Returns marshalled E2ESendReport
 func (c *Connection) SendE2E(mt int, payload []byte) ([]byte, error) {
-	paramsJSON := GetDefaultE2EParams()
-
-	params, err := parseE2EParams(paramsJSON)
-	if err != nil {
-		return nil, err
-	}
-
 	rounds, mid, ts, err := c.connection.SendE2E(catalog.MessageType(mt), payload,
-		params.Base)
+		c.params.Base)
 
 	if err != nil {
 		return nil, err
@@ -102,3 +110,52 @@ func (c *Connection) RegisterListener(messageType int, newListener Listener) err
 	_, err := c.connection.RegisterListener(catalog.MessageType(messageType), listener{l: newListener})
 	return err
 }
+
+// connectionTracker is a singleton used to keep track of extant clients, allowing
+// for race condition free passing over the bindings
+
+type connectionTracker struct {
+	connections map[int]*Connection
+	count       int
+	mux         sync.RWMutex
+}
+
+// make makes a client from an API client, assigning it a unique ID
+func (ct *connectionTracker) make(c connect.Connection,
+	params xxdk.E2EParams) *Connection {
+	ct.mux.Lock()
+	defer ct.mux.Unlock()
+
+	id := ct.count
+	ct.count++
+
+	ct.connections[id] = &Connection{
+		connection: c,
+		id:         id,
+		params:     params,
+	}
+
+	return ct.connections[id]
+}
+
+//get returns a client given its ID
+func (ct *connectionTracker) get(id int) (*Connection, error) {
+	ct.mux.RLock()
+	defer ct.mux.RUnlock()
+
+	c, exist := ct.connections[id]
+	if !exist {
+		return nil, errors.Errorf("Cannot get client for id %d, client "+
+			"does not exist", id)
+	}
+
+	return c, nil
+}
+
+//deletes a client if it exists
+func (ct *connectionTracker) delete(id int) {
+	ct.mux.Lock()
+	defer ct.mux.Unlock()
+
+	delete(ct.connections, id)
+}
diff --git a/bindings/connect_test.go b/bindings/connect_test.go
index 9093dd3ad..f6152c768 100644
--- a/bindings/connect_test.go
+++ b/bindings/connect_test.go
@@ -1,13 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
-	"gitlab.com/elixxir/crypto/e2e"
-	"gitlab.com/xx_network/crypto/csprng"
-	"gitlab.com/xx_network/primitives/id"
 	"reflect"
 	"testing"
 	"time"
+
+	"gitlab.com/elixxir/crypto/e2e"
+	"gitlab.com/xx_network/crypto/csprng"
+	"gitlab.com/xx_network/primitives/id"
 )
 
 func TestE2ESendReport_JSON(t *testing.T) {
diff --git a/bindings/connectionTracker.go b/bindings/connectionTracker.go
deleted file mode 100644
index 0352c3285..000000000
--- a/bindings/connectionTracker.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package bindings
-
-import (
-	"github.com/pkg/errors"
-	"gitlab.com/elixxir/client/connect"
-	"sync"
-)
-
-// connectionTracker is a singleton used to keep track of extant clients, allowing
-// for race condition free passing over the bindings
-
-type connectionTracker struct {
-	connections map[int]*Connection
-	count       int
-	mux         sync.RWMutex
-}
-
-// make makes a client from an API client, assigning it a unique ID
-func (ct *connectionTracker) make(c connect.Connection) *Connection {
-	ct.mux.Lock()
-	defer ct.mux.Unlock()
-
-	id := ct.count
-	ct.count++
-
-	ct.connections[id] = &Connection{
-		connection: c,
-		id:         id,
-	}
-
-	return ct.connections[id]
-}
-
-//get returns a client given its ID
-func (ct *connectionTracker) get(id int) (*Connection, error) {
-	ct.mux.RLock()
-	defer ct.mux.RUnlock()
-
-	c, exist := ct.connections[id]
-	if !exist {
-		return nil, errors.Errorf("Cannot get client for id %d, client "+
-			"does not exist", id)
-	}
-
-	return c, nil
-}
-
-//deletes a client if it exists
-func (ct *connectionTracker) delete(id int) {
-	ct.mux.Lock()
-	defer ct.mux.Unlock()
-
-	delete(ct.connections, id)
-}
diff --git a/bindings/delivery.go b/bindings/delivery.go
index 9146e838f..0efa3e636 100644
--- a/bindings/delivery.go
+++ b/bindings/delivery.go
@@ -1,13 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
 	"fmt"
+	"time"
+
 	"github.com/pkg/errors"
 	jww "github.com/spf13/jwalterweatherman"
 	"gitlab.com/elixxir/client/cmix"
 	"gitlab.com/xx_network/primitives/id"
-	"time"
 )
 
 // Example marshalled roundList object:
diff --git a/bindings/e2e.go b/bindings/e2e.go
index b2e9984d5..e4405f15a 100644
--- a/bindings/e2e.go
+++ b/bindings/e2e.go
@@ -1,12 +1,16 @@
-////////////////////////////////////////////////////////////////////////////////
-// Copyright © 2022 Privategrity Corporation                                   /
-//                                                                             /
-// All rights reserved.                                                        /
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
 
 package bindings
 
 import (
+	"sync"
+
+	"github.com/pkg/errors"
 	"gitlab.com/elixxir/client/cmix/identity/receptionID"
 	"gitlab.com/elixxir/client/cmix/rounds"
 	"gitlab.com/elixxir/client/xxdk"
@@ -180,3 +184,51 @@ func (a *authCallback) Reset(partner contact.Contact,
 	receptionID receptionID.EphemeralIdentity, round rounds.Round, _ *xxdk.E2e) {
 	a.bindingsCbs.Reset(convertAuthCallbacks(partner, receptionID, round))
 }
+
+// e2eTracker is a singleton used to keep track of extant E2e objects,
+// preventing race conditions created by passing it over the bindings
+type e2eTracker struct {
+	// TODO: Key on Identity.ID to prevent duplication
+	clients map[int]*E2e
+	count   int
+	mux     sync.RWMutex
+}
+
+// make a E2e from an xxdk.E2e, assigns it a unique ID,
+// and adds it to the e2eTracker
+func (ct *e2eTracker) make(c *xxdk.E2e) *E2e {
+	ct.mux.Lock()
+	defer ct.mux.Unlock()
+
+	id := ct.count
+	ct.count++
+
+	ct.clients[id] = &E2e{
+		api: c,
+		id:  id,
+	}
+
+	return ct.clients[id]
+}
+
+// get an E2e from the e2eTracker given its ID
+func (ct *e2eTracker) get(id int) (*E2e, error) {
+	ct.mux.RLock()
+	defer ct.mux.RUnlock()
+
+	c, exist := ct.clients[id]
+	if !exist {
+		return nil, errors.Errorf("Cannot get client for id %d, client "+
+			"does not exist", id)
+	}
+
+	return c, nil
+}
+
+// delete an E2e if it exists in the e2eTracker
+func (ct *e2eTracker) delete(id int) {
+	ct.mux.Lock()
+	defer ct.mux.Unlock()
+
+	delete(ct.clients, id)
+}
diff --git a/bindings/e2eHandler.go b/bindings/e2eHandler.go
index 3fe81a225..5114f46ee 100644
--- a/bindings/e2eHandler.go
+++ b/bindings/e2eHandler.go
@@ -1,8 +1,9 @@
-////////////////////////////////////////////////////////////////////////////////
-// Copyright © 2022 Privategrity Corporation                                   /
-//                                                                             /
-// All rights reserved.                                                        /
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
 
 package bindings
 
diff --git a/bindings/e2eTracker.go b/bindings/e2eTracker.go
deleted file mode 100644
index 8f3ff5374..000000000
--- a/bindings/e2eTracker.go
+++ /dev/null
@@ -1,61 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// Copyright © 2022 Privategrity Corporation                                   /
-//                                                                             /
-// All rights reserved.                                                        /
-////////////////////////////////////////////////////////////////////////////////
-
-package bindings
-
-import (
-	"github.com/pkg/errors"
-	"gitlab.com/elixxir/client/xxdk"
-	"sync"
-)
-
-// e2eTracker is a singleton used to keep track of extant E2e objects,
-// preventing race conditions created by passing it over the bindings
-type e2eTracker struct {
-	// TODO: Key on Identity.ID to prevent duplication
-	clients map[int]*E2e
-	count   int
-	mux     sync.RWMutex
-}
-
-// make a E2e from an xxdk.E2e, assigns it a unique ID,
-// and adds it to the e2eTracker
-func (ct *e2eTracker) make(c *xxdk.E2e) *E2e {
-	ct.mux.Lock()
-	defer ct.mux.Unlock()
-
-	id := ct.count
-	ct.count++
-
-	ct.clients[id] = &E2e{
-		api: c,
-		id:  id,
-	}
-
-	return ct.clients[id]
-}
-
-// get an E2e from the e2eTracker given its ID
-func (ct *e2eTracker) get(id int) (*E2e, error) {
-	ct.mux.RLock()
-	defer ct.mux.RUnlock()
-
-	c, exist := ct.clients[id]
-	if !exist {
-		return nil, errors.Errorf("Cannot get client for id %d, client "+
-			"does not exist", id)
-	}
-
-	return c, nil
-}
-
-// delete an E2e if it exists in the e2eTracker
-func (ct *e2eTracker) delete(id int) {
-	ct.mux.Lock()
-	defer ct.mux.Unlock()
-
-	delete(ct.clients, id)
-}
diff --git a/bindings/fileTransfer.go b/bindings/fileTransfer.go
index 9b8b1da61..b9d3e802b 100644
--- a/bindings/fileTransfer.go
+++ b/bindings/fileTransfer.go
@@ -1,13 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+	"time"
+
 	jww "github.com/spf13/jwalterweatherman"
 	"gitlab.com/elixxir/client/catalog"
 	"gitlab.com/elixxir/client/fileTransfer"
 	ftCrypto "gitlab.com/elixxir/crypto/fileTransfer"
 	"gitlab.com/xx_network/primitives/id"
-	"time"
 )
 
 /* File Transfer Structs and Interfaces */
diff --git a/bindings/fileTransfer_test.go b/bindings/fileTransfer_test.go
index a89967891..10d49d9b8 100644
--- a/bindings/fileTransfer_test.go
+++ b/bindings/fileTransfer_test.go
@@ -1,11 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+	"testing"
+
 	"gitlab.com/elixxir/crypto/fileTransfer"
 	"gitlab.com/xx_network/crypto/csprng"
 	"gitlab.com/xx_network/primitives/id"
-	"testing"
 )
 
 func TestFileTransfer_inputs(t *testing.T) {
diff --git a/bindings/follow.go b/bindings/follow.go
index 34bb4c58e..98eb78467 100644
--- a/bindings/follow.go
+++ b/bindings/follow.go
@@ -1,10 +1,18 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"fmt"
+	"time"
+
 	"github.com/pkg/errors"
 	"gitlab.com/xx_network/primitives/netTime"
-	"time"
 )
 
 // StartNetworkFollower kicks off the tracking of the network. It starts
diff --git a/bindings/identity.go b/bindings/identity.go
index 2718672f5..b17e45d5e 100644
--- a/bindings/identity.go
+++ b/bindings/identity.go
@@ -1,7 +1,15 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+
 	"gitlab.com/elixxir/client/xxdk"
 	"gitlab.com/elixxir/crypto/contact"
 	"gitlab.com/elixxir/primitives/fact"
diff --git a/bindings/identity_test.go b/bindings/identity_test.go
index 1d1e0be0f..662f1f5c0 100644
--- a/bindings/identity_test.go
+++ b/bindings/identity_test.go
@@ -1,7 +1,16 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+	"testing"
+
 	"gitlab.com/elixxir/crypto/cmix"
 	"gitlab.com/elixxir/crypto/cyclic"
 	dh "gitlab.com/elixxir/crypto/diffieHellman"
@@ -9,7 +18,6 @@ import (
 	"gitlab.com/xx_network/crypto/large"
 	"gitlab.com/xx_network/crypto/signature/rsa"
 	"gitlab.com/xx_network/primitives/id"
-	"testing"
 )
 
 func TestIdentity_JSON(t *testing.T) {
diff --git a/bindings/listener.go b/bindings/listener.go
index b284687be..5d4e5608d 100644
--- a/bindings/listener.go
+++ b/bindings/listener.go
@@ -1,7 +1,15 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+
 	jww "github.com/spf13/jwalterweatherman"
 	"gitlab.com/elixxir/client/e2e/receive"
 )
diff --git a/bindings/listener_test.go b/bindings/listener_test.go
index c8fd03ec8..8336dd207 100644
--- a/bindings/listener_test.go
+++ b/bindings/listener_test.go
@@ -1,12 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+	"testing"
+	"time"
+
 	"gitlab.com/elixxir/crypto/e2e"
 	"gitlab.com/xx_network/crypto/csprng"
 	"gitlab.com/xx_network/primitives/id"
-	"testing"
-	"time"
 )
 
 func TestMessage_Json(t *testing.T) {
diff --git a/bindings/utilities.go b/bindings/logging.go
similarity index 76%
rename from bindings/utilities.go
rename to bindings/logging.go
index 7eb109730..5fa5fe0e1 100644
--- a/bindings/utilities.go
+++ b/bindings/logging.go
@@ -1,11 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
+// logging.go contains bindings log control functions
+
 package bindings
 
 import (
 	"fmt"
+	"log"
+
 	"github.com/pkg/errors"
 	jww "github.com/spf13/jwalterweatherman"
 	"google.golang.org/grpc/grpclog"
-	"log"
 )
 
 // sets level of logging. All logs the set level and above will be displayed
diff --git a/bindings/ndf.go b/bindings/ndf.go
index ed72aa1d6..4787544b6 100644
--- a/bindings/ndf.go
+++ b/bindings/ndf.go
@@ -1,3 +1,10 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import "gitlab.com/elixxir/client/xxdk"
diff --git a/bindings/ndf_test.go b/bindings/ndf_test.go
index beb0eac96..c453582b5 100644
--- a/bindings/ndf_test.go
+++ b/bindings/ndf_test.go
@@ -1,12 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"fmt"
+	"strings"
+	"testing"
+
 	"gitlab.com/elixxir/comms/testkeys"
 	"gitlab.com/xx_network/primitives/ndf"
 	"gitlab.com/xx_network/primitives/utils"
-	"strings"
-	"testing"
 )
 
 var testCert = `-----BEGIN CERTIFICATE-----
diff --git a/bindings/restlike.go b/bindings/restlike.go
index 488409808..51201184b 100644
--- a/bindings/restlike.go
+++ b/bindings/restlike.go
@@ -1,13 +1,15 @@
-////////////////////////////////////////////////////////////////////////////////
-// Copyright © 2022 Privategrity Corporation                                   /
-//                                                                             /
-// All rights reserved.                                                        /
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
 
 package bindings
 
 import (
 	"encoding/json"
+
 	"gitlab.com/elixxir/client/e2e"
 	"gitlab.com/elixxir/client/restlike"
 	"gitlab.com/elixxir/client/restlike/connect"
diff --git a/bindings/restlikeSingle.go b/bindings/restlikeSingle.go
index eb7d34bee..f6ddee5fc 100644
--- a/bindings/restlikeSingle.go
+++ b/bindings/restlikeSingle.go
@@ -1,7 +1,15 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+
 	"gitlab.com/elixxir/client/restlike"
 	"gitlab.com/elixxir/client/restlike/single"
 	"gitlab.com/elixxir/crypto/contact"
diff --git a/bindings/secrets.go b/bindings/secrets.go
index f5f23eadd..5bdeeed03 100644
--- a/bindings/secrets.go
+++ b/bindings/secrets.go
@@ -1,3 +1,10 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
diff --git a/bindings/secrets_test.go b/bindings/secrets_test.go
index c2422a319..60b03a2d4 100644
--- a/bindings/secrets_test.go
+++ b/bindings/secrets_test.go
@@ -1,3 +1,10 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
diff --git a/bindings/single.go b/bindings/single.go
index 048edda8a..c54bfeeca 100644
--- a/bindings/single.go
+++ b/bindings/single.go
@@ -1,7 +1,15 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+
 	"gitlab.com/elixxir/client/cmix/identity/receptionID"
 	"gitlab.com/elixxir/client/cmix/rounds"
 	"gitlab.com/elixxir/client/single"
diff --git a/bindings/single_test.go b/bindings/single_test.go
index 807abe161..be543bb7e 100644
--- a/bindings/single_test.go
+++ b/bindings/single_test.go
@@ -1,13 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
 package bindings
 
 import (
 	"encoding/json"
+	"testing"
+	"time"
+
 	"gitlab.com/elixxir/client/cmix/identity/receptionID"
 	"gitlab.com/xx_network/crypto/csprng"
 	"gitlab.com/xx_network/primitives/id"
 	"gitlab.com/xx_network/primitives/id/ephemeral"
-	"testing"
-	"time"
 )
 
 func TestSingleUseJsonMarshals(t *testing.T) {
diff --git a/bindings/version.go b/bindings/version.go
index 4d6a4b2dc..ad7ddc66e 100644
--- a/bindings/version.go
+++ b/bindings/version.go
@@ -1,8 +1,11 @@
-////////////////////////////////////////////////////////////////////////////////
-// Copyright © 2022 Privategrity Corporation                                   /
-//                                                                             /
-// All rights reserved.                                                        /
-////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// Copyright © 2020 xx network SEZC                                          //
+//                                                                           //
+// Use of this source code is governed by a license that can be found in the //
+// LICENSE file                                                              //
+///////////////////////////////////////////////////////////////////////////////
+
+// version.go contains functions to report the client version.
 
 package bindings
 
-- 
GitLab