mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 07:24:23 +01:00
compute sweep costs
This commit is contained in:
@@ -149,6 +149,7 @@ class ChannelControllerIT {
|
||||
.andExpect(jsonPath("$.status.openClosed", is("OPEN")))
|
||||
.andExpect(jsonPath("$.onChainCosts.openCosts", is("1000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.closeCosts", is("2000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.sweepCosts", is("3000")))
|
||||
.andExpect(jsonPath("$.offChainCosts.rebalanceSource", is("1")))
|
||||
.andExpect(jsonPath("$.offChainCosts.rebalanceTarget", is("2")))
|
||||
.andExpect(jsonPath("$.balance.localBalance", is("2000")))
|
||||
|
||||
@@ -111,6 +111,7 @@ class NodeControllerIT {
|
||||
.andExpect(jsonPath("$.feeReport.sourced", is("567")))
|
||||
.andExpect(jsonPath("$.onChainCosts.openCosts", is("1000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.closeCosts", is("2000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.sweepCosts", is("3000")))
|
||||
.andExpect(jsonPath("$.online", is(true)));
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@ class OnChainCostsControllerIT {
|
||||
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("$.closeCosts", is("2000")))
|
||||
.andExpect(jsonPath("$.sweepCosts", is("3000")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -65,10 +66,24 @@ class OnChainCostsControllerIT {
|
||||
.andExpect(content().string("123"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sweep_costs_for_channel() throws Exception {
|
||||
when(onChainCostService.getSweepCostsForChannelId(CHANNEL_ID)).thenReturn(Optional.of(Coins.ofSatoshis(123)));
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/sweep-costs"))
|
||||
.andExpect(content().string("123"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void close_costs_for_channel_unknown() throws Exception {
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/close-costs"))
|
||||
.andExpect(status().isBadRequest())
|
||||
.andExpect(content().string("Unable to get close costs for channel with ID " + CHANNEL_ID));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sweep_costs_channel_unknown() throws Exception {
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/sweep-costs"))
|
||||
.andExpect(status().isBadRequest())
|
||||
.andExpect(content().string("Unable to get sweep costs for channel with ID " + CHANNEL_ID));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user