From f7655bb4561d668021c2a39220f946bae953bf64 Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Tue, 19 Oct 2021 11:22:53 -0700 Subject: [PATCH] Fix group chat formatting, comments, and spelling --- bindings/group.go | 6 ++++-- groupChat/groupStore/dhKeyList.go | 5 +++-- groupChat/groupStore/group.go | 3 ++- groupChat/groupStore/group_test.go | 3 ++- groupChat/groupStore/store.go | 6 ++++-- groupChat/groupStore/store_test.go | 6 +++--- groupChat/internalFormat.go | 2 +- groupChat/internalFormat_test.go | 3 ++- groupChat/makeGroup.go | 6 ++++-- groupChat/makeGroup_test.go | 15 ++++++++++----- groupChat/manager.go | 3 ++- groupChat/manager_test.go | 9 ++++++--- groupChat/publicFormat_test.go | 3 ++- groupChat/receive.go | 2 +- groupChat/receiveRequest.go | 3 ++- groupChat/receive_test.go | 20 +++++++++++++------- groupChat/send.go | 3 ++- groupChat/sendRequests_test.go | 4 ++-- groupChat/send_test.go | 6 ++++-- groupChat/utils_test.go | 19 ++++++++++++------- 20 files changed, 81 insertions(+), 46 deletions(-) diff --git a/bindings/group.go b/bindings/group.go index 8d20c533d..ddd9a17bd 100644 --- a/bindings/group.go +++ b/bindings/group.go @@ -292,7 +292,8 @@ func (gmr *GroupMessageReceive) GetTimestampNano() int64 { // GetTimestampMS returns the message timestamp in milliseconds. func (gmr *GroupMessageReceive) GetTimestampMS() int64 { - return gmr.Timestamp.UnixNano() / int64(time.Millisecond) + ts := uint64(gmr.Timestamp.UnixNano()) / uint64(time.Millisecond) + return int64(ts) } // GetRoundID returns the ID of the round the message was sent on. @@ -309,5 +310,6 @@ func (gmr *GroupMessageReceive) GetRoundTimestampNano() int64 { // GetRoundTimestampMS returns the timestamp, in milliseconds, of the round the // message was sent on. func (gmr *GroupMessageReceive) GetRoundTimestampMS() int64 { - return gmr.RoundTimestamp.UnixNano() / int64(time.Millisecond) + ts := uint64(gmr.RoundTimestamp.UnixNano()) / uint64(time.Millisecond) + return int64(ts) } diff --git a/groupChat/groupStore/dhKeyList.go b/groupChat/groupStore/dhKeyList.go index 50c405c42..f6359f340 100644 --- a/groupChat/groupStore/dhKeyList.go +++ b/groupChat/groupStore/dhKeyList.go @@ -25,10 +25,11 @@ const ( dhKeyDecodeErr = "failed to decode member DH key: %+v" ) +// DhKeyList is a map of users to their DH key. type DhKeyList map[id.ID]*cyclic.Int -// GenerateDhKeyList generates the symmetric/DH key between the user and all -// group members. +// GenerateDhKeyList generates the DH key between the user and all group +// members. func GenerateDhKeyList(userID *id.ID, privKey *cyclic.Int, members group.Membership, grp *cyclic.Group) DhKeyList { dkl := make(DhKeyList, len(members)-1) diff --git a/groupChat/groupStore/group.go b/groupChat/groupStore/group.go index 98d0b489d..927201add 100644 --- a/groupChat/groupStore/group.go +++ b/groupChat/groupStore/group.go @@ -207,7 +207,8 @@ func DeserializeGroup(data []byte) (Group, error) { return g, err } -// groupStoreKey generates a unique key to save and load a Group to/from storage. +// groupStoreKey generates a unique key to save and load a Group to/from +// storage. func groupStoreKey(groupID *id.ID) string { return groupStorageKey + groupID.String() } diff --git a/groupChat/groupStore/group_test.go b/groupChat/groupStore/group_test.go index ff855db08..30bada2d7 100644 --- a/groupChat/groupStore/group_test.go +++ b/groupChat/groupStore/group_test.go @@ -22,7 +22,8 @@ import ( func TestNewGroup(t *testing.T) { prng := rand.New(rand.NewSource(42)) membership := createMembership(prng, 10, t) - dkl := GenerateDhKeyList(membership[0].ID, randCycInt(prng), membership, getGroup()) + dkl := GenerateDhKeyList( + membership[0].ID, randCycInt(prng), membership, getGroup()) expectedGroup := Group{ Name: []byte(groupName), diff --git a/groupChat/groupStore/store.go b/groupChat/groupStore/store.go index 88e980603..f180249e7 100644 --- a/groupChat/groupStore/store.go +++ b/groupChat/groupStore/store.go @@ -40,7 +40,8 @@ const ( setUserPanic = "Store.SetUser is for testing only. Got %T" ) -// The maximum number of group chats that a user can be a part of at once. +// MaxGroupChats is the maximum number of group chats that a user can be a part +// of at once. const MaxGroupChats = 64 // Store stores the list of Groups that a user is a part of. @@ -265,7 +266,8 @@ func (s *Store) Get(groupID *id.ID) (Group, bool) { // GetByKeyFp returns the group with the matching key fingerprint and salt. // Returns false if no group is found. -func (s *Store) GetByKeyFp(keyFp format.Fingerprint, salt [group.SaltLen]byte) (Group, bool) { +func (s *Store) GetByKeyFp(keyFp format.Fingerprint, salt [group.SaltLen]byte) ( + Group, bool) { s.mux.RLock() defer s.mux.RUnlock() diff --git a/groupChat/groupStore/store_test.go b/groupChat/groupStore/store_test.go index 0e0917ff3..0303446c9 100644 --- a/groupChat/groupStore/store_test.go +++ b/groupChat/groupStore/store_test.go @@ -58,7 +58,7 @@ func TestNewStore(t *testing.T) { groupIds = append(groupIds, grpId) } - // Check that stored group Id list is expected value + // Check that stored group ID list is expected value expectedData := serializeGroupIdList(store.list) obj, err := store.kv.Get(groupListStorageKey, groupListVersion) @@ -211,7 +211,7 @@ func Test_serializeGroupIdList_deserializeGroupIdList(t *testing.T) { data := serializeGroupIdList(testMap) newList := deserializeGroupIdList(data) - // Sort expected and received lists so they are in the same order + // Sort expected and received lists so that they are in the same order sort.Slice(expected, func(i, j int) bool { return bytes.Compare(expected[i].Bytes(), expected[j].Bytes()) == -1 }) @@ -405,7 +405,7 @@ func TestStore_GroupIDs(t *testing.T) { newList := store.GroupIDs() - // Sort expected and received lists so they are in the same order + // Sort expected and received lists so that they are in the same order sort.Slice(expected, func(i, j int) bool { return bytes.Compare(expected[i].Bytes(), expected[j].Bytes()) == -1 }) diff --git a/groupChat/internalFormat.go b/groupChat/internalFormat.go index 2502a9c8c..e8fd69df6 100644 --- a/groupChat/internalFormat.go +++ b/groupChat/internalFormat.go @@ -94,7 +94,7 @@ func (im internalMsg) SetTimestamp(t time.Time) { binary.LittleEndian.PutUint64(im.timestamp, uint64(t.UnixNano())) } -// GetSenderID returns the sender ID bytes as a id.ID. +// GetSenderID returns the sender ID bytes as an id.ID. func (im internalMsg) GetSenderID() (*id.ID, error) { return id.Unmarshal(im.senderID) } diff --git a/groupChat/internalFormat_test.go b/groupChat/internalFormat_test.go index 984d11b8f..2fc5a0ebb 100644 --- a/groupChat/internalFormat_test.go +++ b/groupChat/internalFormat_test.go @@ -198,7 +198,8 @@ func TestInternalMsg_String(t *testing.T) { } } -// Happy path: tests that String returns the expected string for a nil internalMsg. +// Happy path: tests that String returns the expected string for a nil +// internalMsg. func TestInternalMsg_String_NilInternalMessage(t *testing.T) { im := internalMsg{} diff --git a/groupChat/makeGroup.go b/groupChat/makeGroup.go index 2c277b438..f3c5544c9 100644 --- a/groupChat/makeGroup.go +++ b/groupChat/makeGroup.go @@ -75,7 +75,8 @@ func (m Manager) MakeGroup(membership []*id.ID, name, msg []byte) (gs.Group, groupKey := group.NewKey(keyPreimage, mem) // Create new group and add to manager - g := gs.NewGroup(name, groupID, groupKey, idPreimage, keyPreimage, msg, mem, dkl) + g := gs.NewGroup( + name, groupID, groupKey, idPreimage, keyPreimage, msg, mem, dkl) if err := m.gs.Add(g); err != nil { return gs.Group{}, nil, NotSent, errors.Errorf(addGroupErr, err) } @@ -92,7 +93,8 @@ func (m Manager) MakeGroup(membership []*id.ID, name, msg []byte) (gs.Group, // buildMembership retrieves the contact object for each member ID and creates a // new membership from them. The caller is set as the leader. For a member to be // added, the group leader must have an authenticated channel with the member. -func (m Manager) buildMembership(members []*id.ID) (group.Membership, gs.DhKeyList, error) { +func (m Manager) buildMembership(members []*id.ID) (group.Membership, + gs.DhKeyList, error) { // Return an error if the membership list has too few or too many members if len(members) < group.MinParticipants { return nil, nil, diff --git a/groupChat/makeGroup_test.go b/groupChat/makeGroup_test.go index 004bf4526..6c38cae0f 100644 --- a/groupChat/makeGroup_test.go +++ b/groupChat/makeGroup_test.go @@ -77,7 +77,8 @@ func TestManager_MakeGroup(t *testing.T) { func TestManager_MakeGroup_MaxMessageSizeError(t *testing.T) { prng := rand.New(rand.NewSource(42)) m, _ := newTestManagerWithStore(prng, 10, 0, nil, nil, t) - expectedErr := fmt.Sprintf(maxInitMsgSizeErr, MaxInitMessageSize+1, MaxInitMessageSize) + expectedErr := fmt.Sprintf( + maxInitMsgSizeErr, MaxInitMessageSize+1, MaxInitMessageSize) _, _, status, err := m.MakeGroup(nil, nil, make([]byte, MaxInitMessageSize+1)) if err == nil || err.Error() != expectedErr { @@ -96,7 +97,8 @@ func TestManager_MakeGroup_MaxMessageSizeError(t *testing.T) { func TestManager_MakeGroup_MembershipSizeError(t *testing.T) { prng := rand.New(rand.NewSource(42)) m, _ := newTestManagerWithStore(prng, 10, 0, nil, nil, t) - expectedErr := fmt.Sprintf(maxMembersErr, group.MaxParticipants+1, group.MaxParticipants) + expectedErr := fmt.Sprintf( + maxMembersErr, group.MaxParticipants+1, group.MaxParticipants) _, _, status, err := m.MakeGroup(make([]*id.ID, group.MaxParticipants+1), nil, []byte{}) @@ -153,7 +155,8 @@ func TestManager_buildMembership(t *testing.T) { func TestManager_buildMembership_MinParticipantsError(t *testing.T) { m, _ := newTestManager(rand.New(rand.NewSource(42)), t) memberIDs := make([]*id.ID, group.MinParticipants-1) - expectedErr := fmt.Sprintf(minMembersErr, len(memberIDs), group.MinParticipants) + expectedErr := fmt.Sprintf( + minMembersErr, len(memberIDs), group.MinParticipants) _, _, err := m.buildMembership(memberIDs) if err == nil || !strings.Contains(err.Error(), expectedErr) { @@ -167,7 +170,8 @@ func TestManager_buildMembership_MinParticipantsError(t *testing.T) { func TestManager_buildMembership_MaxParticipantsError(t *testing.T) { m, _ := newTestManager(rand.New(rand.NewSource(42)), t) memberIDs := make([]*id.ID, group.MaxParticipants+1) - expectedErr := fmt.Sprintf(maxMembersErr, len(memberIDs), group.MaxParticipants) + expectedErr := fmt.Sprintf( + maxMembersErr, len(memberIDs), group.MaxParticipants) _, _, err := m.buildMembership(memberIDs) if err == nil || !strings.Contains(err.Error(), expectedErr) { @@ -275,7 +279,8 @@ func TestRequestStatus_Message(t *testing.T) { // addPartners returns a list of user IDs and their matching membership and adds // them as partners. -func addPartners(m *Manager, t *testing.T) ([]*id.ID, group.Membership, gs.DhKeyList) { +func addPartners(m *Manager, t *testing.T) ([]*id.ID, group.Membership, + gs.DhKeyList) { memberIDs := make([]*id.ID, 10) members := group.Membership{m.gs.GetUser()} dkl := gs.DhKeyList{} diff --git a/groupChat/manager.go b/groupChat/manager.go index 6691e5415..92081c060 100644 --- a/groupChat/manager.go +++ b/groupChat/manager.go @@ -79,7 +79,8 @@ func newManager(client *api.Client, userID *id.ID, userDhKey *cyclic.Int, receiveFunc ReceiveCallback) (*Manager, error) { // Load the group chat storage or create one if one does not exist - gStore, err := gs.NewOrLoadStore(kv, group.Member{ID: userID, DhKey: userDhKey}) + gStore, err := gs.NewOrLoadStore( + kv, group.Member{ID: userID, DhKey: userDhKey}) if err != nil { return nil, errors.Errorf(newGroupStoreErr, err) } diff --git a/groupChat/manager_test.go b/groupChat/manager_test.go index 0ea0f5341..ccb12a194 100644 --- a/groupChat/manager_test.go +++ b/groupChat/manager_test.go @@ -31,7 +31,8 @@ func Test_newManager(t *testing.T) { requestFunc := func(g gs.Group) { requestChan <- g } receiveChan := make(chan MessageReceive) receiveFunc := func(msg MessageReceive) { receiveChan <- msg } - m, err := newManager(nil, user.ID, user.DhKey, nil, nil, nil, nil, kv, requestFunc, receiveFunc) + m, err := newManager(nil, user.ID, user.DhKey, nil, nil, nil, nil, kv, + requestFunc, receiveFunc) if err != nil { t.Errorf("newManager() returned an error: %+v", err) } @@ -84,7 +85,8 @@ func Test_newManager_LoadStorage(t *testing.T) { } } - m, err := newManager(nil, user.ID, user.DhKey, nil, nil, nil, nil, kv, nil, nil) + m, err := newManager( + nil, user.ID, user.DhKey, nil, nil, nil, nil, kv, nil, nil) if err != nil { t.Errorf("newManager() returned an error: %+v", err) } @@ -271,7 +273,8 @@ func Test_newManager_LoadError(t *testing.T) { func TestManager_JoinGroup(t *testing.T) { prng := rand.New(rand.NewSource(42)) m, _ := newTestManagerWithStore(prng, 10, 0, nil, nil, t) - g := newTestGroup(m.store.E2e().GetGroup(), m.store.GetUser().E2eDhPrivateKey, prng, t) + g := newTestGroup( + m.store.E2e().GetGroup(), m.store.GetUser().E2eDhPrivateKey, prng, t) err := m.JoinGroup(g) if err != nil { diff --git a/groupChat/publicFormat_test.go b/groupChat/publicFormat_test.go index 69884ff76..750a8057f 100644 --- a/groupChat/publicFormat_test.go +++ b/groupChat/publicFormat_test.go @@ -149,7 +149,8 @@ func Test_publicMsg_String(t *testing.T) { } } -// Happy path: tests that String returns the expected string for a nil publicMsg. +// Happy path: tests that String returns the expected string for a nil +// publicMsg. func Test_publicMsg_String_NilInternalMessage(t *testing.T) { pm := publicMsg{} diff --git a/groupChat/receive.go b/groupChat/receive.go index 64cf10b78..78e448c3f 100644 --- a/groupChat/receive.go +++ b/groupChat/receive.go @@ -69,7 +69,7 @@ func (m Manager) receive(rawMsgs chan message.Receive, stop *stoppable.Single) { } // readMessage returns the group, message ID, timestamp, sender ID, and message -// of a group message. The encrypted group message data is unmarshaled from a +// of a group message. The encrypted group message data is unmarshalled from a // cMix message in the message.Receive and then decrypted and the MAC is // verified. The group is found by finding the group with a matching key // fingerprint. diff --git a/groupChat/receiveRequest.go b/groupChat/receiveRequest.go index e5c7576f1..76018cc4a 100644 --- a/groupChat/receiveRequest.go +++ b/groupChat/receiveRequest.go @@ -26,7 +26,8 @@ const ( // receiveRequest starts the group request reception worker that waits for new // group requests to arrive. -func (m Manager) receiveRequest(rawMsgs chan message.Receive, stop *stoppable.Single) { +func (m Manager) receiveRequest(rawMsgs chan message.Receive, + stop *stoppable.Single) { jww.DEBUG.Print("Starting group message request reception worker.") for { diff --git a/groupChat/receive_test.go b/groupChat/receive_test.go index 36ea8ed2d..26f3a6800 100644 --- a/groupChat/receive_test.go +++ b/groupChat/receive_test.go @@ -131,7 +131,8 @@ func TestManager_receive_QuitChan(t *testing.T) { } } -// Tests that Manager.readMessage returns the message data for the correct group. +// Tests that Manager.readMessage returns the message data for the correct +// group. func TestManager_readMessage(t *testing.T) { // Create new test Manager and Group prng := rand.New(rand.NewSource(42)) @@ -206,7 +207,8 @@ func TestManager_readMessage_FindGroupKpError(t *testing.T) { expectedTimestamp := netTime.Now() // Create cMix message and get public message - cMixMsg, err := m.newCmixMsg(g, expectedContents, expectedTimestamp, g.Members[4], prng) + cMixMsg, err := m.newCmixMsg( + g, expectedContents, expectedTimestamp, g.Members[4], prng) if err != nil { t.Errorf("Failed to create new cMix message: %+v", err) } @@ -242,7 +244,8 @@ func TestManager_decryptMessage(t *testing.T) { expectedTimestamp := netTime.Now() // Create cMix message and get public message - msg, err := m.newCmixMsg(g, expectedContents, expectedTimestamp, g.Members[4], prng) + msg, err := m.newCmixMsg( + g, expectedContents, expectedTimestamp, g.Members[4], prng) if err != nil { t.Errorf("Failed to create new cMix message: %+v", err) } @@ -316,7 +319,7 @@ func TestManager_decryptMessage_GetCryptKeyError(t *testing.T) { } // Error path: an error is returned when the decrypted payload cannot be -// unmarshaled. +// unmarshalled. func TestManager_decryptMessage_UnmarshalInternalMsgError(t *testing.T) { // Create new test Manager and Group prng := rand.New(rand.NewSource(42)) @@ -338,11 +341,13 @@ func TestManager_decryptMessage_UnmarshalInternalMsgError(t *testing.T) { // Modify publicMsg to have invalid payload publicMsg = mapPublicMsg(publicMsg.Marshal()[:33]) - key, err := group.NewKdfKey(g.Key, group.ComputeEpoch(timestamp), publicMsg.GetSalt()) + key, err := group.NewKdfKey( + g.Key, group.ComputeEpoch(timestamp), publicMsg.GetSalt()) if err != nil { t.Errorf("failed to create new key: %+v", err) } - msg.SetMac(group.NewMAC(key, publicMsg.GetPayload(), g.DhKeys[*g.Members[4].ID])) + msg.SetMac( + group.NewMAC(key, publicMsg.GetPayload(), g.DhKeys[*g.Members[4].ID])) // Check if error is correct expectedErr := strings.SplitN(unmarshalInternalMsgErr, "%", 2)[0] @@ -364,7 +369,8 @@ func Test_getCryptKey(t *testing.T) { payload := []byte("payload") ts := netTime.Now() - expectedKey, err := group.NewKdfKey(g.Key, group.ComputeEpoch(ts.Add(5*time.Minute)), salt) + expectedKey, err := group.NewKdfKey( + g.Key, group.ComputeEpoch(ts.Add(5*time.Minute)), salt) if err != nil { t.Errorf("failed to create new key: %+v", err) } diff --git a/groupChat/send.go b/groupChat/send.go index cdb40888e..ca25cfe60 100644 --- a/groupChat/send.go +++ b/groupChat/send.go @@ -56,7 +56,8 @@ func (m *Manager) Send(groupID *id.ID, message []byte) (id.Round, error) { // createMessages generates a list of cMix messages and a list of corresponding // recipient IDs. -func (m *Manager) createMessages(groupID *id.ID, msg []byte) (map[id.ID]format.Message, error) { +func (m *Manager) createMessages(groupID *id.ID, msg []byte) ( + map[id.ID]format.Message, error) { timeNow := netTime.Now() g, exists := m.gs.Get(groupID) diff --git a/groupChat/sendRequests_test.go b/groupChat/sendRequests_test.go index 56ca284fb..aa9339e5e 100644 --- a/groupChat/sendRequests_test.go +++ b/groupChat/sendRequests_test.go @@ -185,8 +185,8 @@ func TestManager_sendRequests_SendAllFail(t *testing.T) { } } -// Tests that Manager.sendRequests returns the correct status when some of the -// sends fail. +// Tests that Manager.sendRequests returns the correct status when some sends +// fail. func TestManager_sendRequests_SendPartialSent(t *testing.T) { prng := rand.New(rand.NewSource(42)) m, g := newTestManagerWithStore(prng, 10, 2, nil, nil, t) diff --git a/groupChat/send_test.go b/groupChat/send_test.go index 1db5cec79..e9f794185 100644 --- a/groupChat/send_test.go +++ b/groupChat/send_test.go @@ -136,7 +136,8 @@ func TestManager_Send_SendManyCMIXError(t *testing.T) { } } -// Tests that Manager.createMessages generates the messages for the correct group. +// Tests that Manager.createMessages generates the messages for the correct +// group. func TestManager_createMessages(t *testing.T) { prng := rand.New(rand.NewSource(42)) m, g := newTestManagerWithStore(prng, 10, 0, nil, nil, t) @@ -373,7 +374,8 @@ func TestGroup_newCmixMsg_SaltReaderError(t *testing.T) { expectedErr := strings.SplitN(saltReadErr, "%", 2)[0] m := &Manager{store: storage.InitTestingSession(t)} - _, err := m.newCmixMsg(gs.Group{}, []byte{}, time.Time{}, group.Member{}, strings.NewReader("")) + _, err := m.newCmixMsg(gs.Group{}, + []byte{}, time.Time{}, group.Member{}, strings.NewReader("")) if err == nil || !strings.Contains(err.Error(), expectedErr) { t.Errorf("newCmixMsg() failed to return the expected error"+ "\nexpected: %s\nreceived: %+v", expectedErr, err) diff --git a/groupChat/utils_test.go b/groupChat/utils_test.go index d43ada0dc..554a1d063 100644 --- a/groupChat/utils_test.go +++ b/groupChat/utils_test.go @@ -101,7 +101,8 @@ func newTestManagerWithStore(rng *rand.Rand, numGroups int, sendErr int, } // getMembership returns a Membership with random members for testing. -func getMembership(size int, uid *id.ID, pubKey *cyclic.Int, grp *cyclic.Group, prng *rand.Rand, t *testing.T) group.Membership { +func getMembership(size int, uid *id.ID, pubKey *cyclic.Int, grp *cyclic.Group, + prng *rand.Rand, t *testing.T) group.Membership { contacts := make([]contact.Contact, size) for i := range contacts { randId, _ := id.NewRandomID(prng, id.User) @@ -123,7 +124,8 @@ func getMembership(size int, uid *id.ID, pubKey *cyclic.Int, grp *cyclic.Group, } // newTestGroup generates a new group with random values for testing. -func newTestGroup(grp *cyclic.Group, privKey *cyclic.Int, rng *rand.Rand, t *testing.T) gs.Group { +func newTestGroup(grp *cyclic.Group, privKey *cyclic.Int, rng *rand.Rand, + t *testing.T) gs.Group { // Generate name from base 64 encoded random data nameBytes := make([]byte, 16) rng.Read(nameBytes) @@ -137,7 +139,8 @@ func newTestGroup(grp *cyclic.Group, privKey *cyclic.Int, rng *rand.Rand, t *tes membership := getMembership(10, id.NewIdFromString("userID", id.User, t), randCycInt(rng), grp, rng, t) - dkl := gs.GenerateDhKeyList(id.NewIdFromString("userID", id.User, t), privKey, membership, grp) + dkl := gs.GenerateDhKeyList( + id.NewIdFromString("userID", id.User, t), privKey, membership, grp) idPreimage, err := group.NewIdPreimage(rng) if err != nil { @@ -241,7 +244,8 @@ func (tnm *testNetworkManager) GetE2eMsg(i int) message.Send { return tnm.e2eMessages[i] } -func (tnm *testNetworkManager) SendE2E(msg message.Send, _ params.E2E, _ *stoppable.Single) ([]id.Round, e2e.MessageID, time.Time, error) { +func (tnm *testNetworkManager) SendE2E(msg message.Send, _ params.E2E, + _ *stoppable.Single) ([]id.Round, e2e.MessageID, time.Time, error) { tnm.Lock() defer tnm.Unlock() @@ -269,7 +273,8 @@ func (tnm *testNetworkManager) SendCMIX(format.Message, *id.ID, params.CMIX) (id return 0, ephemeral.Id{}, nil } -func (tnm *testNetworkManager) SendManyCMIX(messages map[id.ID]format.Message, _ params.CMIX) (id.Round, []ephemeral.Id, error) { +func (tnm *testNetworkManager) SendManyCMIX(messages map[id.ID]format.Message, + _ params.CMIX) (id.Round, []ephemeral.Id, error) { if tnm.sendErr == 1 { return 0, nil, errors.New("SendManyCMIX error") } @@ -284,8 +289,8 @@ func (tnm *testNetworkManager) SendManyCMIX(messages map[id.ID]format.Message, _ type dummyEventMgr struct{} -func (d *dummyEventMgr) Report(p int, a, b, c string) {} -func (t *testNetworkManager) GetEventManager() interfaces.EventManager { +func (d *dummyEventMgr) Report(int, string, string, string) {} +func (tnm *testNetworkManager) GetEventManager() interfaces.EventManager { return &dummyEventMgr{} } -- GitLab