diff --git a/services/wallet/router/filter_test.go b/services/wallet/router/filter_test.go index 591f02a3a..aca02f6cb 100644 --- a/services/wallet/router/filter_test.go +++ b/services/wallet/router/filter_test.go @@ -201,3 +201,31 @@ func TestHasSufficientCapacityV2(t *testing.T) { }) } } + +func TestFilterNetworkComplianceV2(t *testing.T) { + fromLockedAmount := map[uint64]*hexutil.Big{ + 1: (*hexutil.Big)(big.NewInt(100)), + 2: (*hexutil.Big)(big.NewInt(0)), + } + + routes := [][]*PathV2{ + { + {From: ¶ms.Network{ChainID: 1}}, + {From: ¶ms.Network{ChainID: 3}}, + }, + { + {From: ¶ms.Network{ChainID: 2}}, + {From: ¶ms.Network{ChainID: 3}}, + }, + } + + expectedRoutes := [][]*PathV2{ + { + {From: ¶ms.Network{ChainID: 1}}, + {From: ¶ms.Network{ChainID: 3}}, + }, + } + + filteredRoutes := filterNetworkComplianceV2(routes, fromLockedAmount) + assert.Equal(t, expectedRoutes, filteredRoutes) +}