Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
d8af915b
Commit
d8af915b
authored
3 years ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Add 0 byte to message contents
parent
4f23b48a
No related branches found
No related tags found
2 merge requests
!170
Release
,
!120
Add 0 byte to message contents
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bindings/notifications.go
+2
-0
2 additions, 0 deletions
bindings/notifications.go
bindings/notifications_test.go
+20
-0
20 additions, 0 deletions
bindings/notifications_test.go
network/message/sendCmixUtils.go
+2
-1
2 additions, 1 deletion
network/message/sendCmixUtils.go
with
24 additions
and
1 deletion
bindings/notifications.go
+
2
−
0
View file @
d8af915b
...
...
@@ -9,6 +9,7 @@ package bindings
import
(
"encoding/json"
"fmt"
"github.com/pkg/errors"
"gitlab.com/elixxir/client/storage/edge"
"gitlab.com/elixxir/crypto/fingerprint"
...
...
@@ -68,6 +69,7 @@ func NotificationsForMe(notifCSV, preimages string) (*ManyNotificationForMeRepor
}
list
,
err
:=
notifications
.
DecodeNotificationsCSV
(
notifCSV
)
fmt
.
Printf
(
"%+v, %+v"
,
list
[
0
],
list
[
1
])
if
err
!=
nil
{
return
nil
,
err
...
...
This diff is collapsed.
Click to expand it.
bindings/notifications_test.go
+
20
−
0
View file @
d8af915b
...
...
@@ -123,3 +123,23 @@ func TestManyNotificationForMeReport_Get(t *testing.T) {
t
.
Errorf
(
"Didnt get error when too long"
)
}
}
func
TestManyNotificationForMeReport_Get2
(
t
*
testing
.
T
)
{
//preimages := "[{\"Data\":\"+imfMoh4wSvzdqlXvkeM8HK37NSrcWWzNIQuN2SAWzQD\",\"Type\":\"default\",\"Source\":\"+imfMoh4wSvzdqlXvkeM8HK37NSrcWWzNIQuN2SAWzQD\"},{\"Data\":\"KyX9P0GJy1tGpX2Kl0RSHO7liXh8WZ3lVmgh0luiyPc=\",\"Type\":\"request\",\"Source\":\"+imfMoh4wSvzdqlXvkeM8HK37NSrcWWzNIQuN2SAWzQD\"},{\"Data\":\"AKpMwY5PX3A3VA+xW2P96XoAxm+w/qODIoCOv/C1jmg=\",\"Type\":\"e2e\",\"Source\":\"k2aR7LPdbI825ZM15PPQGgA5xHi5uj+945ozTWHXYn8D\"},{\"Data\":\"sFu5vVtjkpvyF9aRGadbEFpI1HtFfoz3o2y2wAcq7GE=\",\"Type\":\"silent\",\"Source\":\"k2aR7LPdbI825ZM15PPQGgA5xHi5uj+945ozTWHXYn8D\"},{\"Data\":\"fejEMJllneWUvTwG5xsk921iZymizzRakowl1odzMHM=\",\"Type\":\"endFT\",\"Source\":\"k2aR7LPdbI825ZM15PPQGgA5xHi5uj+945ozTWHXYn8D\"}]"
//csv := "LfDJYRwrmSBc9Y9Kt1C0TpxezIp42QUxZytbnoAkJrU=,NBWOG68cZhzmPrcnv0VbmuAutZ+Mfyx7vQ=="
preimages
:=
"[{
\"
Data
\"
:
\"
6i0/uGCZWM5CMfyS5TtqgZziDiwr62jkqI2VGP2OsfY=
\"
,
\"
Type
\"
:
\"
endFT
\"
,
\"
Source
\"
:
\"
yVbuL00vkMOMOq+9dzk7qUmc9KDUpK4QH5wxohURU7cD
\"
},{
\"
Data
\"
:
\"
+imfMoh4wSvzdqlXvkeM8HK37NSrcWWzNIQuN2SAWzQD
\"
,
\"
Type
\"
:
\"
default
\"
,
\"
Source
\"
:
\"
+imfMoh4wSvzdqlXvkeM8HK37NSrcWWzNIQuN2SAWzQD
\"
},{
\"
Data
\"
:
\"
AKpMwY5PX3A3VA+xW2P96XoAxm+w/qODIoCOv/C1jmg=
\"
,
\"
Type
\"
:
\"
e2e
\"
,
\"
Source
\"
:
\"
k2aR7LPdbI825ZM15PPQGgA5xHi5uj+945ozTWHXYn8D
\"
},{
\"
Data
\"
:
\"
KyX9P0GJy1tGpX2Kl0RSHO7liXh8WZ3lVmgh0luiyPc=
\"
,
\"
Type
\"
:
\"
request
\"
,
\"
Source
\"
:
\"
+imfMoh4wSvzdqlXvkeM8HK37NSrcWWzNIQuN2SAWzQD
\"
},{
\"
Data
\"
:
\"
fejEMJllneWUvTwG5xsk921iZymizzRakowl1odzMHM=
\"
,
\"
Type
\"
:
\"
endFT
\"
,
\"
Source
\"
:
\"
k2aR7LPdbI825ZM15PPQGgA5xHi5uj+945ozTWHXYn8D
\"
},{
\"
Data
\"
:
\"
sFu5vVtjkpvyF9aRGadbEFpI1HtFfoz3o2y2wAcq7GE=
\"
,
\"
Type
\"
:
\"
silent
\"
,
\"
Source
\"
:
\"
k2aR7LPdbI825ZM15PPQGgA5xHi5uj+945ozTWHXYn8D
\"
},{
\"
Data
\"
:
\"
z8jcb8HmzayFuzOGiPATJE7eaLCbu6p5TVky7zt9WWs=
\"
,
\"
Type
\"
:
\"
e2e
\"
,
\"
Source
\"
:
\"
yVbuL00vkMOMOq+9dzk7qUmc9KDUpK4QH5wxohURU7cD
\"
},{
\"
Data
\"
:
\"
kMwwG5wg5/d7C5ptV/5qxOCcvXPNu1zEqAJJhAzpN1o=
\"
,
\"
Type
\"
:
\"
silent
\"
,
\"
Source
\"
:
\"
yVbuL00vkMOMOq+9dzk7qUmc9KDUpK4QH5wxohURU7cD
\"
}]"
// csv := "sonu7rdo4fnDnQr/EYcYfpdU3TOnZ/A+fvM5C9wYVRk=,6FZ+fEXi6DTbimit3xQv+629eXBd6cy7/w=="
csv
:=
"dVRQWAgW7PD88S5LZQ2XehPSJn7U0h1cJT5b01Qesvw=,xFrwD5n5UmYNXAHPChpFmV6OecAJNxGP+w==
\n
2yDqIz9z01Pq+tV13HW/9TO4umz3jU6DaOhKATCRpqc=,kkKWe1VSwYEtiyKg6W4S5Q8Rzv53aLU6yQ=="
report
,
err
:=
NotificationsForMe
(
csv
,
preimages
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to check if notifications are for me: %+v"
,
err
)
}
var
found
bool
for
_
,
i
:=
range
report
.
many
{
found
=
found
||
i
.
forMe
}
if
!
found
{
t
.
Errorf
(
"No notifications for me :("
)
}
}
This diff is collapsed.
Click to expand it.
network/message/sendCmixUtils.go
+
2
−
1
View file @
d8af915b
...
...
@@ -154,7 +154,8 @@ func buildSlotMessage(msg format.Message, recipient *id.ID, target *id.ID,
}
// Set the identity fingerprint
ifp
:=
fingerprint
.
IdentityFP
(
msg
.
GetContents
(),
preimage
)
ifp
:=
fingerprint
.
IdentityFP
(
append
([]
byte
{
0
},
msg
.
GetContents
()
...
),
preimage
)
msg
.
SetIdentityFP
(
ifp
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment