Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
726a1419
Commit
726a1419
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Have ud.Search/Lookup take in udE2e
parent
e6a4f347
No related branches found
No related tags found
2 merge requests
!510
Release
,
!289
Have ud.Search/Lookup take in udE2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ud/lookup.go
+7
-2
7 additions, 2 deletions
ud/lookup.go
ud/search.go
+10
-3
10 additions, 3 deletions
ud/search.go
with
17 additions
and
5 deletions
ud/lookup.go
+
7
−
2
View file @
726a1419
...
...
@@ -22,12 +22,17 @@ type lookupCallback func(contact.Contact, error)
// Lookup returns the public key of the passed ID as known by the user discovery
// system or returns by the timeout.
func
Lookup
(
net
udCmix
,
rng
csprng
.
Source
,
grp
*
cyclic
.
Group
,
func
Lookup
(
messenger
udE2e
,
udContact
contact
.
Contact
,
callback
lookupCallback
,
uid
*
id
.
ID
,
p
single
.
RequestParams
)
([]
id
.
Round
,
receptionID
.
EphemeralIdentity
,
error
)
{
// Extract information from messenger
net
:=
messenger
.
GetCmix
()
grp
:=
messenger
.
GetE2E
()
.
GetGroup
()
rng
:=
messenger
.
GetRng
()
.
GetStream
()
defer
rng
.
Close
()
jww
.
INFO
.
Printf
(
"ud.Lookup(%s, %s)"
,
uid
,
p
.
Timeout
)
return
lookup
(
net
,
rng
,
uid
,
grp
,
udContact
,
callback
,
p
)
}
...
...
This diff is collapsed.
Click to expand it.
ud/search.go
+
10
−
3
View file @
726a1419
...
...
@@ -13,7 +13,6 @@ import (
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/factID"
"gitlab.com/elixxir/primitives/fact"
"gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/primitives/id"
)
...
...
@@ -28,8 +27,7 @@ type searchCallback func([]contact.Contact, error)
// used to search for multiple users at once; that can have a privacy reduction.
// Instead, it is intended to be used to search for a user where multiple pieces
// of information is known.
func
Search
(
net
udCmix
,
events
event
.
Reporter
,
rng
csprng
.
Source
,
grp
*
cyclic
.
Group
,
func
Search
(
messenger
udE2e
,
udContact
contact
.
Contact
,
callback
searchCallback
,
list
fact
.
FactList
,
params
single
.
RequestParams
)
([]
id
.
Round
,
...
...
@@ -46,6 +44,14 @@ func Search(net udCmix, events event.Reporter,
errors
.
WithMessage
(
err
,
"Failed to form outgoing search request."
)
}
// Extract information from messenger
net
:=
messenger
.
GetCmix
()
events
:=
messenger
.
GetEventReporter
()
grp
:=
messenger
.
GetE2E
()
.
GetGroup
()
rng
:=
messenger
.
GetRng
()
.
GetStream
()
defer
rng
.
Close
()
// Build response handler
response
:=
searchResponse
{
cb
:
callback
,
services
:
net
,
...
...
@@ -54,6 +60,7 @@ func Search(net udCmix, events event.Reporter,
factMap
:
factMap
,
}
// Send message
rndId
,
ephId
,
err
:=
single
.
TransmitRequest
(
udContact
,
SearchTag
,
requestMarshaled
,
response
,
params
,
net
,
rng
,
grp
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment