Skip to content
Snippets Groups Projects
Commit 0b664bff authored by Josh Brooks's avatar Josh Brooks
Browse files

Small adjustments to dummy

parent d5bd9b11
No related branches found
No related tags found
2 merge requests!510Release,!329Hotfix/dummy message bindings
...@@ -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 := e2eTrackerSingleton.get(e2eID) net, err := cmixTrackerSingleton.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
......
...@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment