diff --git a/broadcast/asymmetric_test.go b/broadcast/asymmetric_test.go index 88aa2219d3495beb4659b97f5aa34ca4baf9c27f..776879127b040946b8147c184341cc4860de3296 100644 --- a/broadcast/asymmetric_test.go +++ b/broadcast/asymmetric_test.go @@ -56,11 +56,16 @@ func Test_asymmetricClient_Smoke(t *testing.T) { cbChan <- payload } - s, err := NewBroadcastChannel(channel, cb, newMockCmix(cMixHandler), rngGen, Param{Method: Asymmetric}) + s, err := NewBroadcastChannel(channel, newMockCmix(cMixHandler), rngGen) if err != nil { t.Errorf("Failed to create broadcast channel: %+v", err) } + err = s.RegisterListener(cb, Asymmetric) + if err != nil { + t.Errorf("Failed to register listener: %+v", err) + } + cbChans[i] = cbChan clients[i] = s @@ -73,7 +78,7 @@ func Test_asymmetricClient_Smoke(t *testing.T) { // Send broadcast from each client for i := range clients { - payload := make([]byte, clients[i].MaxPayloadSize()) + payload := make([]byte, clients[i].MaxAsymmetricPayloadSize()) copy(payload, fmt.Sprintf("Hello from client %d of %d.", i, len(clients))) @@ -112,7 +117,7 @@ func Test_asymmetricClient_Smoke(t *testing.T) { clients[i].Stop() } - payload := make([]byte, clients[0].MaxPayloadSize()) + payload := make([]byte, clients[0].MaxAsymmetricPayloadSize()) copy(payload, "This message should not get through.") // Start waiting on channels and error if anything is received diff --git a/broadcast/symmetric_test.go b/broadcast/symmetric_test.go index de76da504ca02fa6b8b1aa558bbef20a865a7730..2eb26d29eb3b56db1e894ad5b3da3aaabadf114f 100644 --- a/broadcast/symmetric_test.go +++ b/broadcast/symmetric_test.go @@ -63,10 +63,16 @@ func Test_symmetricClient_Smoke(t *testing.T) { cbChan <- payload } - s, err := NewBroadcastChannel(channel, cb, newMockCmix(cMixHandler), rngGen, Param{Method: Symmetric}) + s, err := NewBroadcastChannel(channel, newMockCmix(cMixHandler), rngGen) if err != nil { t.Errorf("Failed to create broadcast channel: %+v", err) } + + err = s.RegisterListener(cb, Symmetric) + if err != nil { + t.Errorf("Failed to register listener: %+v", err) + } + cbChans[i] = cbChan clients[i] = s diff --git a/cmd/broadcast.go b/cmd/broadcast.go index 3d0a11de1b90f140510d90157049ed562e75a47c..2249f87d0ef6d83ecd2a101f3aeb12037623e30a 100644 --- a/cmd/broadcast.go +++ b/cmd/broadcast.go @@ -124,7 +124,7 @@ var broadcastCmd = &cobra.Command{ // Load key if needed if pk == nil && keyPath != "" { - jww.DEBUG.Printf("Attempting to load private key at %s") + jww.DEBUG.Printf("Attempting to load private key at %s", keyPath) if ep, err := utils.ExpandPath(keyPath); err == nil { keyBytes, err := utils.ReadFile(ep) if err != nil {