Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
comms
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
comms
Commits
7d7f1e09
Commit
7d7f1e09
authored
Mar 2, 2020
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
added the ability to get the most rescent updateID and roundID to
the network instance
parent
90f09067
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mixmessages/permissioningPoll.go
+5
-3
5 additions, 3 deletions
mixmessages/permissioningPoll.go
mixmessages/roundInfo.go
+3
-2
3 additions, 2 deletions
mixmessages/roundInfo.go
mixmessages/roundInfo_test.go
+3
-2
3 additions, 2 deletions
mixmessages/roundInfo_test.go
with
11 additions
and
7 deletions
mixmessages/permissioningPoll.go
+
5
−
3
View file @
7d7f1e09
package
mixmessages
import
"gitlab.com/elixxir/primitives/current"
// GetState gets the state of the node
func
(
m
*
PermissioningPoll
)
Get
State
()
uint32
{
func
(
m
*
PermissioningPoll
)
Get
CurrentActivityState
()
current
.
Activity
{
if
m
!=
nil
{
return
m
.
Activity
return
current
.
Activity
(
m
.
Activity
)
}
return
0
return
current
.
NOT_STARTED
}
This diff is collapsed.
Click to expand it.
mixmessages/roundInfo.go
+
3
−
2
View file @
7d7f1e09
...
...
@@ -12,6 +12,7 @@ package mixmessages
import
(
"github.com/pkg/errors"
"gitlab.com/elixxir/primitives/id"
"gitlab.com/elixxir/primitives/states"
)
// SetSignature sets RoundInfo's signature to the newSig argument
...
...
@@ -78,8 +79,8 @@ func (m *RoundInfo) GetSig() []byte {
}
// GetActivity gets the state of the node
func
(
m
*
RoundInfo
)
Get
Activity
()
uint32
{
return
m
.
State
func
(
m
*
RoundInfo
)
Get
RoundState
()
states
.
Round
{
return
states
.
Round
(
m
.
State
)
}
func
(
m
*
RoundInfo
)
GetRoundId
()
id
.
Round
{
...
...
This diff is collapsed.
Click to expand it.
mixmessages/roundInfo_test.go
+
3
−
2
View file @
7d7f1e09
...
...
@@ -10,6 +10,7 @@ import (
"crypto/rand"
"gitlab.com/elixxir/crypto/signature"
"gitlab.com/elixxir/crypto/signature/rsa"
"gitlab.com/elixxir/primitives/states"
"testing"
)
...
...
@@ -281,9 +282,9 @@ func TestRoundInfo_GetActivity(t *testing.T) {
State
:
expected
,
}
received
:=
testRoundInfo
.
Get
Activity
()
received
:=
testRoundInfo
.
Get
RoundState
()
if
received
!=
expected
{
if
received
!=
states
.
Round
(
expected
)
{
t
.
Errorf
(
"Received does not match expected for getter function! "
+
"Expected: %+v
\n\t
"
+
"Received: %+v"
,
expected
,
received
)
...
...
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