Skip to content

Commit

Permalink
channeldb: properly compare payment attempts in serialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Aug 23, 2019
1 parent 64c7a0f commit 441b150
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions channeldb/payments_test.go
Expand Up @@ -205,6 +205,17 @@ func TestSentPaymentSerialization(t *testing.T) {
t.Fatalf("unable to deserialize info: %v", err)
}

// First we verify all the records match up porperly, as they aren't
// able to be properly compared using reflect.DeepEqual.
assertRouteHopRecordsEqual(&s.Route, &newAttemptInfo.Route)

// With the hop recrods, equal, we'll now blank them out as
// reflect.DeepEqual can't properly compare tlv.Record instances.
newAttemptInfo.Route.Hops[0].TLVRecords = nil
newAttemptInfo.Route.Hops[1].TLVRecords = nil
s.Route.Hops[0].TLVRecords = nil
s.Route.Hops[1].TLVRecords = nil

if !reflect.DeepEqual(s, newAttemptInfo) {
s.SessionKey.Curve = nil
newAttemptInfo.SessionKey.Curve = nil
Expand Down

0 comments on commit 441b150

Please sign in to comment.