mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 15:35:10 +01:00
add convenience method
This commit is contained in:
@@ -2,4 +2,8 @@ package de.cotto.lndmanagej.model;
|
||||
|
||||
public record Policy(long feeRate, Coins baseFee, boolean enabled) {
|
||||
public static final Policy UNKNOWN = new Policy(0, Coins.NONE, false);
|
||||
|
||||
public boolean disabled() {
|
||||
return !enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,13 @@ class PolicyTest {
|
||||
@Test
|
||||
void enabled() {
|
||||
assertThat(POLICY_1.enabled()).isTrue();
|
||||
assertThat(POLICY_1.disabled()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void disabled() {
|
||||
assertThat(POLICY_DISABLED.enabled()).isFalse();
|
||||
assertThat(POLICY_DISABLED.disabled()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -71,7 +71,7 @@ public class FlowComputation {
|
||||
Set<EdgeWithLiquidityInformation> edgesWithLiquidityInformation = new LinkedHashSet<>();
|
||||
Pubkey ownPubkey = grpcGetInfo.getPubkey();
|
||||
for (DirectedChannelEdge channelEdge : channelEdges) {
|
||||
if (!channelEdge.policy().enabled()) {
|
||||
if (channelEdge.policy().disabled()) {
|
||||
continue;
|
||||
}
|
||||
ChannelId channelId = channelEdge.channelId();
|
||||
|
||||
Reference in New Issue
Block a user