Skip to content
Snippets Groups Projects

built the system to sequentually pick up old ephemerals, breaks interfaces and tests

Merged Richard T. Carback III requested to merge delayedOldPickup into release
3 unresolved threads
1 file
+ 29
10
Compare changes
  • Side-by-side
  • Inline
@@ -11,6 +11,13 @@ import (
"bytes"
"crypto/ed25519"
"encoding/binary"
"math/rand"
"reflect"
"sort"
"strconv"
"testing"
"time"
"gitlab.com/elixxir/client/broadcast"
clientCmix "gitlab.com/elixxir/client/cmix"
"gitlab.com/elixxir/client/cmix/message"
@@ -24,12 +31,6 @@ import (
"gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/ephemeral"
"math/rand"
"reflect"
"sort"
"strconv"
"testing"
"time"
)
// Tests that manager.store stores the channel list in the ekv.
@@ -143,9 +144,19 @@ func Test_manager_loadChannels(t *testing.T) {
t.Errorf("Channel %s does not exist.", &chID)
}
if !reflect.DeepEqual(ch.broadcast, loadedCh.broadcast) {
expected := ch.broadcast.Get()
received := loadedCh.broadcast.Get()
// NOTE: Times don't compare properly after
// marshalling due to the monotonic counter
if expected.Created.Equal(received.Created) {
expected.Created = received.Created
}
if !reflect.DeepEqual(expected, received) {
t.Errorf("Channel %s does not match loaded channel."+
"\nexpected: %+v\nreceived: %+v", &chID, ch.broadcast, loadedCh.broadcast)
"\nexpected: %+v\nreceived: %+v", &chID,
expected, received)
}
}
}
@@ -507,9 +518,17 @@ func Test_loadJoinedChannel(t *testing.T) {
t.Errorf("Failed to load joinedChannel: %+v", err)
}
if !reflect.DeepEqual(ch, loadedJc.broadcast.Get()) {
expected := *ch
received := *loadedJc.broadcast.Get()
// NOTE: Times don't compare properly after marshalling due to the
// monotonic counter
if expected.Created.Equal(received.Created) {
expected.Created = received.Created
}
if !reflect.DeepEqual(expected, received) {
t.Errorf("Loaded joinedChannel does not match original."+
"\nexpected: %+v\nreceived: %+v", ch, loadedJc.broadcast.Get())
"\nexpected: %+v\nreceived: %+v", expected, received)
}
}
Loading