channeldb/graph_test: ensure policies for an edge have different
timestamps In this commit, we ensure policies for edges we create in TestChanUpdatesInHorizon have different update timestamps. This ensures that there are two entries per edge in the edge update index. Because of this, the test will fail because ChanUpdatesInHorizon will return duplicate channel edges due to looking at all the entries within the edge update index. This will be addressed in a future commit to allow the set of tests to pass once again.
This commit is contained in:
parent
1217992d9d
commit
d3cf3168d2
@ -1398,11 +1398,12 @@ func TestChanUpdatesInHorizon(t *testing.T) {
|
|||||||
t.Fatalf("unable to create channel edge: %v", err)
|
t.Fatalf("unable to create channel edge: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTime := endTime
|
edge1UpdateTime := endTime
|
||||||
endTime = updateTime.Add(time.Second * 10)
|
edge2UpdateTime := edge1UpdateTime.Add(time.Second)
|
||||||
|
endTime = endTime.Add(time.Second * 10)
|
||||||
|
|
||||||
edge1 := newEdgePolicy(
|
edge1 := newEdgePolicy(
|
||||||
chanID.ToUint64(), op, db, updateTime.Unix(),
|
chanID.ToUint64(), op, db, edge1UpdateTime.Unix(),
|
||||||
)
|
)
|
||||||
edge1.Flags = 0
|
edge1.Flags = 0
|
||||||
edge1.Node = node2
|
edge1.Node = node2
|
||||||
@ -1412,7 +1413,7 @@ func TestChanUpdatesInHorizon(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
edge2 := newEdgePolicy(
|
edge2 := newEdgePolicy(
|
||||||
chanID.ToUint64(), op, db, updateTime.Unix(),
|
chanID.ToUint64(), op, db, edge2UpdateTime.Unix(),
|
||||||
)
|
)
|
||||||
edge2.Flags = 1
|
edge2.Flags = 1
|
||||||
edge2.Node = node1
|
edge2.Node = node1
|
||||||
|
Loading…
Reference in New Issue
Block a user