Skip to content
Snippets Groups Projects
Commit 1721367e authored by Jake Taylor's avatar Jake Taylor
Browse files

fix some tests

parent abff0cfd
Branches
Tags
No related merge requests found
...@@ -26,8 +26,8 @@ import ( ...@@ -26,8 +26,8 @@ import (
"gitlab.com/xx_network/primitives/utils" "gitlab.com/xx_network/primitives/utils"
) )
const opensslCertDL = ("openssl s_client -showcerts -connect ip:port < " + const opensslCertDL = "openssl s_client -showcerts -connect ip:port < " +
"/dev/null 2>&1 | openssl x509 -outform PEM > certfile.pem") "/dev/null 2>&1 | openssl x509 -outform PEM > certfile.pem"
// getNDFCmd user discovery subcommand, allowing user lookup and registration for // getNDFCmd user discovery subcommand, allowing user lookup and registration for
// allowing others to search. // allowing others to search.
...@@ -36,8 +36,8 @@ const opensslCertDL = ("openssl s_client -showcerts -connect ip:port < " + ...@@ -36,8 +36,8 @@ const opensslCertDL = ("openssl s_client -showcerts -connect ip:port < " +
// commands. // commands.
var getNDFCmd = &cobra.Command{ var getNDFCmd = &cobra.Command{
Use: "getndf", Use: "getndf",
Short: ("Download the network definition file from the network " + Short: "Download the network definition file from the network " +
"and print it."), "and print it.",
Args: cobra.NoArgs, Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
gwHost := viper.GetString("gwhost") gwHost := viper.GetString("gwhost")
...@@ -68,7 +68,7 @@ var getNDFCmd = &cobra.Command{ ...@@ -68,7 +68,7 @@ var getNDFCmd = &cobra.Command{
Hash: nil, Hash: nil,
}, },
LastUpdate: uint64(0), LastUpdate: uint64(0),
ClientID: id.DummyUser.Marshal(), ReceptionID: id.DummyUser.Marshal(),
} }
resp, err := comms.SendPoll(host, pollMsg) resp, err := comms.SendPoll(host, pollMsg)
if err != nil { if err != nil {
......
...@@ -64,7 +64,7 @@ func TestManager_CheckGarbledMessages(t *testing.T) { ...@@ -64,7 +64,7 @@ func TestManager_CheckGarbledMessages(t *testing.T) {
}, nil) }, nil)
e2ekv := i.Session.E2e() e2ekv := i.Session.E2e()
err = e2ekv.AddPartner(sess2.GetUser().ID, sess2.E2e().GetDHPublicKey(), e2ekv.GetDHPrivateKey(), err = e2ekv.AddPartner(sess2.GetUser().ReceptionID, sess2.E2e().GetDHPublicKey(), e2ekv.GetDHPrivateKey(),
params.GetDefaultE2ESessionParams(), params.GetDefaultE2ESessionParams(),
params.GetDefaultE2ESessionParams()) params.GetDefaultE2ESessionParams())
if err != nil { if err != nil {
...@@ -72,7 +72,7 @@ func TestManager_CheckGarbledMessages(t *testing.T) { ...@@ -72,7 +72,7 @@ func TestManager_CheckGarbledMessages(t *testing.T) {
t.FailNow() t.FailNow()
} }
err = sess2.E2e().AddPartner(sess1.GetUser().ID, err = sess2.E2e().AddPartner(sess1.GetUser().ReceptionID,
sess1.E2e().GetDHPublicKey(), sess2.E2e().GetDHPrivateKey(), sess1.E2e().GetDHPublicKey(), sess2.E2e().GetDHPrivateKey(),
params.GetDefaultE2ESessionParams(), params.GetDefaultE2ESessionParams(),
params.GetDefaultE2ESessionParams()) params.GetDefaultE2ESessionParams())
......
...@@ -45,7 +45,7 @@ func (m *Manager) Checker(roundID id.Round, filters []*RemoteFilter, identity re ...@@ -45,7 +45,7 @@ func (m *Manager) Checker(roundID id.Round, filters []*RemoteFilter, identity re
} }
//find filters that could have the round //find filters that could have the round
var potentialFilters []*bloom.Bloom var potentialFilters []*bloom.Ring
for _, filter := range filters { for _, filter := range filters {
if filter.FirstRound() <= roundID && filter.LastRound() >= roundID { if filter.FirstRound() <= roundID && filter.LastRound() >= roundID {
......
...@@ -17,10 +17,10 @@ func NewRemoteFilter(data *mixmessages.ClientBloom) *RemoteFilter { ...@@ -17,10 +17,10 @@ func NewRemoteFilter(data *mixmessages.ClientBloom) *RemoteFilter {
type RemoteFilter struct { type RemoteFilter struct {
data *mixmessages.ClientBloom data *mixmessages.ClientBloom
filter *bloom.Bloom filter *bloom.Ring
} }
func (rf *RemoteFilter) GetFilter() *bloom.Bloom { func (rf *RemoteFilter) GetFilter() *bloom.Ring {
if rf.filter == nil { if rf.filter == nil {
var err error var err error
......
...@@ -562,7 +562,7 @@ func (s *Session) generate(kv *versioned.KV) *versioned.KV { ...@@ -562,7 +562,7 @@ func (s *Session) generate(kv *versioned.KV) *versioned.KV {
numKeys = keysTTL + uint32(p.NumRekeys) numKeys = keysTTL + uint32(p.NumRekeys)
} }
s.ttl = uint32(s.params.NumRekeys) s.ttl = uint32(s.e2eParams.NumRekeys)
//create the new state vectors. This will cause disk operations storing them //create the new state vectors. This will cause disk operations storing them
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment