From eac777c205c231cc146b42a512ca1753c7edc6ee Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Thu, 31 Mar 2022 14:33:15 -0700 Subject: [PATCH] Make GetRoundResults variadic --- network/interface.go | 12 ++++++------ network/results.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/network/interface.go b/network/interface.go index 665ba791d..2c7adc905 100644 --- a/network/interface.go +++ b/network/interface.go @@ -73,7 +73,7 @@ type Manager interface { // (panic otherwise). If used, fill with random bits. // Will return an error if the network is unhealthy or if it fails to send // (along with the reason). Blocks until successful send or err. - // WARNING: Do not roll your own crypto + // WARNING: Do not roll your own crypto. SendManyCMIX(messages []TargetedCmixMessage, p CMIXParams) ( id.Round, []ephemeral.Id, error) @@ -145,11 +145,11 @@ type Manager interface { // notifications. // source - A byte buffer of related data. Generally used in notifications. // Example: Sender ID - // There can be multiple "default" services, the must use the "default" tag - // and the identifier must be the client reception ID. + // There can be multiple "default" services; if the "default" tag is used, + // then the identifier must be the client reception ID. // A service may have a nil response unless it is default. In general a // nil service is used to detect notifications when pickup is done by - // fingerprints + // fingerprints. AddService(clientID *id.ID, newService message.Service, response message.Processor) @@ -222,8 +222,8 @@ type Manager interface { // GetRoundResults adjudicates on the rounds requested. Checks if they are // older rounds or in progress rounds. - GetRoundResults(roundList []id.Round, timeout time.Duration, - roundCallback RoundEventCallback) error + GetRoundResults(timeout time.Duration, roundCallback RoundEventCallback, + roundList ...id.Round) error // LookupHistoricalRound looks up the passed historical round on the network. LookupHistoricalRound( diff --git a/network/results.go b/network/results.go index dbc16ae78..782532c3f 100644 --- a/network/results.go +++ b/network/results.go @@ -64,8 +64,8 @@ type RoundEventCallback func(allRoundsSucceeded, timedOut bool, rounds map[id.Ro // GetRoundResults adjudicates on the rounds requested. Checks if they are // older rounds or in progress rounds. -func (m *manager) GetRoundResults(roundList []id.Round, timeout time.Duration, - roundCallback RoundEventCallback) error { +func (m *manager) GetRoundResults(timeout time.Duration, + roundCallback RoundEventCallback, roundList ...id.Round) error { jww.INFO.Printf("GetRoundResults(%v, %s)", roundList, timeout) -- GitLab