diff --git a/go.mod b/go.mod index 42f566410011d5197eb2db026c950f109ae7a96e..82682082c3544b92dbb197110550df9706a3ffd1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/golang/protobuf v1.4.3 github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect - github.com/liyue201/goqr v0.0.0-20200803022322-df443203d4ea // indirect + github.com/liyue201/goqr v0.0.0-20200803022322-df443203d4ea github.com/magiconair/properties v1.8.4 // indirect github.com/mitchellh/mapstructure v1.4.0 // indirect github.com/pelletier/go-toml v1.8.1 // indirect @@ -23,7 +23,7 @@ require ( gitlab.com/elixxir/crypto v0.0.7-0.20210319231554-b73b6e62ddbc gitlab.com/elixxir/ekv v0.1.4 gitlab.com/elixxir/primitives v0.0.3-0.20210309193003-ef42ebb4800b - gitlab.com/xx_network/comms v0.0.4-0.20210329190058-55f9bdf16249 + gitlab.com/xx_network/comms v0.0.4-0.20210330224545-2d0e07fb64c6 gitlab.com/xx_network/crypto v0.0.5-0.20210319231335-249c6b1aa323 gitlab.com/xx_network/primitives v0.0.4-0.20210309173740-eb8cd411334a golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad diff --git a/go.sum b/go.sum index 5efa6cec60672dc6fdc3e5af3b680d6b586d6c99..fe2dbe97ebd48b3ae98c20af8d093067930748b3 100644 --- a/go.sum +++ b/go.sum @@ -294,6 +294,8 @@ gitlab.com/xx_network/comms v0.0.4-0.20210323205910-f01316c830dd h1:WZn6y52gqigT gitlab.com/xx_network/comms v0.0.4-0.20210323205910-f01316c830dd/go.mod h1:0Hx+zO3Pr4uYw4RZXFnPM3ocjY6bPIKDiHCjWTZLOSI= gitlab.com/xx_network/comms v0.0.4-0.20210329190058-55f9bdf16249 h1:dDcesEGcAzN1C6PP7Y8T0Ky5c4mpRfhVFMZJKBrbQzk= gitlab.com/xx_network/comms v0.0.4-0.20210329190058-55f9bdf16249/go.mod h1:0Hx+zO3Pr4uYw4RZXFnPM3ocjY6bPIKDiHCjWTZLOSI= +gitlab.com/xx_network/comms v0.0.4-0.20210330224545-2d0e07fb64c6 h1:LsxlArrT5mIM5rRbMuNp+PQPWrCbPKhunHO2MfznbsE= +gitlab.com/xx_network/comms v0.0.4-0.20210330224545-2d0e07fb64c6/go.mod h1:0Hx+zO3Pr4uYw4RZXFnPM3ocjY6bPIKDiHCjWTZLOSI= gitlab.com/xx_network/crypto v0.0.3/go.mod h1:DF2HYvvCw9wkBybXcXAgQMzX+MiGbFPjwt3t17VRqRE= gitlab.com/xx_network/crypto v0.0.4 h1:lpKOL5mTJ2awWMfgBy30oD/UvJVrWZzUimSHlOdZZxo= gitlab.com/xx_network/crypto v0.0.4/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk= diff --git a/network/follow.go b/network/follow.go index 8efc1db76a2ba6c3adbe31b8901a094c481909e3..3c05519620d7dce05140d7958f779ab8940f6ade 100644 --- a/network/follow.go +++ b/network/follow.go @@ -46,8 +46,6 @@ const maxChecked = 100000 //comms interface makes testing easier type followNetworkComms interface { GetHost(hostId *id.ID) (*connect.Host, bool) - AddHost(hid *id.ID, address string, cert []byte, params connect.HostParams) (host *connect.Host, err error) - RemoveHost(hid *id.ID) SendPoll(host *connect.Host, message *pb.GatewayPoll) (*pb.GatewayPollResponse, error) } diff --git a/network/gateway/gateway_test.go b/network/gateway/gateway_test.go index 67e46a7e0b3a74c57b73c07025760a6018a699b6..c59930f25d04eb6fe1db10c3b792687fa0d7fbd8 100644 --- a/network/gateway/gateway_test.go +++ b/network/gateway/gateway_test.go @@ -298,8 +298,7 @@ func TestHostPool_PruneHostPool(t *testing.T) { // Construct a host past the error threshold errorThresholdIndex := 0 overThreshold := params.errThreshold + 25 - badMetric := &connect.Metric{ErrCounter: &overThreshold} - hostList[errorThresholdIndex].SetMetricsTesting(badMetric, t) + hostList[errorThresholdIndex].SetMetricsTesting(overThreshold, t) oldHost := hostList[0] // Call prune host pool diff --git a/network/rounds/historical.go b/network/rounds/historical.go index 6bb981fe8f4faf098cf73ba53b13e20cf2d7ecfe..1a0f5c100697044ebdbdaf7975b5019e87be0356 100644 --- a/network/rounds/historical.go +++ b/network/rounds/historical.go @@ -28,8 +28,6 @@ import ( //interface to increase east of testing of historical rounds type historicalRoundsComms interface { GetHost(hostId *id.ID) (*connect.Host, bool) - AddHost(hid *id.ID, address string, cert []byte, params connect.HostParams) (host *connect.Host, err error) - RemoveHost(hid *id.ID) RequestHistoricalRounds(host *connect.Host, message *pb.HistoricalRounds) (*pb.HistoricalRoundsResponse, error) } diff --git a/network/rounds/retrieve.go b/network/rounds/retrieve.go index 8fba340c7c60191b328b4beab9ebc44d2fe10c03..5269357776e9be37984cacfbe31a2208dda912d2 100644 --- a/network/rounds/retrieve.go +++ b/network/rounds/retrieve.go @@ -21,8 +21,6 @@ import ( type messageRetrievalComms interface { GetHost(hostId *id.ID) (*connect.Host, bool) - AddHost(hid *id.ID, address string, cert []byte, params connect.HostParams) (host *connect.Host, err error) - RemoveHost(hid *id.ID) RequestMessages(host *connect.Host, message *pb.GetMessages) (*pb.GetMessagesResponse, error) } diff --git a/network/rounds/utils_test.go b/network/rounds/utils_test.go index 7e538f014c0fe59d800e1f4380cec57660ccd82b..6a5a6b2cadcc80436c55023e657bc7be1aefee34 100644 --- a/network/rounds/utils_test.go +++ b/network/rounds/utils_test.go @@ -42,28 +42,14 @@ const ErrorGateway = "Error" type mockMessageRetrievalComms struct { testingSignature *testing.T - hosts map[string]*connect.Host -} - -func (mmrc *mockMessageRetrievalComms) AddHost(hid *id.ID, address string, cert []byte, params connect.HostParams) (host *connect.Host, err error) { - host, err = connect.NewHost(hid, address, cert, params) - if err != nil { - return nil, err - } - - mmrc.hosts[hid.String()] = host - - return host, err -} - -func (mmrc *mockMessageRetrievalComms) RemoveHost(hid *id.ID) { - return } func (mmrc *mockMessageRetrievalComms) GetHost(hostId *id.ID) (*connect.Host, bool) { - h, ok := mmrc.hosts[hostId.String()] - return h, ok - + h, _ := connect.NewHost(hostId, "0.0.0.0", []byte(""), connect.HostParams{ + MaxRetries: 0, + AuthEnabled: false, + }) + return h, true } // Mock comm which returns differently based on the host ID