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
0b664bff
Commit
0b664bff
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Small adjustments to dummy
parent
d5bd9b11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!510
Release
,
!329
Hotfix/dummy message bindings
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/dummy.go
+5
-5
5 additions, 5 deletions
bindings/dummy.go
dummy/send.go
+0
-3
0 additions, 3 deletions
dummy/send.go
with
5 additions
and
8 deletions
bindings/dummy.go
+
5
−
5
View file @
0b664bff
...
@@ -27,7 +27,7 @@ type DummyTraffic struct {
...
@@ -27,7 +27,7 @@ type DummyTraffic struct {
// given parameters below.
// given parameters below.
//
//
// Params:
// Params:
// -
e2eID - e2e
object ID in the tracker.
// -
cmixId - a Cmix
object ID in the tracker.
// - maxNumMessages - the upper bound of the random number of messages sent
// - maxNumMessages - the upper bound of the random number of messages sent
// each sending cycle.
// each sending cycle.
// - avgSendDeltaMS - the average duration, in milliseconds, to wait
// - avgSendDeltaMS - the average duration, in milliseconds, to wait
...
@@ -35,11 +35,11 @@ type DummyTraffic struct {
...
@@ -35,11 +35,11 @@ type DummyTraffic struct {
// - randomRangeMS - the upper bound of the interval between sending cycles,
// - randomRangeMS - the upper bound of the interval between sending cycles,
// in milliseconds. Sends occur every avgSendDeltaMS +/- a random duration
// in milliseconds. Sends occur every avgSendDeltaMS +/- a random duration
// with an upper bound of randomRangeMS.
// with an upper bound of randomRangeMS.
func
NewDummyTrafficManager
(
e2eID
,
maxNumMessages
,
avgSendDeltaMS
,
func
NewDummyTrafficManager
(
cmixId
,
maxNumMessages
,
avgSendDeltaMS
,
randomRangeMS
int
)
(
*
DummyTraffic
,
error
)
{
randomRangeMS
int
)
(
*
DummyTraffic
,
error
)
{
// Get user from singleton
// Get user from singleton
user
,
err
:=
e2e
TrackerSingleton
.
get
(
e2eID
)
net
,
err
:=
cmix
TrackerSingleton
.
get
(
cmixId
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -48,9 +48,9 @@ func NewDummyTrafficManager(e2eID, maxNumMessages, avgSendDeltaMS,
...
@@ -48,9 +48,9 @@ func NewDummyTrafficManager(e2eID, maxNumMessages, avgSendDeltaMS,
randomRange
:=
time
.
Duration
(
randomRangeMS
)
*
time
.
Millisecond
randomRange
:=
time
.
Duration
(
randomRangeMS
)
*
time
.
Millisecond
m
:=
dummy
.
NewManager
(
m
:=
dummy
.
NewManager
(
maxNumMessages
,
avgSendDelta
,
randomRange
,
user
.
api
.
Cmix
)
maxNumMessages
,
avgSendDelta
,
randomRange
,
net
.
api
)
return
&
DummyTraffic
{
m
},
user
.
api
.
AddService
(
m
.
StartDummyTraffic
)
return
&
DummyTraffic
{
m
},
net
.
api
.
AddService
(
m
.
StartDummyTraffic
)
}
}
// SetStatus sets the state of the dummy traffic send thread by passing in
// SetStatus sets the state of the dummy traffic send thread by passing in
...
...
This diff is collapsed.
Click to expand it.
dummy/send.go
+
0
−
3
View file @
0b664bff
...
@@ -98,9 +98,6 @@ func (m *Manager) sendMessages(msgs map[id.ID]format.Message, rng csprng.Source)
...
@@ -98,9 +98,6 @@ func (m *Manager) sendMessages(msgs map[id.ID]format.Message, rng csprng.Source)
// Fill the preimage with random data to ensure it is not repeatable
// Fill the preimage with random data to ensure it is not repeatable
p
:=
cmix
.
GetDefaultCMIXParams
()
p
:=
cmix
.
GetDefaultCMIXParams
()
//Send(recipient *id.ID, fingerprint format.Fingerprint,
// service message.Service, payload, mac []byte, cmixParams CMIXParams) (
// id.Round, ephemeral.Id, error)
_
,
_
,
err
:=
m
.
net
.
Send
(
&
recipient
,
msg
.
GetKeyFP
(),
_
,
_
,
err
:=
m
.
net
.
Send
(
&
recipient
,
msg
.
GetKeyFP
(),
message
.
GetRandomService
(
rng
),
msg
.
GetContents
(),
msg
.
GetMac
(),
p
)
message
.
GetRandomService
(
rng
),
msg
.
GetContents
(),
msg
.
GetMac
(),
p
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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