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

Merge remote-tracking branch 'origin/release' into release

parents 8b94d188 f6780561
No related branches found
No related tags found
No related merge requests found
......@@ -26,5 +26,5 @@ func TrackResults(resultsCh chan ds.EventReturn, numResults int) (bool, int, int
}
}
return (numTimeOut + numRoundFail) > 0, numRoundFail, numTimeOut
return (numTimeOut + numRoundFail) == 0, numRoundFail, numTimeOut
}
......@@ -101,11 +101,7 @@ func (t *testNetworkManagerGeneric) GetStoppable() stoppable.Stoppable {
func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) {
switch i.(type) {
case *testing.T:
break
case *testing.M:
break
case *testing.B:
case *testing.T, *testing.M, *testing.B, *testing.PB:
break
default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......@@ -208,11 +204,7 @@ func (t *testNetworkManagerFullExchange) GetStoppable() stoppable.Stoppable {
func InitTestingContextFullExchange(i interface{}) (*storage.Session, *switchboard.Switchboard, interfaces.NetworkManager) {
switch i.(type) {
case *testing.T:
break
case *testing.M:
break
case *testing.B:
case *testing.T, *testing.M, *testing.B, *testing.PB:
break
default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......
......@@ -64,10 +64,10 @@ func track(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
protoIds, err := ephemeral.GetIdsByRange(ourId, receptionStore.GetIDSize(),
now, now.Sub(lastCheck))
jww.INFO.Printf("Now: %d, LastCheck: %v (%v), Different: %v (%v)",
jww.DEBUG.Printf("Now: %d, LastCheck: %v (%v), Different: %v (%v)",
now.UnixNano(), lastCheck, lastCheck, now.Sub(lastCheck), now.Sub(lastCheck))
jww.INFO.Printf("protoIds Count: %d", len(protoIds))
jww.DEBUG.Printf("protoIds Count: %d", len(protoIds))
if err != nil {
jww.FATAL.Panicf("Could not generate "+
......@@ -80,6 +80,10 @@ func track(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
jww.INFO.Printf("Number of Identities Generated: %d",
len(identities))
jww.INFO.Printf("Current Identity: %d (source: %s), Start: %s, End: %s",
identities[len(identities)-1].EphId.Int64(), identities[len(identities)-1].Source,
identities[len(identities)-1].StartValid, identities[len(identities)-1].EndValid)
// Add identities to storage if unique
for _, identity := range identities {
// Track if identity has been generated already
......@@ -147,7 +151,9 @@ func generateIdentities(protoIds []ephemeral.ProtoIdentity,
// then the current time is stored
func checkTimestampStore(session *storage.Session) error {
if _, err := session.Get(TimestampKey); err != nil {
now, err := marshalTimestamp(time.Unix(0, 0))
// only generate from the last hour because this is a new id, it
// couldn't receive messages yet
now, err := marshalTimestamp(time.Now().Add(-1*time.Hour))
if err != nil {
return errors.Errorf("Could not marshal new timestamp for storage: %v", err)
}
......
......@@ -85,6 +85,8 @@ func sendCmixHelper(msg format.Message, recipient *id.ID, param params.CMIX, ins
jww.FATAL.Panicf("Failed to generate ephemeral ID: %+v", err)
}
jww.INFO.Printf("Sending to EphID %v (source: %s)", ephID.Int64(), recipient)
stream := rng.GetStream()
ephID, err = ephID.Fill(uint(bestRound.AddressSpaceSize), stream)
if err != nil {
......
......@@ -243,11 +243,7 @@ func getSessionIDFromBaseKey(baseKey *cyclic.Int) SessionID {
// FOR TESTING PURPOSES ONLY
func GetSessionIDFromBaseKeyForTesting(baseKey *cyclic.Int, i interface{}) SessionID {
switch i.(type) {
case *testing.T:
break
case *testing.M:
break
case *testing.B:
case *testing.T, *testing.M, *testing.B, *testing.PB:
break
default:
globals.Log.FATAL.Panicf("GetSessionIDFromBaseKeyForTesting is restricted to testing only. Got %T", i)
......
......@@ -290,11 +290,7 @@ func (s *Session) Delete(key string) error {
// FOR TESTING ONLY
func InitTestingSession(i interface{}) *Session {
switch i.(type) {
case *testing.T:
break
case *testing.M:
break
case *testing.B:
case *testing.T, *testing.M, *testing.B, *testing.PB:
break
default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......
......@@ -2,10 +2,10 @@ package ud
import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/messages"
jww "github.com/spf13/jwalterweatherman"
)
type confirmFactComm interface {
......
......@@ -2,11 +2,11 @@ package ud
import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/primitives/fact"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/messages"
jww "github.com/spf13/jwalterweatherman"
)
type removeFactComms interface {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment