This commit is contained in:
Carsten Otto
2022-05-10 20:12:18 +02:00
committed by Carsten Otto
parent 0d539e16b6
commit 7d0bf9b98e
3 changed files with 23 additions and 13 deletions

View File

@@ -13,7 +13,10 @@ import de.cotto.lndmanagej.ui.dto.OpenChannelDto;
import java.util.Set;
import static de.cotto.lndmanagej.model.FeeReportFixtures.FEE_REPORT;
import static de.cotto.lndmanagej.model.FlowReportFixtures.FLOW_REPORT;
import static de.cotto.lndmanagej.model.OnChainCostsFixtures.ON_CHAIN_COSTS;
import static de.cotto.lndmanagej.model.RebalanceReportFixtures.REBALANCE_REPORT;
public final class ChannelDetailsUtil {
@@ -30,9 +33,9 @@ public final class ChannelDetailsUtil {
channel.balanceInformation(),
OnChainCostsDto.createFromModel(ON_CHAIN_COSTS),
channel.policies(),
FeeReportDto.createFromModel(FeeReportFixtures.FEE_REPORT),
FlowReportDto.createFromModel(FlowReportFixtures.FLOW_REPORT),
RebalanceReportDto.createFromModel(RebalanceReportFixtures.REBALANCE_REPORT),
FeeReportDto.createFromModel(FEE_REPORT),
FlowReportDto.createFromModel(FLOW_REPORT),
RebalanceReportDto.createFromModel(REBALANCE_REPORT),
Set.of("Something is wrong with this channel."));
}

View File

@@ -20,7 +20,12 @@ import java.util.List;
import java.util.Set;
import static de.cotto.lndmanagej.model.BalanceInformationFixtures.BALANCE_INFORMATION;
import static de.cotto.lndmanagej.model.FeeReportFixtures.FEE_REPORT;
import static de.cotto.lndmanagej.model.FlowReportFixtures.FLOW_REPORT;
import static de.cotto.lndmanagej.model.OnChainCostsFixtures.ON_CHAIN_COSTS;
import static de.cotto.lndmanagej.model.OnlineReportFixtures.ONLINE_REPORT;
import static de.cotto.lndmanagej.model.OnlineReportFixtures.ONLINE_REPORT_OFFLINE;
import static de.cotto.lndmanagej.model.RebalanceReportFixtures.REBALANCE_REPORT;
public final class NodeDetailsUtil {
@@ -29,8 +34,7 @@ public final class NodeDetailsUtil {
}
public static NodeDetailsDto createNodeDetails(NodeDto node) {
OnlineReport onlineReport = node.online()
? OnlineReportFixtures.ONLINE_REPORT : OnlineReportFixtures.ONLINE_REPORT_OFFLINE;
OnlineReport onlineReport = node.online() ? ONLINE_REPORT : ONLINE_REPORT_OFFLINE;
return new NodeDetailsDto(
Pubkey.create(node.pubkey()),
node.alias(),
@@ -41,9 +45,9 @@ public final class NodeDetailsUtil {
OnChainCostsDto.createFromModel(ON_CHAIN_COSTS),
BalanceInformationDto.createFromModel(BALANCE_INFORMATION),
OnlineReportDto.createFromModel(onlineReport),
FeeReportDto.createFromModel(FeeReportFixtures.FEE_REPORT),
FlowReportDto.createFromModel(FlowReportFixtures.FLOW_REPORT),
RebalanceReportDto.createFromModel(RebalanceReportFixtures.REBALANCE_REPORT),
FeeReportDto.createFromModel(FEE_REPORT),
FlowReportDto.createFromModel(FLOW_REPORT),
RebalanceReportDto.createFromModel(REBALANCE_REPORT),
Set.of("Something is wrong with this node."));
}
}

View File

@@ -13,6 +13,9 @@ import java.util.List;
import java.util.stream.Collectors;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID_3;
import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY;
import static de.cotto.lndmanagej.model.warnings.ChannelWarningsFixtures.CHANNEL_WARNINGS;
import static de.cotto.lndmanagej.model.warnings.NodeWarningsFixtures.NODE_WARNINGS;
public final class NodeWarningsUtil {
@@ -26,14 +29,14 @@ public final class NodeWarningsUtil {
public static NodesAndChannelsWithWarningsDto createNodeWarnings() {
return new NodesAndChannelsWithWarningsDto(
List.of(new NodeWithWarningsDto(NodeWarningsFixtures.NODE_WARNINGS.warnings().stream()
List.of(new NodeWithWarningsDto(NODE_WARNINGS.warnings().stream()
.map(Warning::description)
.collect(Collectors.toSet()), "WalletOfSatoshi", PubkeyFixtures.PUBKEY),
new NodeWithWarningsDto(NodeWarningsFixtures.NODE_WARNINGS.warnings().stream()
.collect(Collectors.toSet()), "WalletOfSatoshi", PUBKEY),
new NodeWithWarningsDto(NODE_WARNINGS.warnings().stream()
.map(Warning::description)
.collect(Collectors.toSet()), "Albert", PubkeyFixtures.PUBKEY)
.collect(Collectors.toSet()), "Albert", PUBKEY)
),
List.of(new ChannelWithWarningsDto(ChannelWarningsFixtures.CHANNEL_WARNINGS.warnings().stream()
List.of(new ChannelWithWarningsDto(CHANNEL_WARNINGS.warnings().stream()
.map(Warning::description)
.collect(Collectors.toSet()), CHANNEL_ID_3)
)