diff --git a/README.md b/README.md index b428b701..7e54790c 100644 --- a/README.md +++ b/README.md @@ -62,18 +62,18 @@ Channel specific: `/api/channel/{ID}/` (where `{ID}` is the channel ID) followed * `balance`: the channel balance (for local/remote each: balance, available, reserve) * `policies`: local and remote fee rate, base fee, and enabled boolean * `close-details` (only for closed channels): close initiator, close height, force boolean, breach boolean - * `fee-report`: satoshis earned by forwarding payments leaving out through the channel (`earned`) or coming in from the channel (`sourced`) + * `fee-report`: milli-satoshis earned by forwarding payments leaving out through the channel (`earnedMilliSat`) or coming in from the channel (`sourcedMilliSat`) * `flow-report`: amounts flowing through the channel, broken down into different categories * `flow-report/last-days/{DAYS}`: as above, but limited to the last `{DAYS}` days - * `open-costs`: the on-chain costs you paid to open the channel - * `close-costs`: the on-chain costs you paid to close the channel - * `sweep-costs`: the on-chain costs you paid to sweep funds after a force-close (this may be negative) - * `rebalance-source-costs`: the fees you paid to rebalance the channel, taking funds out of it - * `rebalance-source-amount`: the amount of funds you took out of the channel as part of rebalancing - * `rebalance-target-costs`: the fees you paid to rebalance the channel, putting funds into it - * `rebalance-target-amount`: the amount of funds you put into the channel as part of rebalancing - * `rebalance-support-as-source-amount`: the amount of funds you took out of the channel as part of rebalancing another channel - * `rebalance-support-as-target-amount`: the amount of funds you put into the channel as part of rebalancing another channel + * `open-costs`: the on-chain costs you paid to open the channel (in satoshis) + * `close-costs`: the on-chain costs you paid to close the channel (in satoshis) + * `sweep-costs`: the on-chain costs you paid to sweep funds after a force-close (this may be negative) (in satoshis) + * `rebalance-source-costs`: the fees you paid to rebalance the channel, taking funds out of it (in milli-satoshis) + * `rebalance-source-amount`: the amount of funds you took out of the channel as part of rebalancing (in milli-satoshis) + * `rebalance-target-costs`: the fees you paid to rebalance the channel, putting funds into it (in milli-satoshis) + * `rebalance-target-amount`: the amount of funds you put into the channel as part of rebalancing (in milli-satoshis) + * `rebalance-support-as-source-amount`: the amount of funds you took out of the channel as part of rebalancing another channel (in milli-satoshis) + * `rebalance-support-as-target-amount`: the amount of funds you put into the channel as part of rebalancing another channel (in milli-satoshis) * `self-payments-from-channel`: a list of all self-payments taking funds out of the channel (including payment details and a summary) * `self-payments-to-channel`: a list of all self-payments putting funds into the channel (including payment details and a summary) * `warnings`: shows the following warnings, if applicable diff --git a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/ChannelControllerIT.java b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/ChannelControllerIT.java index 2e6d0e2a..c2203d9b 100644 --- a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/ChannelControllerIT.java +++ b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/ChannelControllerIT.java @@ -93,9 +93,9 @@ class ChannelControllerIT { .andExpect(jsonPath("$.channelIdCompactLnd", is(CHANNEL_ID_2.getCompactFormLnd()))) .andExpect(jsonPath("$.channelPoint", is(CHANNEL_POINT.toString()))) .andExpect(jsonPath("$.remotePubkey", is(PUBKEY_2.toString()))) - .andExpect(jsonPath("$.capacity", is(String.valueOf(CAPACITY.satoshis())))) - .andExpect(jsonPath("$.totalSent", is(String.valueOf(TOTAL_SENT_2.satoshis())))) - .andExpect(jsonPath("$.totalReceived", is(String.valueOf(TOTAL_RECEIVED_2.satoshis())))) + .andExpect(jsonPath("$.capacitySat", is(String.valueOf(CAPACITY.satoshis())))) + .andExpect(jsonPath("$.totalSentSat", is(String.valueOf(TOTAL_SENT_2.satoshis())))) + .andExpect(jsonPath("$.totalReceivedSat", is(String.valueOf(TOTAL_RECEIVED_2.satoshis())))) .andExpect(jsonPath("$.openInitiator", is("REMOTE"))) .andExpect(jsonPath("$.openHeight", is(CHANNEL_ID_2.getBlockHeight()))) .andExpect(jsonPath("$.status.private", is(false))) @@ -109,8 +109,8 @@ class ChannelControllerIT { void getBasicInformation_closed_channel() throws Exception { when(channelService.getLocalChannel(CHANNEL_ID)).thenReturn(Optional.of(CLOSED_CHANNEL)); mockMvc.perform(get(CHANNEL_PREFIX + "/")) - .andExpect(jsonPath("$.totalSent", is("0"))) - .andExpect(jsonPath("$.totalReceived", is("0"))) + .andExpect(jsonPath("$.totalSentSat", is("0"))) + .andExpect(jsonPath("$.totalReceivedSat", is("0"))) .andExpect(jsonPath("$.closeDetails.initiator", is("REMOTE"))) .andExpect(jsonPath("$.closeDetails.height", is(600_000))) .andExpect(jsonPath("$.status.active", is(false))) @@ -134,9 +134,9 @@ class ChannelControllerIT { .andExpect(jsonPath("$.channelPoint", is(CHANNEL_POINT.toString()))) .andExpect(jsonPath("$.remotePubkey", is(PUBKEY_2.toString()))) .andExpect(jsonPath("$.remoteAlias", is(ALIAS))) - .andExpect(jsonPath("$.capacity", is(String.valueOf(CAPACITY.satoshis())))) - .andExpect(jsonPath("$.totalSent", is(String.valueOf(TOTAL_SENT.satoshis())))) - .andExpect(jsonPath("$.totalReceived", is(String.valueOf(TOTAL_RECEIVED.satoshis())))) + .andExpect(jsonPath("$.capacitySat", is(String.valueOf(CAPACITY.satoshis())))) + .andExpect(jsonPath("$.totalSentSat", is(String.valueOf(TOTAL_SENT.satoshis())))) + .andExpect(jsonPath("$.totalReceivedSat", is(String.valueOf(TOTAL_RECEIVED.satoshis())))) .andExpect(jsonPath("$.openInitiator", is("LOCAL"))) .andExpect(jsonPath("$.openHeight", is(CHANNEL_ID.getBlockHeight()))) .andExpect(jsonPath("$.status.private", is(true))) @@ -144,40 +144,40 @@ class ChannelControllerIT { .andExpect(jsonPath("$.status.closed", is(false))) .andExpect(jsonPath("$.status.openClosed", is("OPEN"))) .andExpect(jsonPath("$.numUpdates", is(NUM_UPDATES))) - .andExpect(jsonPath("$.onChainCosts.openCosts", is("1000"))) - .andExpect(jsonPath("$.onChainCosts.closeCosts", is("2000"))) - .andExpect(jsonPath("$.onChainCosts.sweepCosts", is("3000"))) + .andExpect(jsonPath("$.onChainCosts.openCostsSat", is("1000"))) + .andExpect(jsonPath("$.onChainCosts.closeCostsSat", is("2000"))) + .andExpect(jsonPath("$.onChainCosts.sweepCostsSat", is("3000"))) .andExpect(jsonPath("$.rebalanceReport.sourceCosts", is("1001000"))) .andExpect(jsonPath("$.rebalanceReport.sourceAmount", is("666000"))) .andExpect(jsonPath("$.rebalanceReport.targetCosts", is("2001000"))) .andExpect(jsonPath("$.rebalanceReport.targetAmount", is("992000"))) .andExpect(jsonPath("$.rebalanceReport.supportAsSourceAmount", is("101000"))) .andExpect(jsonPath("$.rebalanceReport.supportAsTargetAmount", is("201000"))) - .andExpect(jsonPath("$.balance.localBalance", is("1000"))) - .andExpect(jsonPath("$.balance.localReserve", is("100"))) - .andExpect(jsonPath("$.balance.localAvailable", is("900"))) - .andExpect(jsonPath("$.balance.remoteBalance", is("123"))) - .andExpect(jsonPath("$.balance.remoteReserve", is("10"))) - .andExpect(jsonPath("$.balance.remoteAvailable", is("113"))) + .andExpect(jsonPath("$.balance.localBalanceSat", is("1000"))) + .andExpect(jsonPath("$.balance.localReserveSat", is("100"))) + .andExpect(jsonPath("$.balance.localAvailableSat", is("900"))) + .andExpect(jsonPath("$.balance.remoteBalanceSat", is("123"))) + .andExpect(jsonPath("$.balance.remoteReserveSat", is("10"))) + .andExpect(jsonPath("$.balance.remoteAvailableSat", is("113"))) .andExpect(jsonPath("$.policies.local.enabled", is(false))) .andExpect(jsonPath("$.policies.remote.enabled", is(true))) .andExpect(jsonPath("$.policies.local.feeRatePpm", is(100))) .andExpect(jsonPath("$.policies.local.baseFeeMilliSat", is(10))) .andExpect(jsonPath("$.policies.remote.feeRatePpm", is(222))) .andExpect(jsonPath("$.policies.remote.baseFeeMilliSat", is(0))) - .andExpect(jsonPath("$.feeReport.earned", is("1234"))) - .andExpect(jsonPath("$.feeReport.sourced", is("567"))) - .andExpect(jsonPath("$.flowReport.forwardedSent", is("1000"))) - .andExpect(jsonPath("$.flowReport.forwardedReceived", is("2000"))) - .andExpect(jsonPath("$.flowReport.forwardingFeesReceived", is("10"))) - .andExpect(jsonPath("$.flowReport.rebalanceSent", is("60000"))) - .andExpect(jsonPath("$.flowReport.rebalanceFeesSent", is("4"))) - .andExpect(jsonPath("$.flowReport.rebalanceReceived", is("61000"))) - .andExpect(jsonPath("$.flowReport.rebalanceSupportSent", is("9000"))) - .andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSent", is("2"))) - .andExpect(jsonPath("$.flowReport.rebalanceSupportReceived", is("10"))) - .andExpect(jsonPath("$.flowReport.totalSent", is("70006"))) - .andExpect(jsonPath("$.flowReport.totalReceived", is("63020"))) + .andExpect(jsonPath("$.feeReport.earnedMilliSat", is("1234"))) + .andExpect(jsonPath("$.feeReport.sourcedMilliSat", is("567"))) + .andExpect(jsonPath("$.flowReport.forwardedSentMilliSat", is("1000"))) + .andExpect(jsonPath("$.flowReport.forwardedReceivedMilliSat", is("2000"))) + .andExpect(jsonPath("$.flowReport.forwardingFeesReceivedMilliSat", is("10"))) + .andExpect(jsonPath("$.flowReport.rebalanceSentMilliSat", is("60000"))) + .andExpect(jsonPath("$.flowReport.rebalanceFeesSentMilliSat", is("4"))) + .andExpect(jsonPath("$.flowReport.rebalanceReceivedMilliSat", is("61000"))) + .andExpect(jsonPath("$.flowReport.rebalanceSupportSentMilliSat", is("9000"))) + .andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSentMilliSat", is("2"))) + .andExpect(jsonPath("$.flowReport.rebalanceSupportReceivedMilliSat", is("10"))) + .andExpect(jsonPath("$.flowReport.totalSentMilliSat", is("70006"))) + .andExpect(jsonPath("$.flowReport.totalReceivedMilliSat", is("63020"))) .andExpect(jsonPath("$.warnings", containsInAnyOrder( "Channel has accumulated 101,000 updates" ))); @@ -191,16 +191,16 @@ class ChannelControllerIT { .andExpect(jsonPath("$.closeDetails.initiator", is("REMOTE"))) .andExpect(jsonPath("$.closeDetails.height", is(600_000))) .andExpect(jsonPath("$.status.openClosed", is("CLOSED"))) - .andExpect(jsonPath("$.totalSent", is("0"))) - .andExpect(jsonPath("$.totalReceived", is("0"))) + .andExpect(jsonPath("$.totalSentSat", is("0"))) + .andExpect(jsonPath("$.totalReceivedSat", is("0"))) .andExpect(jsonPath("$.status.active", is(false))) .andExpect(jsonPath("$.status.closed", is(true))) - .andExpect(jsonPath("$.balance.localBalance", is("0"))) - .andExpect(jsonPath("$.balance.localReserve", is("0"))) - .andExpect(jsonPath("$.balance.localAvailable", is("0"))) - .andExpect(jsonPath("$.balance.remoteBalance", is("0"))) - .andExpect(jsonPath("$.balance.remoteReserve", is("0"))) - .andExpect(jsonPath("$.balance.remoteAvailable", is("0"))) + .andExpect(jsonPath("$.balance.localBalanceSat", is("0"))) + .andExpect(jsonPath("$.balance.localReserveSat", is("0"))) + .andExpect(jsonPath("$.balance.localAvailableSat", is("0"))) + .andExpect(jsonPath("$.balance.remoteBalanceSat", is("0"))) + .andExpect(jsonPath("$.balance.remoteReserveSat", is("0"))) + .andExpect(jsonPath("$.balance.remoteAvailableSat", is("0"))) .andExpect(jsonPath("$.policies.local.enabled", is(false))) .andExpect(jsonPath("$.policies.remote.enabled", is(false))); } @@ -216,12 +216,12 @@ class ChannelControllerIT { void getBalance() throws Exception { when(balanceService.getBalanceInformation(CHANNEL_ID)).thenReturn(Optional.of(BALANCE_INFORMATION_2)); mockMvc.perform(get(CHANNEL_PREFIX + "/balance")) - .andExpect(jsonPath("$.localBalance", is("2000"))) - .andExpect(jsonPath("$.localReserve", is("200"))) - .andExpect(jsonPath("$.localAvailable", is("1800"))) - .andExpect(jsonPath("$.remoteBalance", is("223"))) - .andExpect(jsonPath("$.remoteReserve", is("20"))) - .andExpect(jsonPath("$.remoteAvailable", is("203"))); + .andExpect(jsonPath("$.localBalanceSat", is("2000"))) + .andExpect(jsonPath("$.localReserveSat", is("200"))) + .andExpect(jsonPath("$.localAvailableSat", is("1800"))) + .andExpect(jsonPath("$.remoteBalanceSat", is("223"))) + .andExpect(jsonPath("$.remoteReserveSat", is("20"))) + .andExpect(jsonPath("$.remoteAvailableSat", is("203"))); } @Test @@ -271,7 +271,7 @@ class ChannelControllerIT { void getFeeReport() throws Exception { when(feeService.getFeeReportForChannel(CHANNEL_ID)).thenReturn(FEE_REPORT); mockMvc.perform(get(CHANNEL_PREFIX + "/fee-report")) - .andExpect(jsonPath("$.earned", is("1234"))) - .andExpect(jsonPath("$.sourced", is("567"))); + .andExpect(jsonPath("$.earnedMilliSat", is("1234"))) + .andExpect(jsonPath("$.sourcedMilliSat", is("567"))); } } \ No newline at end of file diff --git a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/FlowControllerIT.java b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/FlowControllerIT.java index 26721283..0dd9f5e6 100644 --- a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/FlowControllerIT.java +++ b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/FlowControllerIT.java @@ -39,17 +39,17 @@ class FlowControllerIT { void getFlowReport_for_channel() throws Exception { when(flowService.getFlowReportForChannel(CHANNEL_ID)).thenReturn(FLOW_REPORT_2); mockMvc.perform(get(CHANNEL_PREFIX + "/flow-report")) - .andExpect(jsonPath("$.forwardedSent", is("1000"))) - .andExpect(jsonPath("$.forwardedReceived", is("2000"))) - .andExpect(jsonPath("$.forwardingFeesReceived", is("10"))) - .andExpect(jsonPath("$.rebalanceSent", is("60000"))) - .andExpect(jsonPath("$.rebalanceFeesSent", is("4"))) - .andExpect(jsonPath("$.rebalanceReceived", is("61000"))) - .andExpect(jsonPath("$.rebalanceSupportSent", is("9000"))) - .andExpect(jsonPath("$.rebalanceSupportFeesSent", is("2"))) - .andExpect(jsonPath("$.rebalanceSupportReceived", is("10"))) - .andExpect(jsonPath("$.totalSent", is("70006"))) - .andExpect(jsonPath("$.totalReceived", is("63020"))); + .andExpect(jsonPath("$.forwardedSentMilliSat", is("1000"))) + .andExpect(jsonPath("$.forwardedReceivedMilliSat", is("2000"))) + .andExpect(jsonPath("$.forwardingFeesReceivedMilliSat", is("10"))) + .andExpect(jsonPath("$.rebalanceSentMilliSat", is("60000"))) + .andExpect(jsonPath("$.rebalanceFeesSentMilliSat", is("4"))) + .andExpect(jsonPath("$.rebalanceReceivedMilliSat", is("61000"))) + .andExpect(jsonPath("$.rebalanceSupportSentMilliSat", is("9000"))) + .andExpect(jsonPath("$.rebalanceSupportFeesSentMilliSat", is("2"))) + .andExpect(jsonPath("$.rebalanceSupportReceivedMilliSat", is("10"))) + .andExpect(jsonPath("$.totalSentMilliSat", is("70006"))) + .andExpect(jsonPath("$.totalReceivedMilliSat", is("63020"))); } @Test @@ -63,17 +63,17 @@ class FlowControllerIT { void getFlowReport_for_peer() throws Exception { when(flowService.getFlowReportForPeer(PUBKEY)).thenReturn(FLOW_REPORT); mockMvc.perform(get(NODE_PREFIX + "/flow-report")) - .andExpect(jsonPath("$.forwardedSent", is("1050000"))) - .andExpect(jsonPath("$.forwardedReceived", is("9001000"))) - .andExpect(jsonPath("$.forwardingFeesReceived", is("1"))) - .andExpect(jsonPath("$.rebalanceSent", is("50000"))) - .andExpect(jsonPath("$.rebalanceFeesSent", is("5"))) - .andExpect(jsonPath("$.rebalanceReceived", is("51000"))) - .andExpect(jsonPath("$.rebalanceSupportSent", is("123"))) - .andExpect(jsonPath("$.rebalanceSupportFeesSent", is("1"))) - .andExpect(jsonPath("$.rebalanceSupportReceived", is("456"))) - .andExpect(jsonPath("$.totalSent", is("1100129"))) - .andExpect(jsonPath("$.totalReceived", is("9052457"))); + .andExpect(jsonPath("$.forwardedSentMilliSat", is("1050000"))) + .andExpect(jsonPath("$.forwardedReceivedMilliSat", is("9001000"))) + .andExpect(jsonPath("$.forwardingFeesReceivedMilliSat", is("1"))) + .andExpect(jsonPath("$.rebalanceSentMilliSat", is("50000"))) + .andExpect(jsonPath("$.rebalanceFeesSentMilliSat", is("5"))) + .andExpect(jsonPath("$.rebalanceReceivedMilliSat", is("51000"))) + .andExpect(jsonPath("$.rebalanceSupportSentMilliSat", is("123"))) + .andExpect(jsonPath("$.rebalanceSupportFeesSentMilliSat", is("1"))) + .andExpect(jsonPath("$.rebalanceSupportReceivedMilliSat", is("456"))) + .andExpect(jsonPath("$.totalSentMilliSat", is("1100129"))) + .andExpect(jsonPath("$.totalReceivedMilliSat", is("9052457"))); } @Test diff --git a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/NodeControllerIT.java b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/NodeControllerIT.java index 5b0a104a..edd56551 100644 --- a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/NodeControllerIT.java +++ b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/NodeControllerIT.java @@ -91,33 +91,33 @@ class NodeControllerIT { .andExpect(jsonPath("$.rebalanceReport.targetAmount", is("991000"))) .andExpect(jsonPath("$.rebalanceReport.supportAsSourceAmount", is("100000"))) .andExpect(jsonPath("$.rebalanceReport.supportAsTargetAmount", is("200000"))) - .andExpect(jsonPath("$.flowReport.forwardedSent", is("1050000"))) - .andExpect(jsonPath("$.flowReport.forwardedReceived", is("9001000"))) - .andExpect(jsonPath("$.flowReport.forwardingFeesReceived", is("1"))) - .andExpect(jsonPath("$.flowReport.rebalanceSent", is("50000"))) - .andExpect(jsonPath("$.flowReport.rebalanceFeesSent", is("5"))) - .andExpect(jsonPath("$.flowReport.rebalanceReceived", is("51000"))) - .andExpect(jsonPath("$.flowReport.rebalanceSupportSent", is("123"))) - .andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSent", is("1"))) - .andExpect(jsonPath("$.flowReport.rebalanceSupportReceived", is("456"))) - .andExpect(jsonPath("$.flowReport.totalSent", is("1100129"))) - .andExpect(jsonPath("$.flowReport.totalReceived", is("9052457"))) - .andExpect(jsonPath("$.balance.localBalance", is("2000"))) - .andExpect(jsonPath("$.balance.localReserve", is("200"))) - .andExpect(jsonPath("$.balance.localAvailable", is("1800"))) - .andExpect(jsonPath("$.balance.remoteBalance", is("223"))) - .andExpect(jsonPath("$.balance.remoteReserve", is("20"))) - .andExpect(jsonPath("$.balance.remoteAvailable", is("203"))) - .andExpect(jsonPath("$.feeReport.earned", is("1234"))) - .andExpect(jsonPath("$.feeReport.sourced", is("567"))) + .andExpect(jsonPath("$.flowReport.forwardedSentMilliSat", is("1050000"))) + .andExpect(jsonPath("$.flowReport.forwardedReceivedMilliSat", is("9001000"))) + .andExpect(jsonPath("$.flowReport.forwardingFeesReceivedMilliSat", is("1"))) + .andExpect(jsonPath("$.flowReport.rebalanceSentMilliSat", is("50000"))) + .andExpect(jsonPath("$.flowReport.rebalanceFeesSentMilliSat", is("5"))) + .andExpect(jsonPath("$.flowReport.rebalanceReceivedMilliSat", is("51000"))) + .andExpect(jsonPath("$.flowReport.rebalanceSupportSentMilliSat", is("123"))) + .andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSentMilliSat", is("1"))) + .andExpect(jsonPath("$.flowReport.rebalanceSupportReceivedMilliSat", is("456"))) + .andExpect(jsonPath("$.flowReport.totalSentMilliSat", is("1100129"))) + .andExpect(jsonPath("$.flowReport.totalReceivedMilliSat", is("9052457"))) + .andExpect(jsonPath("$.balance.localBalanceSat", is("2000"))) + .andExpect(jsonPath("$.balance.localReserveSat", is("200"))) + .andExpect(jsonPath("$.balance.localAvailableSat", is("1800"))) + .andExpect(jsonPath("$.balance.remoteBalanceSat", is("223"))) + .andExpect(jsonPath("$.balance.remoteReserveSat", is("20"))) + .andExpect(jsonPath("$.balance.remoteAvailableSat", is("203"))) + .andExpect(jsonPath("$.feeReport.earnedMilliSat", is("1234"))) + .andExpect(jsonPath("$.feeReport.sourcedMilliSat", is("567"))) .andExpect(jsonPath("$.warnings", containsInAnyOrder( "Node has been online 51% in the past 14 days", "Node changed between online and offline 123 times in the past 7 days", "No flow in the past 16 days" ))) - .andExpect(jsonPath("$.onChainCosts.openCosts", is("1000"))) - .andExpect(jsonPath("$.onChainCosts.closeCosts", is("2000"))) - .andExpect(jsonPath("$.onChainCosts.sweepCosts", is("3000"))) + .andExpect(jsonPath("$.onChainCosts.openCostsSat", is("1000"))) + .andExpect(jsonPath("$.onChainCosts.closeCostsSat", is("2000"))) + .andExpect(jsonPath("$.onChainCosts.sweepCostsSat", is("3000"))) .andExpect(jsonPath("$.onlineReport.online", is(true))) .andExpect(jsonPath("$.onlineReport.onlinePercentage", is(77))) .andExpect(jsonPath("$.onlineReport.daysForOnlinePercentage", is(14))) @@ -148,27 +148,27 @@ class NodeControllerIT { void getBalance() throws Exception { when(balanceService.getBalanceInformationForPeer(PUBKEY)).thenReturn(BALANCE_INFORMATION); mockMvc.perform(get(NODE_PREFIX + "/balance")) - .andExpect(jsonPath("$.localBalance", is("1000"))) - .andExpect(jsonPath("$.localReserve", is("100"))) - .andExpect(jsonPath("$.localAvailable", is("900"))) - .andExpect(jsonPath("$.remoteBalance", is("123"))) - .andExpect(jsonPath("$.remoteReserve", is("10"))) - .andExpect(jsonPath("$.remoteAvailable", is("113"))); + .andExpect(jsonPath("$.localBalanceSat", is("1000"))) + .andExpect(jsonPath("$.localReserveSat", is("100"))) + .andExpect(jsonPath("$.localAvailableSat", is("900"))) + .andExpect(jsonPath("$.remoteBalanceSat", is("123"))) + .andExpect(jsonPath("$.remoteReserveSat", is("10"))) + .andExpect(jsonPath("$.remoteAvailableSat", is("113"))); } @Test void getFeeReport() throws Exception { when(feeService.getFeeReportForPeer(PUBKEY)).thenReturn(FEE_REPORT); mockMvc.perform(get(NODE_PREFIX + "/fee-report")) - .andExpect(jsonPath("$.earned", is("1234"))) - .andExpect(jsonPath("$.sourced", is("567"))); + .andExpect(jsonPath("$.earnedMilliSat", is("1234"))) + .andExpect(jsonPath("$.sourcedMilliSat", is("567"))); } @Test void getFeeReport_last_days() throws Exception { when(feeService.getFeeReportForPeer(PUBKEY, Duration.ofDays(123))).thenReturn(FEE_REPORT); mockMvc.perform(get(NODE_PREFIX + "/fee-report/last-days/123")) - .andExpect(jsonPath("$.earned", is("1234"))) - .andExpect(jsonPath("$.sourced", is("567"))); + .andExpect(jsonPath("$.earnedMilliSat", is("1234"))) + .andExpect(jsonPath("$.sourcedMilliSat", is("567"))); } } \ No newline at end of file diff --git a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/OnChainCostsControllerIT.java b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/OnChainCostsControllerIT.java index 51b6f7b9..e7cf9cf3 100644 --- a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/OnChainCostsControllerIT.java +++ b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/OnChainCostsControllerIT.java @@ -40,9 +40,9 @@ class OnChainCostsControllerIT { void on_chain_costs_for_peer() throws Exception { when(onChainCostService.getOnChainCostsForPeer(PUBKEY)).thenReturn(ON_CHAIN_COSTS); mockMvc.perform(get(PEER_PREFIX + "/on-chain-costs")) - .andExpect(jsonPath("$.openCosts", is("1000"))) - .andExpect(jsonPath("$.closeCosts", is("2000"))) - .andExpect(jsonPath("$.sweepCosts", is("3000"))); + .andExpect(jsonPath("$.openCostsSat", is("1000"))) + .andExpect(jsonPath("$.closeCostsSat", is("2000"))) + .andExpect(jsonPath("$.sweepCostsSat", is("3000"))); } @Test diff --git a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/SelfPaymentsControllerIT.java b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/SelfPaymentsControllerIT.java index 5c4aa189..dda7ff0a 100644 --- a/web/src/integrationTest/java/de/cotto/lndmanagej/controller/SelfPaymentsControllerIT.java +++ b/web/src/integrationTest/java/de/cotto/lndmanagej/controller/SelfPaymentsControllerIT.java @@ -47,8 +47,8 @@ class SelfPaymentsControllerIT { mockMvc.perform(get(CHANNEL_PREFIX + "/self-payments-from-channel/")) .andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT_2.memo()))) .andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT.memo()))) - .andExpect(jsonPath("$.fees", is("20"))) - .andExpect(jsonPath("$.amountPaid", is("4690"))); + .andExpect(jsonPath("$.feesMilliSat", is("20"))) + .andExpect(jsonPath("$.amountPaidMilliSat", is("4690"))); } @Test @@ -58,8 +58,8 @@ class SelfPaymentsControllerIT { mockMvc.perform(get(NODE_PREFIX + "/self-payments-from-peer/")) .andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT_2.memo()))) .andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT.memo()))) - .andExpect(jsonPath("$.fees", is("20"))) - .andExpect(jsonPath("$.amountPaid", is("4690"))); + .andExpect(jsonPath("$.feesMilliSat", is("20"))) + .andExpect(jsonPath("$.amountPaidMilliSat", is("4690"))); } @Test @@ -69,18 +69,18 @@ class SelfPaymentsControllerIT { mockMvc.perform(get(CHANNEL_PREFIX + "/self-payments-to-channel/")) .andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT.memo()))) .andExpect(jsonPath("$.selfPayments[0].settleDate", is(SELF_PAYMENT.settleDate().toString()))) - .andExpect(jsonPath("$.selfPayments[0].amountPaid", is(msat(SELF_PAYMENT.amountPaid())))) - .andExpect(jsonPath("$.selfPayments[0].fees", is(msat(SELF_PAYMENT.fees())))) + .andExpect(jsonPath("$.selfPayments[0].amountPaidMilliSat", is(msat(SELF_PAYMENT.amountPaid())))) + .andExpect(jsonPath("$.selfPayments[0].feesMilliSat", is(msat(SELF_PAYMENT.fees())))) .andExpect(jsonPath("$.selfPayments[0].firstChannel", is(CHANNEL_ID_4.toString()))) .andExpect(jsonPath("$.selfPayments[0].lastChannel", is(CHANNEL_ID_2.toString()))) .andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT_2.memo()))) .andExpect(jsonPath("$.selfPayments[1].settleDate", is(SELF_PAYMENT_2.settleDate().toString()))) - .andExpect(jsonPath("$.selfPayments[1].amountPaid", is(msat(SELF_PAYMENT_2.amountPaid())))) - .andExpect(jsonPath("$.selfPayments[1].fees", is(msat(SELF_PAYMENT_2.fees())))) + .andExpect(jsonPath("$.selfPayments[1].amountPaidMilliSat", is(msat(SELF_PAYMENT_2.amountPaid())))) + .andExpect(jsonPath("$.selfPayments[1].feesMilliSat", is(msat(SELF_PAYMENT_2.fees())))) .andExpect(jsonPath("$.selfPayments[1].firstChannel", is(not(empty())))) .andExpect(jsonPath("$.selfPayments[1].lastChannel", is(CHANNEL_ID.toString()))) - .andExpect(jsonPath("$.fees", is("20"))) - .andExpect(jsonPath("$.amountPaid", is("4690"))); + .andExpect(jsonPath("$.feesMilliSat", is("20"))) + .andExpect(jsonPath("$.amountPaidMilliSat", is("4690"))); } @Test @@ -90,8 +90,8 @@ class SelfPaymentsControllerIT { mockMvc.perform(get(NODE_PREFIX + "/self-payments-to-peer/")) .andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT_2.memo()))) .andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT.memo()))) - .andExpect(jsonPath("$.fees", is("20"))) - .andExpect(jsonPath("$.amountPaid", is("4690"))); + .andExpect(jsonPath("$.feesMilliSat", is("20"))) + .andExpect(jsonPath("$.amountPaidMilliSat", is("4690"))); } private String msat(Coins value) { diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/BalanceInformationDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/BalanceInformationDto.java index d9aedb2e..79a80ac8 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/BalanceInformationDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/BalanceInformationDto.java @@ -4,12 +4,12 @@ import de.cotto.lndmanagej.model.BalanceInformation; import de.cotto.lndmanagej.model.Coins; public record BalanceInformationDto( - String localBalance, - String localReserve, - String localAvailable, - String remoteBalance, - String remoteReserve, - String remoteAvailable + String localBalanceSat, + String localReserveSat, + String localAvailableSat, + String remoteBalanceSat, + String remoteReserveSat, + String remoteAvailableSat ) { public static BalanceInformationDto createFromModel(BalanceInformation balanceInformation) { return new BalanceInformationDto( diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDto.java index 268cf6c0..2471a2a9 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDto.java @@ -24,9 +24,9 @@ public record ChannelDetailsDto( Pubkey remotePubkey, OpenInitiator openInitiator, String remoteAlias, - String capacity, - String totalSent, - String totalReceived, + String capacitySat, + String totalSentSat, + String totalReceivedSat, ChannelStatusDto status, BalanceInformationDto balance, OnChainCostsDto onChainCosts, @@ -58,9 +58,9 @@ public record ChannelDetailsDto( channelDto.remotePubkey(), channelDto.openInitiator(), remoteAlias, - channelDto.capacity(), - channelDto.totalSent(), - channelDto.totalReceived(), + channelDto.capacitySat(), + channelDto.totalSentSat(), + channelDto.totalReceivedSat(), channelDto.status(), BalanceInformationDto.createFromModel(balanceInformation), OnChainCostsDto.createFromModel(onChainCosts), diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDto.java index d25df189..8177578a 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/ChannelDto.java @@ -13,9 +13,9 @@ public record ChannelDto( ChannelPoint channelPoint, int openHeight, Pubkey remotePubkey, - String capacity, - String totalSent, - String totalReceived, + String capacitySat, + String totalSentSat, + String totalReceivedSat, ChannelStatusDto status, OpenInitiator openInitiator, ClosedChannelDetailsDto closeDetails, diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/FeeReportDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/FeeReportDto.java index c72d6cac..c7e280f5 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/FeeReportDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/FeeReportDto.java @@ -3,7 +3,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 record FeeReportDto(String earnedMilliSat, String sourcedMilliSat) { public FeeReportDto(Coins earned, Coins sourced) { this( String.valueOf(earned.milliSatoshis()), diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/FlowReportDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/FlowReportDto.java index ddf9a1f1..ec744819 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/FlowReportDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/FlowReportDto.java @@ -4,17 +4,17 @@ import de.cotto.lndmanagej.model.Coins; import de.cotto.lndmanagej.model.FlowReport; public record FlowReportDto( - String forwardedSent, - String forwardedReceived, - String forwardingFeesReceived, - String rebalanceSent, - String rebalanceFeesSent, - String rebalanceReceived, - String rebalanceSupportSent, - String rebalanceSupportFeesSent, - String rebalanceSupportReceived, - String totalSent, - String totalReceived + String forwardedSentMilliSat, + String forwardedReceivedMilliSat, + String forwardingFeesReceivedMilliSat, + String rebalanceSentMilliSat, + String rebalanceFeesSentMilliSat, + String rebalanceReceivedMilliSat, + String rebalanceSupportSentMilliSat, + String rebalanceSupportFeesSentMilliSat, + String rebalanceSupportReceivedMilliSat, + String totalSentMilliSat, + String totalReceivedMilliSat ) { @SuppressWarnings("PMD.ExcessiveParameterList") public FlowReportDto( diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/OnChainCostsDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/OnChainCostsDto.java index 1c8cd733..1e9e68f5 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/OnChainCostsDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/OnChainCostsDto.java @@ -2,7 +2,7 @@ package de.cotto.lndmanagej.controller.dto; import de.cotto.lndmanagej.model.OnChainCosts; -public record OnChainCostsDto(String openCosts, String closeCosts, String sweepCosts) { +public record OnChainCostsDto(String openCostsSat, String closeCostsSat, String sweepCostsSat) { public static OnChainCostsDto createFromModel(OnChainCosts onChainCosts) { long openSatoshi = onChainCosts.open().satoshis(); long closeSatoshi = onChainCosts.close().satoshis(); diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDto.java index 485349eb..26b46782 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDto.java @@ -8,8 +8,8 @@ import java.time.ZonedDateTime; public record SelfPaymentDto( ZonedDateTime settleDate, String memo, - String amountPaid, - String fees, + String amountPaidMilliSat, + String feesMilliSat, ChannelId firstChannel, ChannelId lastChannel ) { diff --git a/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentsDto.java b/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentsDto.java index 022a5458..fc1fce1f 100644 --- a/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentsDto.java +++ b/web/src/main/java/de/cotto/lndmanagej/controller/dto/SelfPaymentsDto.java @@ -6,7 +6,7 @@ import de.cotto.lndmanagej.model.SelfPayment; import java.util.List; import java.util.function.Function; -public record SelfPaymentsDto(List selfPayments, String amountPaid, String fees) { +public record SelfPaymentsDto(List selfPayments, String amountPaidMilliSat, String feesMilliSat) { public SelfPaymentsDto(List selfPayments) { this( selfPayments.stream().map(SelfPaymentDto::createFromModel).toList(), diff --git a/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDtoTest.java b/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDtoTest.java index 01ae4040..0013ee9c 100644 --- a/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDtoTest.java +++ b/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDetailsDtoTest.java @@ -97,8 +97,8 @@ class ChannelDetailsDtoTest { } @Test - void capacity() { - assertThat(CHANNEL_DETAILS_DTO.capacity()).isEqualTo(String.valueOf(CAPACITY.satoshis())); + void capacitySat() { + assertThat(CHANNEL_DETAILS_DTO.capacitySat()).isEqualTo(String.valueOf(CAPACITY.satoshis())); } @Test diff --git a/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDtoTest.java b/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDtoTest.java index 08da4943..006810e3 100644 --- a/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDtoTest.java +++ b/web/src/test/java/de/cotto/lndmanagej/controller/dto/ChannelDtoTest.java @@ -52,18 +52,18 @@ class ChannelDtoTest { @Test void capacity() { - assertThat(CHANNEL_DTO.capacity()).isEqualTo(String.valueOf(CAPACITY.satoshis())); + assertThat(CHANNEL_DTO.capacitySat()).isEqualTo(String.valueOf(CAPACITY.satoshis())); } @Test - void totalSent() { - assertThat(new ChannelDto(LOCAL_OPEN_CHANNEL).totalSent()) + void totalSentSat() { + assertThat(new ChannelDto(LOCAL_OPEN_CHANNEL).totalSentSat()) .isEqualTo(String.valueOf(TOTAL_SENT.satoshis())); } @Test - void totalReceived() { - assertThat(new ChannelDto(LOCAL_OPEN_CHANNEL).totalReceived()) + void totalReceivedSat() { + assertThat(new ChannelDto(LOCAL_OPEN_CHANNEL).totalReceivedSat()) .isEqualTo(String.valueOf(TOTAL_RECEIVED.satoshis())); } diff --git a/web/src/test/java/de/cotto/lndmanagej/controller/dto/FeeReportDtoTest.java b/web/src/test/java/de/cotto/lndmanagej/controller/dto/FeeReportDtoTest.java index 29d83ffb..6b947bde 100644 --- a/web/src/test/java/de/cotto/lndmanagej/controller/dto/FeeReportDtoTest.java +++ b/web/src/test/java/de/cotto/lndmanagej/controller/dto/FeeReportDtoTest.java @@ -13,12 +13,12 @@ class FeeReportDtoTest { @Test void earned() { - assertThat(FEE_REPORT_DTO.earned()).isEqualTo("1234"); + assertThat(FEE_REPORT_DTO.earnedMilliSat()).isEqualTo("1234"); } @Test void sourced() { - assertThat(FEE_REPORT_DTO.sourced()).isEqualTo("567"); + assertThat(FEE_REPORT_DTO.sourcedMilliSat()).isEqualTo("567"); } @Test diff --git a/web/src/test/java/de/cotto/lndmanagej/controller/dto/FlowReportDtoTest.java b/web/src/test/java/de/cotto/lndmanagej/controller/dto/FlowReportDtoTest.java index 5f4af0c2..f2a2d322 100644 --- a/web/src/test/java/de/cotto/lndmanagej/controller/dto/FlowReportDtoTest.java +++ b/web/src/test/java/de/cotto/lndmanagej/controller/dto/FlowReportDtoTest.java @@ -37,61 +37,68 @@ class FlowReportDtoTest { @Test void forwardedSent() { - assertThat(FLOW_REPORT_DTO.forwardedSent()).isEqualTo(String.valueOf(FORWARDED_SENT.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.forwardedSentMilliSat()) + .isEqualTo(String.valueOf(FORWARDED_SENT.milliSatoshis())); } @Test void forwardedReceived() { - assertThat(FLOW_REPORT_DTO.forwardedReceived()).isEqualTo(String.valueOf(FORWARDED_RECEIVED.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.forwardedReceivedMilliSat()) + .isEqualTo(String.valueOf(FORWARDED_RECEIVED.milliSatoshis())); } @Test void forwardingFeesReceived() { - assertThat(FLOW_REPORT_DTO.forwardingFeesReceived()) + assertThat(FLOW_REPORT_DTO.forwardingFeesReceivedMilliSat()) .isEqualTo(String.valueOf(FORWARDING_FEES_RECEIVED.milliSatoshis())); } @Test void rebalanceSent() { - assertThat(FLOW_REPORT_DTO.rebalanceSent()).isEqualTo(String.valueOf(REBALANCE_SENT.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.rebalanceSentMilliSat()) + .isEqualTo(String.valueOf(REBALANCE_SENT.milliSatoshis())); } @Test void rebalanceFeesSent() { - assertThat(FLOW_REPORT_DTO.rebalanceFeesSent()).isEqualTo(String.valueOf(REBALANCE_FEES_SENT.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.rebalanceFeesSentMilliSat()) + .isEqualTo(String.valueOf(REBALANCE_FEES_SENT.milliSatoshis())); } @Test void rebalanceReceived() { - assertThat(FLOW_REPORT_DTO.rebalanceReceived()).isEqualTo(String.valueOf(REBALANCE_RECEIVED.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.rebalanceReceivedMilliSat()) + .isEqualTo(String.valueOf(REBALANCE_RECEIVED.milliSatoshis())); } @Test void rebalanceSupportSent() { - assertThat(FLOW_REPORT_DTO.rebalanceSupportSent()) + assertThat(FLOW_REPORT_DTO.rebalanceSupportSentMilliSat()) .isEqualTo(String.valueOf(REBALANCE_SUPPORT_SENT.milliSatoshis())); } @Test void rebalanceSupportFeesSent() { - assertThat(FLOW_REPORT_DTO.rebalanceSupportFeesSent()) + assertThat(FLOW_REPORT_DTO.rebalanceSupportFeesSentMilliSat()) .isEqualTo(String.valueOf(REBALANCE_SUPPORT_FEES_SENT.milliSatoshis())); } @Test void rebalanceSupportReceived() { - assertThat(FLOW_REPORT_DTO.rebalanceSupportReceived()) + assertThat(FLOW_REPORT_DTO.rebalanceSupportReceivedMilliSat()) .isEqualTo(String.valueOf(REBALANCE_SUPPORT_RECEIVED.milliSatoshis())); } @Test void totalSent() { - assertThat(FLOW_REPORT_DTO.totalSent()).isEqualTo(String.valueOf(TOTAL_SENT.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.totalSentMilliSat()) + .isEqualTo(String.valueOf(TOTAL_SENT.milliSatoshis())); } @Test void totalReceived() { - assertThat(FLOW_REPORT_DTO.totalReceived()).isEqualTo(String.valueOf(TOTAL_RECEIVED.milliSatoshis())); + assertThat(FLOW_REPORT_DTO.totalReceivedMilliSat()) + .isEqualTo(String.valueOf(TOTAL_RECEIVED.milliSatoshis())); } @Test diff --git a/web/src/test/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDtoTest.java b/web/src/test/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDtoTest.java index 0b385fea..c4c17e99 100644 --- a/web/src/test/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDtoTest.java +++ b/web/src/test/java/de/cotto/lndmanagej/controller/dto/SelfPaymentDtoTest.java @@ -21,12 +21,12 @@ class SelfPaymentDtoTest { @Test void amountPaid() { - assertThat(dto.amountPaid()).isEqualTo(String.valueOf(SELF_PAYMENT.amountPaid().milliSatoshis())); + assertThat(dto.amountPaidMilliSat()).isEqualTo(String.valueOf(SELF_PAYMENT.amountPaid().milliSatoshis())); } @Test void fees() { - assertThat(dto.fees()).isEqualTo(String.valueOf(SELF_PAYMENT.fees().milliSatoshis())); + assertThat(dto.feesMilliSat()).isEqualTo(String.valueOf(SELF_PAYMENT.fees().milliSatoshis())); } @Test diff --git a/web/src/test/java/de/cotto/lndmanagej/dto/SelfPaymentsDtoTest.java b/web/src/test/java/de/cotto/lndmanagej/dto/SelfPaymentsDtoTest.java index 86f12320..8cf80762 100644 --- a/web/src/test/java/de/cotto/lndmanagej/dto/SelfPaymentsDtoTest.java +++ b/web/src/test/java/de/cotto/lndmanagej/dto/SelfPaymentsDtoTest.java @@ -20,13 +20,13 @@ class SelfPaymentsDtoTest { void amountPaid() { SelfPaymentsDto empty = new SelfPaymentsDto(List.of(SELF_PAYMENT, SELF_PAYMENT_2)); String expected = String.valueOf(SELF_PAYMENT.amountPaid().add(SELF_PAYMENT_2.amountPaid()).milliSatoshis()); - assertThat(empty.amountPaid()).isEqualTo(expected); + assertThat(empty.amountPaidMilliSat()).isEqualTo(expected); } @Test void fees() { SelfPaymentsDto empty = new SelfPaymentsDto(List.of(SELF_PAYMENT, SELF_PAYMENT_2)); String expected = String.valueOf(SELF_PAYMENT.fees().add(SELF_PAYMENT_2.fees()).milliSatoshis()); - assertThat(empty.fees()).isEqualTo(expected); + assertThat(empty.feesMilliSat()).isEqualTo(expected); } } \ No newline at end of file