diff --git a/bindings/autheticatedConnection.go b/bindings/autheticatedConnection.go index 758b8c741972d61dd6616d9e5691db83837df3d9..b0bb6b98a0c6dad32c5ec8504ba49b01f2d6233a 100644 --- a/bindings/autheticatedConnection.go +++ b/bindings/autheticatedConnection.go @@ -24,17 +24,17 @@ func (_ *AuthenticatedConnection) IsAuthenticated() bool { // connection with the server). Once a connect.Connection has been established // with the server and then authenticate their identity to the server. // accepts a marshalled Identity and contact.Contact object -func (c *Client) ConnectWithAuthentication(recipientContact []byte, myIdentity []byte) (*AuthenticatedConnection, error) { +func (c *Cmix) ConnectWithAuthentication(e2eId int, recipientContact []byte) (*AuthenticatedConnection, error) { cont, err := contact.Unmarshal(recipientContact) if err != nil { return nil, err } - myID, rsaPriv, salt, myDHPriv, err := c.unmarshalIdentity(myIdentity) + + e2eClient, err := e2eTrackerSingleton.get(e2eId) if err != nil { return nil, err } - connection, err := connect.ConnectWithAuthentication(cont, myID, salt, rsaPriv, myDHPriv, c.api.GetRng(), - c.api.GetStorage().GetE2EGroup(), c.api.GetCmix(), connect.GetDefaultParams()) + connection, err := connect.ConnectWithAuthentication(cont, e2eClient, connect.GetDefaultParams()) return authenticatedConnectionTrackerSingleton.make(connection), nil } diff --git a/bindings/clientTracker.go b/bindings/clientTracker.go deleted file mode 100644 index 9cea32cb925cccb5b5678bf097842ef74cb419a4..0000000000000000000000000000000000000000 --- a/bindings/clientTracker.go +++ /dev/null @@ -1,54 +0,0 @@ -package bindings - -import ( - "github.com/pkg/errors" - "gitlab.com/elixxir/client/xxdk" - "sync" -) - -// clientTracker is a singleton used to keep track of extant clients, allowing -// for race condition free passing over the bindings - -type clientTracker struct { - clients map[int]*Client - count int - mux sync.RWMutex -} - -// make makes a client from an API client, assigning it a unique ID -func (ct *clientTracker) make(c *xxdk.Cmix) *Client { - ct.mux.Lock() - defer ct.mux.Unlock() - - id := ct.count - ct.count++ - - ct.clients[id] = &Client{ - api: c, - id: id, - } - - return ct.clients[id] -} - -//get returns a client given its ID -func (ct *clientTracker) get(id int) (*Client, 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 -} - -//deletes a client if it exists -func (ct *clientTracker) delete(id int) { - ct.mux.Lock() - defer ct.mux.Unlock() - - delete(ct.clients, id) -} diff --git a/bindings/client.go b/bindings/cmix.go similarity index 71% rename from bindings/client.go rename to bindings/cmix.go index 6b5ff86719361853a8ac0ec7f7e5e8db1b0ea9d6..85b847defc73caad18bbbb02de502cb093b57660 100644 --- a/bindings/client.go +++ b/bindings/cmix.go @@ -7,22 +7,22 @@ import ( "gitlab.com/elixxir/client/xxdk" ) -// sets the log level +// init sets the log level func init() { jww.SetLogThreshold(jww.LevelInfo) jww.SetStdoutThreshold(jww.LevelInfo) } -//client tracker singleton, used to track clients so they can be referenced by -//id back over the bindings -var clientTrackerSingleton = &clientTracker{ - clients: make(map[int]*Client), +// cmixTrackerSingleton is used to track Cmix objects so that +// they can be referenced by id back over the bindings +var cmixTrackerSingleton = &cmixTracker{ + clients: make(map[int]*Cmix), count: 0, } -// Client BindingsClient wraps the xxdk.Cmix, implementing additional functions -// to support the gomobile Client interface -type Client struct { +// Cmix BindingsClient wraps the xxdk.Cmix, implementing additional functions +// to support the gomobile Cmix interface +type Cmix struct { api *xxdk.Cmix id int } @@ -49,16 +49,15 @@ func NewClient(network, storageDir string, password []byte, regCode string) erro // 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) (*Client, error) { - - client, err := xxdk.Login(storageDir, password, xxdk.GetDefaultParams()) +func Login(storageDir string, password []byte) (*Cmix, error) { + client, err := xxdk.LoadCmix(storageDir, password, xxdk.GetDefaultParams()) if err != nil { return nil, errors.New(fmt.Sprintf("Failed to login: %+v", err)) } - return clientTrackerSingleton.make(client), nil + return cmixTrackerSingleton.make(client), nil } -func (c *Client) GetID() int { +func (c *Cmix) GetID() int { return c.id } diff --git a/bindings/cmixTracker.go b/bindings/cmixTracker.go new file mode 100644 index 0000000000000000000000000000000000000000..cb7d215a0613c780cc228998c381efec8b9ad36a --- /dev/null +++ b/bindings/cmixTracker.go @@ -0,0 +1,54 @@ +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 a4ba6f9c785dda71ac582194829690811830fdd1..4740eac0ebd246be64d2139a4d06bb7a9e676667 100644 --- a/bindings/connect.go +++ b/bindings/connect.go @@ -32,19 +32,19 @@ func (c *Connection) GetId() int { // partner.Manager is confirmed. // recipientContact - marshalled contact.Contact object // myIdentity - marshalled Identity object -func (c *Client) Connect(e2eClientId int, recipientContact []byte) ( +func (c *Cmix) Connect(e2eId int, recipientContact []byte) ( *Connection, error) { cont, err := contact.Unmarshal(recipientContact) if err != nil { return nil, err } - myID, _, _, myDHPriv, err := c.unmarshalIdentity(myIdentity) + + e2eClient, err := e2eTrackerSingleton.get(e2eId) if err != nil { return nil, err } - connection, err := connect.Connect(cont, "test", connect.GetDefaultParams()) - + connection, err := connect.Connect(cont, e2eClient, connect.GetDefaultParams()) if err != nil { return nil, err } diff --git a/bindings/contact.go b/bindings/contact.go index 8974044d569ff4ead4786eae15462e81a1bc8749..99a0101c6698c96a4abe231e1c80f956c74f47fa 100644 --- a/bindings/contact.go +++ b/bindings/contact.go @@ -28,10 +28,10 @@ type Identity struct { } // MakeIdentity generates a new cryptographic identity for receiving messages -func (c *Client) MakeIdentity() ([]byte, error) { +func (c *Cmix) MakeIdentity() ([]byte, error) { s := c.api.GetRng().GetStream() defer s.Close() - ident, err := xxdk.MakeIdentity(s, c.api.GetStorage().GetE2EGroup()) + ident, err := xxdk.MakeTransmissionIdentity(s, c.api.GetStorage().GetE2EGroup()) dhPrivJson, err := ident.DHKeyPrivate.MarshalJSON() if err != nil { @@ -49,7 +49,7 @@ func (c *Client) MakeIdentity() ([]byte, error) { } // GetContactFromIdentity accepts a marshalled Identity object and returns a marshalled contact.Contact object -func (c *Client) GetContactFromIdentity(identity []byte) ([]byte, error) { +func (c *Cmix) GetContactFromIdentity(identity []byte) ([]byte, error) { uID, _, _, dhKey, err := c.unmarshalIdentity(identity) if err != nil { return nil, err @@ -69,7 +69,7 @@ func (c *Client) GetContactFromIdentity(identity []byte) ([]byte, error) { return ct.Marshal(), nil } -func (c *Client) unmarshalIdentity(marshaled []byte) (*id.ID, *rsa.PrivateKey, []byte, +func (c *Cmix) unmarshalIdentity(marshaled []byte) (*id.ID, *rsa.PrivateKey, []byte, *cyclic.Int, error) { I := Identity{} err := json.Unmarshal(marshaled, &I) diff --git a/bindings/delivery.go b/bindings/delivery.go index 57fcbfa4d34ede1307cb628691ca5fde4210bd47..9146e838f4381661385e4769b20a95ff4f74320b 100644 --- a/bindings/delivery.go +++ b/bindings/delivery.go @@ -65,7 +65,7 @@ type MessageDeliveryCallback interface { // This function takes the marshaled send report to ensure a memory leak does // not occur as a result of both sides of the bindings holding a reference to // the same pointer. -func (c *Client) WaitForMessageDelivery(roundList []byte, +func (c *Cmix) WaitForMessageDelivery(roundList []byte, mdc MessageDeliveryCallback, timeoutMS int) error { jww.INFO.Printf("WaitForMessageDelivery(%v, _, %v)", roundList, timeoutMS) diff --git a/bindings/e2e.go b/bindings/e2e.go new file mode 100644 index 0000000000000000000000000000000000000000..95ca1960a50a90107d613cae49566681b0a3e1d3 --- /dev/null +++ b/bindings/e2e.go @@ -0,0 +1,23 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright © 2022 Privategrity Corporation / +// / +// All rights reserved. / +//////////////////////////////////////////////////////////////////////////////// + +package bindings + +import "gitlab.com/elixxir/client/xxdk" + +// e2eTrackerSingleton is used to track E2e objects so that +// they can be referenced by id back over the bindings +var e2eTrackerSingleton = &e2eTracker{ + clients: make(map[int]*E2e), + count: 0, +} + +// E2e BindingsClient wraps the xxdk.E2e, implementing additional functions +// to support the gomobile E2e interface +type E2e struct { + api *xxdk.E2e + id int +} diff --git a/bindings/e2eTracker.go b/bindings/e2eTracker.go new file mode 100644 index 0000000000000000000000000000000000000000..d42ba27ccd9d8d1f004c8035f0cb89130fbb174b --- /dev/null +++ b/bindings/e2eTracker.go @@ -0,0 +1,60 @@ +//////////////////////////////////////////////////////////////////////////////// +// 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 { + 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/follow.go b/bindings/follow.go index ae81595b23ed0bbb627f6e112b86c5af47903919..34bb4c58eabffb120a2fc1dbad6cfc57b51324d5 100644 --- a/bindings/follow.go +++ b/bindings/follow.go @@ -35,7 +35,7 @@ import ( // Responds to sent rekeys and executes them // - KeyExchange Confirm (/keyExchange/confirm.go) // Responds to confirmations of successful rekey operations -func (c *Client) StartNetworkFollower(timeoutMS int) error { +func (c *Cmix) StartNetworkFollower(timeoutMS int) error { timeout := time.Duration(timeoutMS) * time.Millisecond return c.api.StartNetworkFollower(timeout) } @@ -45,7 +45,7 @@ func (c *Client) StartNetworkFollower(timeoutMS int) error { // fails to stop it. // if the network follower is running and this fails, the client object will // most likely be in an unrecoverable state and need to be trashed. -func (c *Client) StopNetworkFollower() error { +func (c *Cmix) StopNetworkFollower() error { if err := c.api.StopNetworkFollower(); err != nil { return errors.New(fmt.Sprintf("Failed to stop the "+ "network follower: %+v", err)) @@ -55,7 +55,7 @@ func (c *Client) StopNetworkFollower() error { // WaitForNewtwork will block until either the network is healthy or the // passed timeout. It will return true if the network is healthy -func (c *Client) WaitForNetwork(timeoutMS int) bool { +func (c *Cmix) WaitForNetwork(timeoutMS int) bool { start := netTime.Now() timeout := time.Duration(timeoutMS) * time.Millisecond for netTime.Since(start) < timeout { @@ -72,7 +72,7 @@ func (c *Client) WaitForNetwork(timeoutMS int) bool { // Starting - 1000 // Running - 2000 // Stopping - 3000 -func (c *Client) NetworkFollowerStatus() int { +func (c *Cmix) NetworkFollowerStatus() int { return int(c.api.NetworkFollowerStatus()) } @@ -82,13 +82,13 @@ func (c *Client) NetworkFollowerStatus() int { // Due to the handling of comms on iOS, where the OS can // block indefiently, it may not enter the stopped // state apropreatly. This can be used instead. -func (c *Client) HasRunningProcessies() bool { +func (c *Cmix) HasRunningProcessies() bool { return c.api.HasRunningProcessies() } // IsNetworkHealthy returns true if the network is read to be in a healthy state where // messages can be sent -func (c *Client) IsNetworkHealthy() bool { +func (c *Cmix) IsNetworkHealthy() bool { return c.api.GetCmix().IsHealthy() } @@ -101,11 +101,11 @@ type NetworkHealthCallback interface { // RegisterNetworkHealthCB registers the network health callback to be called // any time the network health changes. Returns a unique ID that can be used to // unregister the network health callback. -func (c *Client) RegisterNetworkHealthCB(nhc NetworkHealthCallback) int64 { +func (c *Cmix) RegisterNetworkHealthCB(nhc NetworkHealthCallback) int64 { return int64(c.api.GetCmix().AddHealthCallback(nhc.Callback)) } -func (c *Client) UnregisterNetworkHealthCB(funcID int64) { +func (c *Cmix) UnregisterNetworkHealthCB(funcID int64) { c.api.GetCmix().RemoveHealthCallback(uint64(funcID)) } @@ -115,7 +115,7 @@ type ClientError interface { // RegisterClientErrorCallback registers the callback to handle errors from the // long running threads controlled by StartNetworkFollower and StopNetworkFollower -func (c *Client) RegisterClientErrorCallback(clientError ClientError) { +func (c *Cmix) RegisterClientErrorCallback(clientError ClientError) { errChan := c.api.GetErrorsChannel() go func() { for report := range errChan { diff --git a/bindings/restlike.go b/bindings/restlike.go index 7d7e649310d47d8fb4b28f7091569b195e131b83..c6c31c7ae744e644747a8da6018471fd03b8680e 100644 --- a/bindings/restlike.go +++ b/bindings/restlike.go @@ -34,7 +34,7 @@ type RestlikeMessage struct { // request - marshalled RestlikeMessage // Returns marshalled result RestlikeMessage func RestlikeRequest(clientID int, connectionID int, request []byte) ([]byte, error) { - cl, err := clientTrackerSingleton.get(clientID) + cl, err := cmixTrackerSingleton.get(clientID) if err != nil { return nil, err } @@ -78,7 +78,7 @@ func RestlikeRequest(clientID int, connectionID int, request []byte) ([]byte, er // request - marshalled RestlikeMessage // Returns marshalled result RestlikeMessage func RestlikeRequestAuth(clientID int, authConnectionID int, request []byte) ([]byte, error) { - cl, err := clientTrackerSingleton.get(clientID) + cl, err := cmixTrackerSingleton.get(clientID) if err != nil { return nil, err } diff --git a/cmd/root.go b/cmd/root.go index 3367a837a4cda5ada84479e01c7cdbcfbacda4eb..b833b674ce43c7f12540a05c3eab59669782eea7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,7 +27,7 @@ import ( "gitlab.com/elixxir/client/backup" "gitlab.com/elixxir/client/e2e" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/cmix" @@ -36,7 +36,6 @@ import ( "github.com/spf13/cobra" jww "github.com/spf13/jwalterweatherman" "github.com/spf13/viper" - "gitlab.com/elixxir/client/xxdk" backupCrypto "gitlab.com/elixxir/crypto/backup" "gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/primitives/excludedRounds" @@ -559,7 +558,7 @@ func createClient() *xxdk.Cmix { } // Construct client from backup data - backupIdList, _, err := e2eApi.NewClientFromBackup(string(ndfJSON), storeDir, + backupIdList, _, err := xxdk.NewClientFromBackup(string(ndfJSON), storeDir, pass, backupPass, backupFile) if err != nil { jww.FATAL.Panicf("%+v", err) @@ -593,7 +592,7 @@ func createClient() *xxdk.Cmix { params := initParams() - client, err := xxdk.OpenClient(storeDir, pass, params) + client, err := xxdk.OpenCmix(storeDir, pass, params) if err != nil { jww.FATAL.Panicf("%+v", err) } @@ -621,7 +620,7 @@ func initParams() xxdk.Params { return p } -func initClient() *e2eApi.E2e { +func initClient() *xxdk.E2e { createClient() pass := parsePassword(viper.GetString("password")) @@ -631,7 +630,7 @@ func initClient() *e2eApi.E2e { params := initParams() // load the client - baseclient, err := xxdk.Login(storeDir, pass, params) + baseclient, err := xxdk.LoadCmix(storeDir, pass, params) if err != nil { jww.FATAL.Panicf("%+v", err) @@ -640,7 +639,7 @@ func initClient() *e2eApi.E2e { authCbs = makeAuthCallbacks(nil, viper.GetBool("unsafe-channel-creation")) - client, err := e2eApi.LoginLegacy(baseclient, authCbs) + client, err := xxdk.LoginLegacy(baseclient, authCbs) if err != nil { jww.FATAL.Panicf("%+v", err) } @@ -707,7 +706,7 @@ func initClient() *e2eApi.E2e { return client } -func acceptChannel(client *e2eApi.E2e, recipientID *id.ID) { +func acceptChannel(client *xxdk.E2e, recipientID *id.ID) { recipientContact, err := client.GetAuth().GetReceivedRequest( recipientID) if err != nil { @@ -720,14 +719,14 @@ func acceptChannel(client *e2eApi.E2e, recipientID *id.ID) { } } -func deleteChannel(client *e2eApi.E2e, partnerId *id.ID) { +func deleteChannel(client *xxdk.E2e, partnerId *id.ID) { err := client.DeleteContact(partnerId) if err != nil { jww.FATAL.Panicf("%+v", err) } } -func addAuthenticatedChannel(client *e2eApi.E2e, recipientID *id.ID, +func addAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID, recipient contact.Contact) { var allowed bool if viper.GetBool("unsafe-channel-creation") { @@ -764,7 +763,7 @@ func addAuthenticatedChannel(client *e2eApi.E2e, recipientID *id.ID, } } -func resetAuthenticatedChannel(client *e2eApi.E2e, recipientID *id.ID, +func resetAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID, recipient contact.Contact) { var allowed bool if viper.GetBool("unsafe-channel-creation") { diff --git a/xxdk/client.go b/xxdk/cmix.go similarity index 97% rename from xxdk/client.go rename to xxdk/cmix.go index 98e483c89ef19c34e82e1206e281dae35283255d..84c1d08201e9d8eb71336eb8222a0bd3275e3e6a 100644 --- a/xxdk/client.go +++ b/xxdk/cmix.go @@ -120,10 +120,10 @@ func NewVanityClient(ndfJSON, storageDir string, password []byte, return nil } -// OpenClient session, but don't connect to the network or log in -func OpenClient(storageDir string, password []byte, +// OpenCmix session, but don't connect to the network or log in +func OpenCmix(storageDir string, password []byte, parameters Params) (*Cmix, error) { - jww.INFO.Printf("OpenClient()") + jww.INFO.Printf("OpenCmix()") rngStreamGen := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG) @@ -210,11 +210,11 @@ func NewProtoClient_Unsafe(ndfJSON, storageDir string, password, return nil } -// Login initializes a client object from existing storage. -func Login(storageDir string, password []byte, parameters Params) (*Cmix, error) { +// LoadCmix initializes a Cmix object from existing storage +func LoadCmix(storageDir string, password []byte, parameters Params) (*Cmix, error) { jww.INFO.Printf("Login()") - c, err := OpenClient(storageDir, password, parameters) + c, err := OpenCmix(storageDir, password, parameters) if err != nil { return nil, err } @@ -277,7 +277,7 @@ func LoginWithNewBaseNDF_UNSAFE(storageDir string, password []byte, return nil, err } - c, err := OpenClient(storageDir, password, params) + c, err := OpenCmix(storageDir, password, params) if err != nil { return nil, err } @@ -328,7 +328,7 @@ func LoginWithProtoClient(storageDir string, password []byte, return nil, err } - c, err := OpenClient(storageDir, password, params) + c, err := OpenCmix(storageDir, password, params) if err != nil { return nil, err } diff --git a/xxdk/e2e.go b/xxdk/e2e.go index 5e33d6258f5f13dfda1c258cf4ec4ec79c0e6e89..efe2a01d9465638351017a2ad49b4db94d3e8d9a 100644 --- a/xxdk/e2e.go +++ b/xxdk/e2e.go @@ -32,21 +32,21 @@ type E2e struct { e2eIdentity TransmissionIdentity } -// Login creates a new e2eApi.E2e backed by the xxdk.Cmix persistent versioned.KV +// Login creates a new E2e backed by the xxdk.Cmix persistent versioned.KV // If identity == nil, a new TransmissionIdentity will be generated automagically func Login(client *Cmix, callbacks auth.Callbacks, identity *TransmissionIdentity) (m *E2e, err error) { return login(client, callbacks, identity, client.GetStorage().GetKV()) } -// LoginEphemeral creates a new e2eApi.E2e backed by a totally ephemeral versioned.KV +// LoginEphemeral creates a new E2e backed by a totally ephemeral versioned.KV // If identity == nil, a new TransmissionIdentity will be generated automagically func LoginEphemeral(client *Cmix, callbacks auth.Callbacks, identity *TransmissionIdentity) (m *E2e, err error) { return login(client, callbacks, identity, versioned.NewKV(ekv.MakeMemstore())) } -// LoginLegacy creates a new e2eApi.E2e backed by the xxdk.Cmix persistent versioned.KV +// LoginLegacy creates a new E2e backed by the xxdk.Cmix persistent versioned.KV // Uses the pre-generated transmission ID used by xxdk.Cmix // This function is designed to maintain backwards compatibility with previous xx messenger designs // and should not be used for other purposes diff --git a/xxdk/utils_test.go b/xxdk/utils_test.go index ca9f5d35d38f2edfe7814aa445764b4ad89604d7..2f6afc7196c3f2e554482ab848f290a83084ec7c 100644 --- a/xxdk/utils_test.go +++ b/xxdk/utils_test.go @@ -45,7 +45,7 @@ func newTestingClient(face interface{}) (*Cmix, error) { "Could not construct a mock client: %v", err) } - c, err := OpenClient(storageDir, password, GetDefaultParams()) + c, err := OpenCmix(storageDir, password, GetDefaultParams()) if err != nil { return nil, errors.Errorf("Could not open a mock client: %v", err)