Skip to content
Snippets Groups Projects
Commit 7319ce2b authored by Jake Taylor's avatar Jake Taylor
Browse files

fix some syntax

parent 4215fa46
No related branches found
No related tags found
2 merge requests!510Release,!238Hotfix/e2e client
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
package backup package backup
import ( import (
"gitlab.com/elixxir/client/xxdk"
"sync" "sync"
"time" "time"
"gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/client/xxdk/e2eApi"
"gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/primitives/fact" "gitlab.com/elixxir/primitives/fact"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
...@@ -41,7 +41,7 @@ type Backup struct { ...@@ -41,7 +41,7 @@ type Backup struct {
// Callback that is called with the encrypted backup when triggered // Callback that is called with the encrypted backup when triggered
updateBackupCb UpdateBackupFn updateBackupCb UpdateBackupFn
container *e2eApi.Container container *xxdk.Container
jsonParams string jsonParams string
...@@ -91,7 +91,7 @@ type UpdateBackupFn func(encryptedBackup []byte) ...@@ -91,7 +91,7 @@ type UpdateBackupFn func(encryptedBackup []byte)
// Call this to turn on backups for the first time or to replace the user's // Call this to turn on backups for the first time or to replace the user's
// password. // password.
func InitializeBackup(password string, updateBackupCb UpdateBackupFn, func InitializeBackup(password string, updateBackupCb UpdateBackupFn,
container *e2eApi.Container, e2e E2e, session Session, ud UserDiscovery, container *xxdk.Container, e2e E2e, session Session, ud UserDiscovery,
kv *versioned.KV, rng *fastRNG.StreamGenerator) (*Backup, error) { kv *versioned.KV, rng *fastRNG.StreamGenerator) (*Backup, error) {
b := &Backup{ b := &Backup{
updateBackupCb: updateBackupCb, updateBackupCb: updateBackupCb,
...@@ -135,7 +135,7 @@ func InitializeBackup(password string, updateBackupCb UpdateBackupFn, ...@@ -135,7 +135,7 @@ func InitializeBackup(password string, updateBackupCb UpdateBackupFn,
// ResumeBackup resumes a backup by restoring the Backup object and registering // ResumeBackup resumes a backup by restoring the Backup object and registering
// a new callback. Call this to resume backups that have already been // a new callback. Call this to resume backups that have already been
// initialized. Returns an error if backups have not already been initialized. // initialized. Returns an error if backups have not already been initialized.
func ResumeBackup(updateBackupCb UpdateBackupFn, container *e2eApi.Container, func ResumeBackup(updateBackupCb UpdateBackupFn, container *xxdk.Container,
e2e E2e, session Session, ud UserDiscovery, kv *versioned.KV, e2e E2e, session Session, ud UserDiscovery, kv *versioned.KV,
rng *fastRNG.StreamGenerator) (*Backup, error) { rng *fastRNG.StreamGenerator) (*Backup, error) {
_, _, _, err := loadBackup(kv) _, _, _, err := loadBackup(kv)
......
...@@ -10,7 +10,7 @@ package cmd ...@@ -10,7 +10,7 @@ package cmd
import ( import (
"fmt" "fmt"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/catalog"
...@@ -25,10 +25,10 @@ import ( ...@@ -25,10 +25,10 @@ import (
type authCallbacks struct { type authCallbacks struct {
autoConfirm bool autoConfirm bool
confCh chan *id.ID confCh chan *id.ID
client *e2eApi.E2e client *xxdk.E2e
} }
func makeAuthCallbacks(client *e2eApi.E2e, autoConfirm bool) *authCallbacks { func makeAuthCallbacks(client *xxdk.E2e, autoConfirm bool) *authCallbacks {
return &authCallbacks{ return &authCallbacks{
autoConfirm: autoConfirm, autoConfirm: autoConfirm,
confCh: make(chan *id.ID, 10), confCh: make(chan *id.ID, 10),
...@@ -71,7 +71,7 @@ func (a *authCallbacks) Reset(requestor contact.Contact, ...@@ -71,7 +71,7 @@ func (a *authCallbacks) Reset(requestor contact.Contact,
fmt.Printf(msg) fmt.Printf(msg)
} }
func registerMessageListener(client *e2eApi.E2e) chan receive.Message { func registerMessageListener(client *xxdk.E2e) chan receive.Message {
recvCh := make(chan receive.Message, 10000) recvCh := make(chan receive.Message, 10000)
listenerID := client.GetE2E().RegisterChannel("DefaultCLIReceiver", listenerID := client.GetE2E().RegisterChannel("DefaultCLIReceiver",
receive.AnyUser(), catalog.NoType, recvCh) receive.AnyUser(), catalog.NoType, recvCh)
......
...@@ -9,7 +9,7 @@ package cmd ...@@ -9,7 +9,7 @@ package cmd
import ( import (
"fmt" "fmt"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
"io/ioutil" "io/ioutil"
"time" "time"
...@@ -132,7 +132,7 @@ type receivedFtResults struct { ...@@ -132,7 +132,7 @@ type receivedFtResults struct {
// initFileTransferManager creates a new file transfer manager with a new // initFileTransferManager creates a new file transfer manager with a new
// reception callback. Returns the file transfer manager and the channel that // reception callback. Returns the file transfer manager and the channel that
// will be triggered when the callback is called. // will be triggered when the callback is called.
func initFileTransferManager(client *e2eApi.E2e, maxThroughput int) ( func initFileTransferManager(client *xxdk.E2e, maxThroughput int) (
*ftE2e.Wrapper, chan receivedFtResults) { *ftE2e.Wrapper, chan receivedFtResults) {
// Create interfaces.ReceiveCallback that returns the results on a channel // Create interfaces.ReceiveCallback that returns the results on a channel
......
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
"fmt" "fmt"
"gitlab.com/elixxir/client/cmix/identity/receptionID" "gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/rounds" "gitlab.com/elixxir/client/cmix/rounds"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
"gitlab.com/elixxir/primitives/format" "gitlab.com/elixxir/primitives/format"
"os" "os"
"time" "time"
...@@ -115,7 +115,7 @@ var groupCmd = &cobra.Command{ ...@@ -115,7 +115,7 @@ var groupCmd = &cobra.Command{
// initGroupManager creates a new group chat manager and starts the process // initGroupManager creates a new group chat manager and starts the process
// service. // service.
func initGroupManager(client *e2eApi.E2e) (groupChat.GroupChat, func initGroupManager(client *xxdk.E2e) (groupChat.GroupChat,
chan groupChat.MessageReceive, chan groupStore.Group) { chan groupChat.MessageReceive, chan groupStore.Group) {
recChan := make(chan groupChat.MessageReceive, 10) recChan := make(chan groupChat.MessageReceive, 10)
......
...@@ -10,11 +10,11 @@ package cmd ...@@ -10,11 +10,11 @@ package cmd
import ( import (
"fmt" "fmt"
"gitlab.com/elixxir/client/xxdk"
"github.com/spf13/cobra" "github.com/spf13/cobra"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper" "github.com/spf13/viper"
"gitlab.com/elixxir/client/xxdk/e2eApi"
) )
// initCmd creates a new user object with the given NDF // initCmd creates a new user object with the given NDF
...@@ -24,7 +24,7 @@ var initCmd = &cobra.Command{ ...@@ -24,7 +24,7 @@ var initCmd = &cobra.Command{
Args: cobra.NoArgs, Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
client := createClient() client := createClient()
e2e, err := e2eApi.LoadOrInitE2e(client) e2e, err := xxdk.LoadOrInitE2e(client)
if err != nil { if err != nil {
jww.FATAL.Panicf("%+v", err) jww.FATAL.Panicf("%+v", err)
} }
......
...@@ -11,7 +11,7 @@ package cmd ...@@ -11,7 +11,7 @@ package cmd
import ( import (
"encoding/binary" "encoding/binary"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
"strconv" "strconv"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
...@@ -67,7 +67,7 @@ func getPrecanID(recipientID *id.ID) uint { ...@@ -67,7 +67,7 @@ func getPrecanID(recipientID *id.ID) uint {
return uint(recipientID.Bytes()[7]) return uint(recipientID.Bytes()[7])
} }
func addPrecanAuthenticatedChannel(client *e2eApi.E2e, recipientID *id.ID, func addPrecanAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID,
recipient contact.Contact) { recipient contact.Contact) {
jww.WARN.Printf("Precanned user id detected: %s", recipientID) jww.WARN.Printf("Precanned user id detected: %s", recipientID)
preUsr, err := client.MakePrecannedAuthenticatedChannel( preUsr, err := client.MakePrecannedAuthenticatedChannel(
......
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
"gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/catalog"
"gitlab.com/elixxir/client/cmix" "gitlab.com/elixxir/client/cmix"
clientE2e "gitlab.com/elixxir/client/e2e" clientE2e "gitlab.com/elixxir/client/e2e"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
"gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/crypto/fastRNG"
...@@ -52,7 +52,7 @@ type AuthenticatedCallback func(connection AuthenticatedConnection) ...@@ -52,7 +52,7 @@ type AuthenticatedCallback func(connection AuthenticatedConnection)
// ConnectWithAuthentication is called by the client, ie the one establishing // ConnectWithAuthentication is called by the client, ie the one establishing
// connection with the server. Once a connect.Connection has been established // connection with the server. Once a connect.Connection has been established
// with the server and then authenticate their identity to the server. // with the server and then authenticate their identity to the server.
func ConnectWithAuthentication(recipient contact.Contact, e2eClient *e2eApi.E2e, func ConnectWithAuthentication(recipient contact.Contact, e2eClient *xxdk.E2e,
p Params) (AuthenticatedConnection, error) { p Params) (AuthenticatedConnection, error) {
// Track the time since we started to attempt to establish a connection // Track the time since we started to attempt to establish a connection
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
"encoding/json" "encoding/json"
"gitlab.com/elixxir/client/cmix" "gitlab.com/elixxir/client/cmix"
"gitlab.com/elixxir/client/storage/versioned" "gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
"gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/crypto/fastRNG"
"gitlab.com/elixxir/ekv" "gitlab.com/elixxir/ekv"
...@@ -119,7 +119,7 @@ func GetParameters(params string) (Params, error) { ...@@ -119,7 +119,7 @@ func GetParameters(params string) (Params, error) {
// and returns a Connection object for the newly-created partner.Manager // and returns a Connection object for the newly-created partner.Manager
// This function is to be used sender-side and will block until the // This function is to be used sender-side and will block until the
// partner.Manager is confirmed. // partner.Manager is confirmed.
func Connect(recipient contact.Contact, e2eClient *e2eApi.E2e, func Connect(recipient contact.Contact, e2eClient *xxdk.E2e,
p Params) (Connection, error) { p Params) (Connection, error) {
// Build callback for E2E negotiation // Build callback for E2E negotiation
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"gitlab.com/elixxir/client/single" "gitlab.com/elixxir/client/single"
"gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/client/xxdk"
"gitlab.com/xx_network/primitives/netTime" "gitlab.com/xx_network/primitives/netTime"
"math" "math"
"strings" "strings"
...@@ -37,7 +37,7 @@ import ( ...@@ -37,7 +37,7 @@ import (
// xxDK users should not use this function. This function is used by // xxDK users should not use this function. This function is used by
// the mobile phone apps and are not intended to be part of the xxDK. It // the mobile phone apps and are not intended to be part of the xxDK. It
// should be treated as internal functions specific to the phone apps. // should be treated as internal functions specific to the phone apps.
func RestoreContactsFromBackup(backupPartnerIDs []byte, client *e2eApi.E2e, func RestoreContactsFromBackup(backupPartnerIDs []byte, client *xxdk.E2e,
udManager *ud.Manager, udManager *ud.Manager,
updatesCb interfaces.RestoreContactsUpdater) ([]*id.ID, []*id.ID, updatesCb interfaces.RestoreContactsUpdater) ([]*id.ID, []*id.ID,
[]error, error) { []error, error) {
...@@ -178,7 +178,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, client *e2eApi.E2e, ...@@ -178,7 +178,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, client *e2eApi.E2e,
// the mobile phone apps and are not intended to be part of the xxDK. It // the mobile phone apps and are not intended to be part of the xxDK. It
// should be treated as internal functions specific to the phone apps. // should be treated as internal functions specific to the phone apps.
func LookupContacts(in chan *id.ID, out chan *contact.Contact, func LookupContacts(in chan *id.ID, out chan *contact.Contact,
failCh chan failure, client *e2eApi.E2e, udContact contact.Contact, failCh chan failure, client *xxdk.E2e, udContact contact.Contact,
wg *sync.WaitGroup) { wg *sync.WaitGroup) {
defer wg.Done() defer wg.Done()
// Start looking up contacts with user discovery and feed this // Start looking up contacts with user discovery and feed this
...@@ -205,7 +205,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact, ...@@ -205,7 +205,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact,
// the mobile phone apps and are not intended to be part of the xxDK. It // the mobile phone apps and are not intended to be part of the xxDK. It
// should be treated as internal functions specific to the phone apps. // should be treated as internal functions specific to the phone apps.
func ResetSessions(in, out chan *contact.Contact, failCh chan failure, func ResetSessions(in, out chan *contact.Contact, failCh chan failure,
client *e2eApi.E2e, wg *sync.WaitGroup) { client *xxdk.E2e, wg *sync.WaitGroup) {
defer wg.Done() defer wg.Done()
for c := range in { for c := range in {
_, err := client.GetAuth().Reset(*c) _, err := client.GetAuth().Reset(*c)
...@@ -224,7 +224,7 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure, ...@@ -224,7 +224,7 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure,
// xxDK users should not use this function. This function is used by // xxDK users should not use this function. This function is used by
// the mobile phone apps and are not intended to be part of the xxDK. It // the mobile phone apps and are not intended to be part of the xxDK. It
// should be treated as internal functions specific to the phone apps. // should be treated as internal functions specific to the phone apps.
func LookupContact(userID *id.ID, client *e2eApi.E2e, udContact contact.Contact) ( func LookupContact(userID *id.ID, client *xxdk.E2e, udContact contact.Contact) (
*contact.Contact, error) { *contact.Contact, error) {
// This is a little wonky, but wait until we get called then // This is a little wonky, but wait until we get called then
// set the result to the contact objects details if there is // set the result to the contact objects details if there is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment