Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 96925a3

Browse files
committed
Apply review suggestion
1 parent e67aaf0 commit 96925a3

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

tools/docker-network/tests/committeerotation_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func Test_NoCandidacyPayload(t *testing.T) {
179179
})
180180

181181
// Start issuing candidacy payloads for 3 validators, and check if committee size is 3
182-
d.StartIssueCandidacyPayload("V1", "V2", "V3")
182+
d.StartIssueCandidacyPayload(d.Nodes("V1", "V2", "V3")...)
183183
d.AssertCommittee(currentEpoch+4, d.AccountsFromNodes(d.Nodes("V1", "V2", "V3")...))
184184
}
185185

tools/docker-network/tests/dockerframework.go

+8-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"log"
1010
"os"
1111
"os/exec"
12-
"slices"
1312
"sort"
1413
"strings"
1514
"sync/atomic"
@@ -297,29 +296,25 @@ func (d *DockerTestFramework) AccountsFromNodes(nodes ...*Node) []string {
297296
return accounts
298297
}
299298

300-
func (d *DockerTestFramework) StartIssueCandidacyPayload(nodeNames ...string) {
301-
if len(nodeNames) == 0 {
299+
func (d *DockerTestFramework) StartIssueCandidacyPayload(nodes ...*Node) {
300+
if len(nodes) == 0 {
302301
return
303302
}
304303

305-
for _, node := range d.nodes {
306-
if slices.Contains(nodeNames, node.Name) {
307-
node.IssueCandidacyPayload = true
308-
}
304+
for _, node := range nodes {
305+
node.IssueCandidacyPayload = true
309306
}
310307

311308
d.DockerComposeUp(true)
312309
}
313310

314-
func (d *DockerTestFramework) StopIssueCandidacyPayload(nodeNames ...string) {
315-
if len(nodeNames) == 0 {
311+
func (d *DockerTestFramework) StopIssueCandidacyPayload(nodes ...*Node) {
312+
if len(nodes) == 0 {
316313
return
317314
}
318315

319-
for _, node := range d.nodes {
320-
if slices.Contains(nodeNames, node.Name) {
321-
node.IssueCandidacyPayload = false
322-
}
316+
for _, node := range nodes {
317+
node.IssueCandidacyPayload = false
323318
}
324319

325320
d.DockerComposeUp(true)

0 commit comments

Comments
 (0)