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
3d720305
Commit
3d720305
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Plain Diff
Merge branch 'release' of git.xx.network:elixxir/client into hotfix/BindingsUpdates
parents
fe1015a3
6f0a6c04
No related branches found
No related tags found
2 merge requests
!510
Release
,
!315
Hotfix/bindings updates
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/follow.go
+24
-8
24 additions, 8 deletions
bindings/follow.go
bindings/ud.go
+12
-8
12 additions, 8 deletions
bindings/ud.go
with
36 additions
and
16 deletions
bindings/follow.go
+
24
−
8
View file @
3d720305
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
package
bindings
package
bindings
import
(
import
(
"encoding/json"
"fmt"
"fmt"
"time"
"time"
...
@@ -92,17 +93,32 @@ func (c *Cmix) NetworkFollowerStatus() int {
...
@@ -92,17 +93,32 @@ func (c *Cmix) NetworkFollowerStatus() int {
return
int
(
c
.
api
.
NetworkFollowerStatus
())
return
int
(
c
.
api
.
NetworkFollowerStatus
())
}
}
// NodeRegistrationReport is the report structure which
// Cmix.GetNodeRegistrationStatus returns JSON marshalled.
type
NodeRegistrationReport
struct
{
NumberOfNodesRegistered
int
NumberOfNodes
int
}
// GetNodeRegistrationStatus returns the current state of node registration.
// GetNodeRegistrationStatus returns the current state of node registration.
//
//
// Returns:
// Returns:
// - []int - The 0th element represents the number of nodes with which the user is registered.
// - []bye - A marshalled NodeRegistrationReport containing the number of
// The 1st element represents the number of nodes present in the NDF.
// nodes the user is registered with and the number of nodes present in the NDF.
// - An error will most likely occur if the network is unhealthy.
// - An error if it cannot get the node registration status. The most likely cause
func
(
c
*
Cmix
)
GetNodeRegistrationStatus
()
([]
int
,
error
)
{
// is that the network is unhealthy.
results
:=
make
([]
int
,
2
)
func
(
c
*
Cmix
)
GetNodeRegistrationStatus
()
([]
byte
,
error
)
{
var
err
error
numNodesRegistered
,
numNodes
,
err
:=
c
.
api
.
GetNodeRegistrationStatus
()
results
[
0
],
results
[
1
],
err
=
c
.
api
.
GetNodeRegistrationStatus
()
if
err
!=
nil
{
return
results
,
err
return
nil
,
err
}
nodeRegReport
:=
NodeRegistrationReport
{
NumberOfNodesRegistered
:
numNodesRegistered
,
NumberOfNodes
:
numNodes
,
}
return
json
.
Marshal
(
nodeRegReport
)
}
}
// HasRunningProcessies checks if any background threads are running and returns
// HasRunningProcessies checks if any background threads are running and returns
...
...
This diff is collapsed.
Click to expand it.
bindings/ud.go
+
12
−
8
View file @
3d720305
...
@@ -144,8 +144,8 @@ func LoadOrNewUserDiscovery(e2eID int, follower UdNetworkStatus,
...
@@ -144,8 +144,8 @@ func LoadOrNewUserDiscovery(e2eID int, follower UdNetworkStatus,
// Parameters:
// Parameters:
// - e2eID - e2e object ID in the tracker
// - e2eID - e2e object ID in the tracker
// - follower - network follower func wrapped in UdNetworkStatus
// - follower - network follower func wrapped in UdNetworkStatus
// - emailFactJson -
a
JSON marshalled email fact.Fact
// - emailFactJson -
nullable
JSON marshalled email fact.Fact
// - phoneFactJson -
a
JSON marshalled phone fact.Fact
// - phoneFactJson -
nullable
JSON marshalled phone fact.Fact
func
NewUdManagerFromBackup
(
e2eID
int
,
follower
UdNetworkStatus
,
emailFactJson
,
func
NewUdManagerFromBackup
(
e2eID
int
,
follower
UdNetworkStatus
,
emailFactJson
,
phoneFactJson
[]
byte
)
(
*
UserDiscovery
,
error
)
{
phoneFactJson
[]
byte
)
(
*
UserDiscovery
,
error
)
{
...
@@ -156,14 +156,18 @@ func NewUdManagerFromBackup(e2eID int, follower UdNetworkStatus, emailFactJson,
...
@@ -156,14 +156,18 @@ func NewUdManagerFromBackup(e2eID int, follower UdNetworkStatus, emailFactJson,
}
}
var
email
,
phone
fact
.
Fact
var
email
,
phone
fact
.
Fact
err
=
json
.
Unmarshal
(
emailFactJson
,
&
email
)
if
emailFactJson
!=
nil
{
if
err
!=
nil
{
err
=
json
.
Unmarshal
(
emailFactJson
,
&
email
)
return
nil
,
err
if
err
!=
nil
{
return
nil
,
err
}
}
}
err
=
json
.
Unmarshal
(
phoneFactJson
,
&
phone
)
if
phoneFactJson
!=
nil
{
if
err
!=
nil
{
err
=
json
.
Unmarshal
(
phoneFactJson
,
&
phone
)
return
nil
,
err
if
err
!=
nil
{
return
nil
,
err
}
}
}
UdNetworkStatusFn
:=
func
()
xxdk
.
Status
{
UdNetworkStatusFn
:=
func
()
xxdk
.
Status
{
...
...
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