@@ -1980,9 +1980,9 @@ func TestFilterKnownChanIDs(t *testing.T) {
19801980 t .Fatalf ("unable to create channel edge: %v" , err )
19811981 }
19821982
1983- chanIDs = append (chanIDs , ChannelUpdateInfo {
1984- ShortChannelID : chanID ,
1985- } )
1983+ chanIDs = append (chanIDs , NewChannelUpdateInfo (
1984+ chanID , time. Time {}, time. Time {} ,
1985+ ) )
19861986 }
19871987
19881988 const numZombies = 5
@@ -2024,20 +2024,28 @@ func TestFilterKnownChanIDs(t *testing.T) {
20242024 // should get the same set back.
20252025 {
20262026 queryIDs : []ChannelUpdateInfo {
2027- {ShortChannelID : lnwire.ShortChannelID {
2028- BlockHeight : 99 ,
2029- }},
2030- {ShortChannelID : lnwire.ShortChannelID {
2031- BlockHeight : 100 ,
2032- }},
2027+ {
2028+ ShortChannelID : lnwire.ShortChannelID {
2029+ BlockHeight : 99 ,
2030+ },
2031+ },
2032+ {
2033+ ShortChannelID : lnwire.ShortChannelID {
2034+ BlockHeight : 100 ,
2035+ },
2036+ },
20332037 },
20342038 resp : []ChannelUpdateInfo {
2035- {ShortChannelID : lnwire.ShortChannelID {
2036- BlockHeight : 99 ,
2037- }},
2038- {ShortChannelID : lnwire.ShortChannelID {
2039- BlockHeight : 100 ,
2040- }},
2039+ {
2040+ ShortChannelID : lnwire.ShortChannelID {
2041+ BlockHeight : 99 ,
2042+ },
2043+ },
2044+ {
2045+ ShortChannelID : lnwire.ShortChannelID {
2046+ BlockHeight : 100 ,
2047+ },
2048+ },
20412049 },
20422050 },
20432051
@@ -2419,7 +2427,7 @@ func TestFilterChannelRange(t *testing.T) {
24192427 )
24202428 )
24212429
2422- updateTimeSeed := int64 ( 1 )
2430+ updateTimeSeed := time . Now (). Unix ( )
24232431 maybeAddPolicy := func (chanID uint64 , node * LightningNode ,
24242432 node2 bool ) time.Time {
24252433
@@ -2428,7 +2436,7 @@ func TestFilterChannelRange(t *testing.T) {
24282436 chanFlags = lnwire .ChanUpdateDirection
24292437 }
24302438
2431- var updateTime time.Time
2439+ var updateTime = time .Unix ( 0 , 0 )
24322440 if rand .Int31n (2 ) == 0 {
24332441 updateTime = time .Unix (updateTimeSeed , 0 )
24342442 err = graph .UpdateEdgePolicy (& models.ChannelEdgePolicy {
@@ -2456,11 +2464,16 @@ func TestFilterChannelRange(t *testing.T) {
24562464 )
24572465 require .NoError (t , graph .AddChannelEdge (& channel2 ))
24582466
2467+ chanInfo1 := NewChannelUpdateInfo (
2468+ chanID1 , time.Time {}, time.Time {},
2469+ )
2470+ chanInfo2 := NewChannelUpdateInfo (
2471+ chanID2 , time.Time {}, time.Time {},
2472+ )
24592473 channelRanges = append (channelRanges , BlockChannelRange {
24602474 Height : chanHeight ,
24612475 Channels : []ChannelUpdateInfo {
2462- {ShortChannelID : chanID1 },
2463- {ShortChannelID : chanID2 },
2476+ chanInfo1 , chanInfo2 ,
24642477 },
24652478 })
24662479
@@ -2471,20 +2484,17 @@ func TestFilterChannelRange(t *testing.T) {
24712484 time4 = maybeAddPolicy (channel2 .ChannelID , node2 , true )
24722485 )
24732486
2487+ chanInfo1 = NewChannelUpdateInfo (
2488+ chanID1 , time1 , time2 ,
2489+ )
2490+ chanInfo2 = NewChannelUpdateInfo (
2491+ chanID2 , time3 , time4 ,
2492+ )
24742493 channelRangesWithTimestamps = append (
24752494 channelRangesWithTimestamps , BlockChannelRange {
24762495 Height : chanHeight ,
24772496 Channels : []ChannelUpdateInfo {
2478- {
2479- ShortChannelID : chanID1 ,
2480- Node1UpdateTimestamp : time1 ,
2481- Node2UpdateTimestamp : time2 ,
2482- },
2483- {
2484- ShortChannelID : chanID2 ,
2485- Node1UpdateTimestamp : time3 ,
2486- Node2UpdateTimestamp : time4 ,
2487- },
2497+ chanInfo1 , chanInfo2 ,
24882498 },
24892499 },
24902500 )
0 commit comments