test_: Added testing for filterNetworkComplianceV2
This commit is contained in:
parent
69125cd594
commit
3a50ce0397
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue