status-desktop
status-desktop copied to clipboard
Check the router logic
Within this issue we should go step by step through the router logic and confirm that it returns the appropriate routes for all different input values.
Some things to check/improve:
- the routing algorithm at the first step should find all potentially possible routes based on set parameters and how much each of them costs (which is
candidates
array in the current implementation) - the second step should check if the cheapest route is selected as the best one (it should be like that in the current implementation)
- after selecting the cheapest route we should check if there are enough balances to pay everything needed for all routes, at the current implementation
nativeBalance
is compared torequiredNativeBalance
per route, but if there need to be multiple routes (transactions) current code always use the current value, doesn't subtract amount needed for previous trasactions