mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 15:35:10 +01:00
add fee report model
This commit is contained in:
@@ -126,9 +126,7 @@ public class ChannelController {
|
||||
}
|
||||
|
||||
private FeeReportDto getFeeReportDto(ChannelId channelId) {
|
||||
Coins earned = feeService.getEarnedFeesForChannel(channelId);
|
||||
Coins sourced = feeService.getSourcedFeesForChannel(channelId);
|
||||
return new FeeReportDto(earned, sourced);
|
||||
return FeeReportDto.createFrom(feeService.getFeeReportForChannel(channelId));
|
||||
}
|
||||
|
||||
private PoliciesDto getPoliciesForChannel(@Nullable LocalChannel channel) {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class NodeController {
|
||||
}
|
||||
|
||||
private FeeReportDto getFeeReportDto(Pubkey pubkey) {
|
||||
return new FeeReportDto(feeService.getEarnedFeesForPeer(pubkey), feeService.getSourcedFeesForPeer(pubkey));
|
||||
return FeeReportDto.createFrom(feeService.getFeeReportForPeer(pubkey));
|
||||
}
|
||||
|
||||
private List<ChannelId> toSortedList(Set<? extends Channel> channels) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.cotto.lndmanagej.controller.dto;
|
||||
|
||||
import de.cotto.lndmanagej.model.Coins;
|
||||
import de.cotto.lndmanagej.model.FeeReport;
|
||||
|
||||
public record FeeReportDto(String earned, String sourced) {
|
||||
public FeeReportDto(Coins earned, Coins sourced) {
|
||||
@@ -9,4 +10,8 @@ public record FeeReportDto(String earned, String sourced) {
|
||||
String.valueOf(sourced.milliSatoshis())
|
||||
);
|
||||
}
|
||||
|
||||
public static FeeReportDto createFrom(FeeReport feeReport) {
|
||||
return new FeeReportDto(feeReport.earned(), feeReport.sourced());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user