From 1534fc15c92fb9de7f24230195e98ea1dd86d870 Mon Sep 17 00:00:00 2001 From: Samuel Hawksby-Robinson Date: Fri, 12 Feb 2021 15:50:47 +0000 Subject: [PATCH] Updated contact key gen in test so index call wouldn't be ambiguous --- protocol/messenger_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocol/messenger_test.go b/protocol/messenger_test.go index 5fe6a39fa..f76505852 100644 --- a/protocol/messenger_test.go +++ b/protocol/messenger_test.go @@ -2582,11 +2582,11 @@ func (s *MessengerSuite) TestEncryptDecryptIdentityImagesWithContactPubKeys() { } // Make contact keys and Contacts, set the Contacts to added - var contactKeys []*ecdsa.PrivateKey - for i:=0; i < 10; i++ { + contactKeys := make([]*ecdsa.PrivateKey, 10) + for i := range contactKeys { contactKey, err := crypto.GenerateKey() s.Require().NoError(err) - contactKeys = append(contactKeys, contactKey) + contactKeys[i] = contactKey contact, err := BuildContactFromPublicKey(&contactKey.PublicKey) s.Require().NoError(err) @@ -2641,4 +2641,7 @@ func (s *MessengerSuite) TestEncryptDecryptIdentityImagesWithContactPubKeys() { s.Require().NotEqual([]byte(smPayload), ci.Images["small"].Payload) s.Require().NotEqual([]byte(lgPayload), ci.Images["large"].Payload) + + // RESET Messenger identity + s.m.identity = sender }