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

Fix test, small refactor

parent ca42e35a
No related branches found
No related tags found
2 merge requests!170Release,!145Hotfix/alt udb
......@@ -20,7 +20,7 @@ require (
github.com/spf13/viper v1.7.1
gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228
gitlab.com/elixxir/comms v0.0.4-0.20220128144348-f01dc3227d76
gitlab.com/elixxir/crypto v0.0.7-0.20220208225807-4ca94bd92105
gitlab.com/elixxir/crypto v0.0.7-0.20220208232308-f2bee37935e3
gitlab.com/elixxir/ekv v0.1.6
gitlab.com/elixxir/primitives v0.0.3-0.20220104173924-275cb9d7834f
gitlab.com/xx_network/comms v0.0.4-0.20220126231737-fe2338016cce
......
......@@ -272,6 +272,8 @@ github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0=
github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0BJIk1HIzBVMjWNjIUfstrsXC2VqLYPcA=
gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k=
gitlab.com/elixxir/comms v0.0.4-0.20220128144348-f01dc3227d76 h1:bmc/tvLJOIciHRCcRhkZqYKDcH4F503BKUitocEcQk0=
gitlab.com/elixxir/comms v0.0.4-0.20220128144348-f01dc3227d76/go.mod h1:pj1TXrpHKytF68y53BtCBRYhaiMJWquuVBk4iEN7wkk=
gitlab.com/elixxir/comms v0.0.4-0.20220128193157-34178165415d h1:207Okb8+amKnRzsKE/4ehl3eb6ZHkWXevq9TimOehzw=
gitlab.com/elixxir/comms v0.0.4-0.20220128193157-34178165415d/go.mod h1:pj1TXrpHKytF68y53BtCBRYhaiMJWquuVBk4iEN7wkk=
gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c=
......@@ -282,6 +284,8 @@ gitlab.com/elixxir/crypto v0.0.7-0.20220208225325-dbdeafce872f h1:pYw+i7SHvRtE7r
gitlab.com/elixxir/crypto v0.0.7-0.20220208225325-dbdeafce872f/go.mod h1:WyLFCxOOgaCHElpH0Ha893tfjxg3HXYU7lSJz2M4JUE=
gitlab.com/elixxir/crypto v0.0.7-0.20220208225807-4ca94bd92105 h1:nuYixTwkX6rAw+9RJ6HBk+8bHVrSbV16vxVOexCyK6s=
gitlab.com/elixxir/crypto v0.0.7-0.20220208225807-4ca94bd92105/go.mod h1:WyLFCxOOgaCHElpH0Ha893tfjxg3HXYU7lSJz2M4JUE=
gitlab.com/elixxir/crypto v0.0.7-0.20220208232308-f2bee37935e3 h1:n6CgqQLrYkIWxgbxuDxjE7qNHIeB0EUEnakisf6C0Ng=
gitlab.com/elixxir/crypto v0.0.7-0.20220208232308-f2bee37935e3/go.mod h1:WyLFCxOOgaCHElpH0Ha893tfjxg3HXYU7lSJz2M4JUE=
gitlab.com/elixxir/ekv v0.1.6 h1:M2hUSNhH/ChxDd+s8xBqSEKgoPtmE6hOEBqQ73KbN6A=
gitlab.com/elixxir/ekv v0.1.6/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4=
gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg=
......
......@@ -113,7 +113,11 @@ func (m *Manager) SetAlternativeUserDiscovery(altCert, altAddress, contactFile [
params := connect.GetDefaultHostParams()
params.AuthEnabled = false
udIdBytes, dhPubKey := contact.ReadContactFromFile(contactFile)
udIdBytes, dhPubKey, err := contact.ReadContactFromFile(contactFile)
if err != nil {
return err
}
udID, err := id.Unmarshal(udIdBytes)
if err != nil {
return err
......
......@@ -11,7 +11,6 @@ import (
"gitlab.com/elixxir/comms/client"
"gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/primitives/id"
"testing"
)
......@@ -51,6 +50,8 @@ EnretBzQkeKeBwoB2u6NTiOmUjk=
-----END CERTIFICATE-----
`
var testContact = `<xxc(2)LF2ccT+sdqh0AIKlFFeDOJdnxzbQQYhGStgxhOXmijIDkAZiB9kZo+Dl3bRSbBi5pXZ82rOu2IQXz9+5sspChvoccZqgC/dXGhlesmiNy/EbKxWtptTF4tcNyQxtnmCXg1p/HwKey4G2XDekTw86lq6Lpmj72jozvRWlQisqvWz/5deiPaeFGKDKC0OrrDFnIib7WnKqdYt4XyTKdmObnmbvdCbliZq0zBl7J40qKy5FypYXGlZjStIm0R1qtD4XHMZMsrMJEGxdM55zJdSzknXbR8MNahUrGMyUOTivXLHzojYLht0gFQifKMVWhrDjUoVQV43KOLPmdBwY/2Kc5KvVloDeuDXYY0i7tD63gNIp9JA3gJQUJymDdwqbS13riT1DMHHkdTzKEyGdHS+v2l7AVSlJBiTKuyM00FBNuXhhIcFR7ONFCf8cRPOPPBx3Q6iHNsvsca3KPNhwOJBgaQvHSkjIMsudiR954QbwG9rbi2vxVobIgWYMl5j6vlBS/9rfbE/uLdTEQZfNsLKDCIVCCI4I1bYZxZrDLPrfXTrN6W0sCLE7a/kRBQAAAgA7+LwJqiv9O1ogLnS4TYkSEg==xxc>`
func TestManager_SetAlternativeUserDiscovery(t *testing.T) {
isReg := uint32(1)
......@@ -74,10 +75,8 @@ func TestManager_SetAlternativeUserDiscovery(t *testing.T) {
registered: &isReg,
}
altId := id.NewIdFromBytes([]byte("test"), t)
altAddr := "0.0.0.0:11420"
altDhPubKey := []byte("dhPubKey")
err = m.SetAlternativeUserDiscovery(altId.Bytes(), []byte(testCert), []byte(altAddr), altDhPubKey)
err = m.SetAlternativeUserDiscovery([]byte(testCert), []byte(altAddr), []byte(testContact))
if err != nil {
t.Fatalf("Unexpected error in SetAlternativeUserDiscovery: %v", err)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment