mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 15:35:10 +01:00
add fee-configuration endpoint for channel
This commit is contained in:
@@ -124,6 +124,19 @@ class ChannelControllerTest {
|
||||
assertThat(channelController.getDetails(CHANNEL_ID)).isEqualTo(expectedDetails);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getFeeConfiguration() {
|
||||
when(channelService.getLocalChannel(CHANNEL_ID)).thenReturn(Optional.of(LOCAL_OPEN_CHANNEL));
|
||||
when(feeService.getFeeConfiguration(CHANNEL_ID)).thenReturn(FEE_CONFIGURATION);
|
||||
assertThat(channelController.getFeeConfiguration(CHANNEL_ID)).isEqualTo(FEE_CONFIGURATION_DTO);
|
||||
verify(metrics).mark(argThat(name -> name.endsWith(".getFeeConfiguration")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getFeeConfiguration_waiting_close() {
|
||||
assertThat(channelController.getFeeConfiguration(CHANNEL_ID)).isEqualTo(FeeConfigurationDto.EMPTY);
|
||||
}
|
||||
|
||||
private ChannelDetailsDto mockForChannelWithoutFeeConfiguration(LocalChannel channel) {
|
||||
when(nodeService.getAlias(PUBKEY_2)).thenReturn(ALIAS_2);
|
||||
when(channelService.getLocalChannel(CHANNEL_ID)).thenReturn(Optional.of(channel));
|
||||
@@ -133,7 +146,7 @@ class ChannelControllerTest {
|
||||
ALIAS_2,
|
||||
BalanceInformation.EMPTY,
|
||||
ON_CHAIN_COSTS,
|
||||
new FeeConfigurationDto(0, 0, 0, 0)
|
||||
FeeConfigurationDto.EMPTY
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,13 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class ChannelDetailsDtoTest {
|
||||
|
||||
private static final OnChainCostsDto ON_CHAIN_COSTS = new OnChainCostsDto(Coins.ofSatoshis(1), Coins.ofSatoshis(2));
|
||||
private static final FeeConfigurationDto FEE_CONFIGURATION_DTO =
|
||||
new FeeConfigurationDto(0, 0, 0, 0);
|
||||
private static final ChannelDetailsDto CHANNEL_DETAILS_DTO =
|
||||
new ChannelDetailsDto(CLOSED_CHANNEL, ALIAS, BALANCE_INFORMATION, ON_CHAIN_COSTS, FEE_CONFIGURATION_DTO);
|
||||
private static final ChannelDetailsDto CHANNEL_DETAILS_DTO = new ChannelDetailsDto(
|
||||
CLOSED_CHANNEL,
|
||||
ALIAS,
|
||||
BALANCE_INFORMATION,
|
||||
ON_CHAIN_COSTS,
|
||||
FeeConfigurationDto.EMPTY
|
||||
);
|
||||
|
||||
@Test
|
||||
void channelIdShort() {
|
||||
@@ -70,7 +73,7 @@ class ChannelDetailsDtoTest {
|
||||
ALIAS,
|
||||
BALANCE_INFORMATION,
|
||||
ON_CHAIN_COSTS,
|
||||
FEE_CONFIGURATION_DTO
|
||||
FeeConfigurationDto.EMPTY
|
||||
);
|
||||
ChannelStatusDto channelStatusDto =
|
||||
ChannelStatusDto.createFrom(new ChannelStatus(false, true, false, OPEN));
|
||||
|
||||
Reference in New Issue
Block a user