Skip to content
Snippets Groups Projects
Commit 7d7f1e09 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

added the ability to get the most rescent updateID and roundID to

the network instance
parent 90f09067
Branches
Tags
No related merge requests found
package mixmessages
import "gitlab.com/elixxir/primitives/current"
// GetState gets the state of the node
func (m *PermissioningPoll) GetState() uint32 {
func (m *PermissioningPoll) GetCurrentActivityState() current.Activity {
if m != nil {
return m.Activity
return current.Activity(m.Activity)
}
return 0
return current.NOT_STARTED
}
......@@ -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) GetActivity() uint32 {
return m.State
func (m *RoundInfo) GetRoundState() states.Round {
return states.Round(m.State)
}
func (m *RoundInfo) GetRoundId() id.Round {
......
......@@ -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.GetActivity()
received := testRoundInfo.GetRoundState()
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment