summaryrefslogtreecommitdiff
path: root/internal/vote
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-06-04 22:54:10 +0300
committerPaul Buetow <paul@buetow.org>2023-06-04 22:54:10 +0300
commit2e6796726329f211c70785f2fa29a4cded399412 (patch)
tree050c06a8a51e3280695919a3a1881b5509274c0d /internal/vote
parent2d04a386f6e06b2742188f8f05ef0199c3a366cf (diff)
refactor to channel a list of live nodes
Diffstat (limited to 'internal/vote')
-rw-r--r--internal/vote/vote.go4
-rw-r--r--internal/vote/vote_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/vote/vote.go b/internal/vote/vote.go
index 079e021..75fa67a 100644
--- a/internal/vote/vote.go
+++ b/internal/vote/vote.go
@@ -20,8 +20,8 @@ type Vote struct {
func New(conf config.Config, from, message string) Vote {
var ids []string
for _, id := range strings.Split(strings.TrimSpace(message), " ") {
- if !conf.IsParticipant(id) {
- log.Printf("%s is not a participant, excluding from the vote", id)
+ if !conf.IsNode(id) {
+ log.Printf("%s is not a node, excluding from the vote", id)
continue
}
ids = append(ids, id)
diff --git a/internal/vote/vote_test.go b/internal/vote/vote_test.go
index 0986e00..af8b741 100644
--- a/internal/vote/vote_test.go
+++ b/internal/vote/vote_test.go
@@ -8,7 +8,7 @@ import (
)
func TestVote(t *testing.T) {
- conf := config.Config{Participants: []string{"foo:1234", "bay:4321"}}
+ conf := config.Config{Nodes: []string{"foo:1234", "bay:4321"}}
v := New(conf, "earth:334234", " foo bar baz bay\n")
if v.From != "earth" {
@@ -29,7 +29,7 @@ func TestVote(t *testing.T) {
}
func TestVoteExpiry(t *testing.T) {
- conf := config.Config{Participants: []string{"foo:1234", "bay:4321"}}
+ conf := config.Config{Nodes: []string{"foo:1234", "bay:4321"}}
v := New(conf, "earth:334234", " foo bar baz bay\n")
// Set expiry 1h into the future