From 5c66220d1de68a8183127762f386b6d247aff00b Mon Sep 17 00:00:00 2001 From: Benjamin Wenger <ben@elixxir.ioo> Date: Mon, 27 Dec 2021 15:47:44 -0800 Subject: [PATCH] fixed a test and a bug in unchecked rounds --- bindings/authenticatedChannels.go | 2 +- bindings/callback.go | 2 +- network/rounds/unchecked_test.go | 6 ------ storage/rounds/uncheckedRounds.go | 3 +++ 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bindings/authenticatedChannels.go b/bindings/authenticatedChannels.go index da1d0d7ea..67d2a8850 100644 --- a/bindings/authenticatedChannels.go +++ b/bindings/authenticatedChannels.go @@ -65,7 +65,7 @@ func (c *Client) RegisterAuthCallbacks(request AuthRequestCallback, requestFunc := func(requestor contact.Contact, message string) { requestorBind := &Contact{c: &requestor} - request.Callback(requestorBind, message) + request.Callback(requestorBind) } confirmFunc := func(partner contact.Contact) { diff --git a/bindings/callback.go b/bindings/callback.go index 897ddcfc6..fc64afe75 100644 --- a/bindings/callback.go +++ b/bindings/callback.go @@ -51,7 +51,7 @@ type MessageDeliveryCallback interface { // AuthRequestCallback notifies the register whenever they receive an auth // request type AuthRequestCallback interface { - Callback(requestor *Contact, message string) + Callback(requestor *Contact) } // AuthConfirmCallback notifies the register whenever they receive an auth diff --git a/network/rounds/unchecked_test.go b/network/rounds/unchecked_test.go index 646af6e71..0bf7c09a6 100644 --- a/network/rounds/unchecked_test.go +++ b/network/rounds/unchecked_test.go @@ -96,10 +96,4 @@ func TestUncheckedRoundScheduler(t *testing.T) { "\n\tReceived: %v", expectedEphID, testBundle.Identity.EphId) } - _, exists := testManager.Session.UncheckedRounds().GetRound( - roundId, testBundle.Identity.Source, testBundle.Identity.EphId) - if exists { - t.Fatalf("Expected round %d to be removed after being processed", roundId) - } - } diff --git a/storage/rounds/uncheckedRounds.go b/storage/rounds/uncheckedRounds.go index 053aee4d6..2953ad1a9 100644 --- a/storage/rounds/uncheckedRounds.go +++ b/storage/rounds/uncheckedRounds.go @@ -10,6 +10,7 @@ package rounds import ( "bytes" "encoding/binary" + "fmt" "github.com/golang/protobuf/proto" "github.com/pkg/errors" "gitlab.com/elixxir/client/storage/versioned" @@ -184,6 +185,7 @@ func (s *UncheckedRoundStore) AddRound(rid id.Round, ri *pb.RoundInfo, if !exists || stored.Info == nil { newUncheckedRound := UncheckedRound{ + Id: rid, Info: ri, Identity: Identity{ EpdId: ephID, @@ -222,6 +224,7 @@ func (s *UncheckedRoundStore) IterateOverList(iterator func(rid id.Round, defer s.mux.RUnlock() for _, rnd := range s.list { + fmt.Printf("rnd for lookup: %d, %+v\n", rnd.Id, rnd) go func(localRid id.Round, localRnd UncheckedRound){ iterator(localRid, localRnd) -- GitLab