From 04e81fcef153b8e727ddfbaa8272f2c98a78107f Mon Sep 17 00:00:00 2001 From: ycc Date: Sun, 31 Dec 2023 18:43:55 +0100 Subject: [PATCH] lib invitation improvement for GUI --- endtoend_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/endtoend_test.go b/endtoend_test.go index bc68934..4bd1445 100644 --- a/endtoend_test.go +++ b/endtoend_test.go @@ -30,21 +30,21 @@ func TestEndToEnd(t *testing.T) { // Create an invitation for a friend, I want him/her to know me as Bender // //////////////////////////////////////////////////////////////////////////// fmt.Println("Creating an invitation for the first friend...") - peer, myContactCard, err := Me.InvitePeer("Bender", "myfirstfriend", []int{1, 2}) + peer, err := Me.InvitePeer("Bender", "myfirstfriend", []int{1, 2}) if err != nil { println(err) } println(peer.Name) // print my invitation - a, _ := json.Marshal(myContactCard) + a, _ := json.Marshal(peer.MyContact) fmt.Println(string(a)) // TODO : Convert invitation to QR Code - myContactCard.WritePng("invitation.png") - data, err := myContactCard.Compress() + peer.MyContact.WritePng("invitation.png") + data, err := peer.MyContact.Compress() if err != nil { println(err) } - myContactCard.WriteQr("qrcode.png") + peer.MyContact.WriteQr("qrcode.png") println("Compressed contact card :", len(data)) /////////////////////////////////////// // Simulate peer invitation response // @@ -60,7 +60,7 @@ func TestEndToEnd(t *testing.T) { ReceivedContact.ContactPublicKey = FirstFriendContactKp.Public ReceivedContact.EncryptionPublicKey = FirstFriendEncryptionKp.Public ReceivedContact.LookupPublicKey = FirstFriendLookupKp.Public - ReceivedContact.InvitationId = myContactCard.InvitationId + ReceivedContact.InvitationId = peer.MyContact.InvitationId FriendServer1KP := meowlib.NewKeyPair() FriendServer1 := meowlib.ServerCard{Name: "FriendServer1", Url: "http://myfriend.org/meow/", PublicKey: FriendServer1KP.Public, Description: "Fancy description"} ReceivedContact.PullServers = append(ReceivedContact.PullServers, &FriendServer1)