mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-20 14:34:24 +01:00
add toString
This commit is contained in:
@@ -124,6 +124,15 @@ public class Route {
|
||||
return Objects.hash(edgesWithLiquidityInformation, amount, feesForHops);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Route{" +
|
||||
"edgesWithLiquidityInformation=" + edgesWithLiquidityInformation +
|
||||
", amount=" + amount +
|
||||
", feesForHops=" + feesForHops +
|
||||
'}';
|
||||
}
|
||||
|
||||
private static List<Coins> computeFees(List<EdgeWithLiquidityInformation> edges, Coins amount) {
|
||||
Coins fees = Coins.NONE;
|
||||
Coins amountWithFees = amount;
|
||||
|
||||
@@ -466,6 +466,16 @@ class RouteTest {
|
||||
EqualsVerifier.forClass(Route.class).usingGetClass().verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToString() {
|
||||
assertThat(ROUTE).hasToString("Route{edgesWithLiquidityInformation=[" +
|
||||
EdgeWithLiquidityInformation.forUpperBound(EDGE, EDGE.capacity()) + ", " +
|
||||
EdgeWithLiquidityInformation.forUpperBound(EDGE_2_3, EDGE_2_3.capacity()) + ", " +
|
||||
EdgeWithLiquidityInformation.forUpperBound(EDGE_3_4, EDGE_3_4.capacity()) +
|
||||
"], amount=100.000, feesForHops=[0.020, 0.020, 0.000]}"
|
||||
);
|
||||
}
|
||||
|
||||
private Route routeForAmountAndCapacityAndKnownLiquidity(int amountSat, int capacitySat, int knownLiquiditySat) {
|
||||
Coins capacity = Coins.ofSatoshis(capacitySat);
|
||||
Coins amount = Coins.ofSatoshis(amountSat);
|
||||
|
||||
Reference in New Issue
Block a user