Skip to content
Snippets Groups Projects
Select Git revision
  • d6d8445e7baec3b955d50b5f82262d56109465ed
  • release default protected
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • hotfix/TestHostPool_UpdateNdf_AddFilter
  • XX-4719/announcementChannels
  • xx-4717/logLevel
  • jonah/noob-channel
  • master protected
  • XX-4707/tagDiskJson
  • xx-4698/notification-retry
  • hotfix/notifylockup
  • syncNodes
  • hotfix/localCB
  • XX-4677/NewChanManagerMobile
  • XX-4689/DmSync
  • duplicatePrefix
  • XX-4601/HavenInvites
  • finalizedUICallbacks
  • XX-4673/AdminKeySync
  • debugNotifID
  • anne/test
  • v4.7.5
  • v4.7.4
  • v4.7.3
  • v4.7.2
  • v4.7.1
  • v4.6.3
  • v4.6.1
  • v4.5.0
  • v4.4.4
  • v4.3.11
  • v4.3.8
  • v4.3.7
  • v4.3.6
  • v4.3.5
  • v4.2.0
  • v4.3.0
  • v4.3.4
  • v4.3.3
  • v4.3.2
  • v4.3.1
41 results

switchboard.go

Blame
  • sendCmix_test.go 925 B
    package cmix
    
    import (
    	"gitlab.com/elixxir/client/cmix/message"
    	"gitlab.com/elixxir/primitives/format"
    	"gitlab.com/xx_network/crypto/csprng"
    	"gitlab.com/xx_network/primitives/id"
    	"testing"
    )
    
    func TestClient_SendCMIX(t *testing.T) {
    	c, err := newTestClient(t)
    	if err != nil {
    		t.Fatalf("Failed to create test client: %+v", err)
    	}
    
    	recipientID := id.NewIdFromString("zezima", id.User, t)
    	contents := []byte("message")
    	fp := format.NewFingerprint(contents)
    	service := message.GetDefaultService(recipientID)
    	mac := make([]byte, 32)
    	_, err = csprng.NewSystemRNG().Read(mac)
    	if err != nil {
    		t.Errorf("Failed to read random mac bytes: %+v", err)
    	}
    	mac[0] = 0
    	params := GetDefaultCMIXParams()
    	rid, eid, err := c.Send(recipientID, fp, service, contents, mac, params)
    	if err != nil {
    		t.Errorf("Failed to sendcmix: %+v", err)
    		t.FailNow()
    	}
    	t.Logf("Test of Send returned:\n\trid: %v\teid: %+v", rid, eid)
    }