From 2e6796726329f211c70785f2fa29a4cded399412 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 4 Jun 2023 22:54:10 +0300 Subject: refactor to channel a list of live nodes --- internal/vote/vote.go | 4 ++-- internal/vote/vote_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/vote') 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 -- cgit v1.2.3