test_: Added testing for filterNetworkComplianceV2

This commit is contained in:
Samuel Hawksby-Robinson 2024-05-17 14:16:37 +01:00
parent 69125cd594
commit 3a50ce0397
1 changed files with 28 additions and 0 deletions

View File

@ -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: &params.Network{ChainID: 1}},
{From: &params.Network{ChainID: 3}},
},
{
{From: &params.Network{ChainID: 2}},
{From: &params.Network{ChainID: 3}},
},
}
expectedRoutes := [][]*PathV2{
{
{From: &params.Network{ChainID: 1}},
{From: &params.Network{ChainID: 3}},
},
}
filteredRoutes := filterNetworkComplianceV2(routes, fromLockedAmount)
assert.Equal(t, expectedRoutes, filteredRoutes)
}