routing: extend TestFindRoutesFeeSorting to assert proper fee attributes
This commit is contained in:
parent
c0e88cd8a8
commit
cc3b32c0d4
@ -175,10 +175,21 @@ func TestFindRoutesFeeSorting(t *testing.T) {
|
||||
|
||||
// Exactly, two such paths should be found.
|
||||
if len(routes) != 2 {
|
||||
t.Fatalf("2 routes shouldn't been selected, instead %v were: %v",
|
||||
t.Fatalf("2 routes should've been selected, instead %v were: %v",
|
||||
len(routes), spew.Sdump(routes))
|
||||
}
|
||||
|
||||
// We shouldn't pay a fee for the fist route, but the second route
|
||||
// should have a fee intact.
|
||||
if routes[0].TotalFees != 0 {
|
||||
t.Fatalf("incorrect fees for first route, expected 0 got: %v",
|
||||
routes[0].TotalFees)
|
||||
}
|
||||
if routes[1].TotalFees == 0 {
|
||||
t.Fatalf("total fees not set in second route: ",
|
||||
spew.Sdump(routes[0]))
|
||||
}
|
||||
|
||||
// The paths should properly be ranked according to their total fee
|
||||
// rate.
|
||||
if routes[0].TotalFees > routes[1].TotalFees {
|
||||
|
Loading…
Reference in New Issue
Block a user