include MPP fee rate in output

This commit is contained in:
Carsten Otto
2022-03-27 19:14:27 +02:00
parent 73a84f44c7
commit 02ab2d8e09
3 changed files with 13 additions and 1 deletions

View File

@@ -49,6 +49,7 @@ class PickhardtPaymentsControllerIT {
.andExpect(jsonPath("$.probability", is(expectedProbability)))
.andExpect(jsonPath("$.amountSat", is(amountAsString)))
.andExpect(jsonPath("$.feesMilliSat", is(feesAsString)))
.andExpect(jsonPath("$.feeRate", is(200)))
.andExpect(jsonPath("$.routes", hasSize(1)))
.andExpect(jsonPath("$.routes[0].amountSat", is(amountAsString)))
.andExpect(jsonPath("$.routes[0].channelIds", contains(CHANNEL_ID.toString())))
@@ -59,6 +60,7 @@ class PickhardtPaymentsControllerIT {
void send() throws Exception {
Coins amount = MULTI_PATH_PAYMENT.amount();
String amountAsString = String.valueOf(amount.satoshis());
String feesAsString = String.valueOf(MULTI_PATH_PAYMENT.fees().milliSatoshis());
double expectedProbability = MULTI_PATH_PAYMENT.probability();
when(multiPathPaymentSplitter.getMultiPathPaymentTo(PUBKEY, amount))
.thenReturn(MULTI_PATH_PAYMENT);
@@ -67,6 +69,8 @@ class PickhardtPaymentsControllerIT {
mockMvc.perform(get(PREFIX + "/from/" + PUBKEY + "/to/" + PUBKEY_2 + "/amount/" + 1_234))
.andExpect(jsonPath("$.probability", is(expectedProbability)))
.andExpect(jsonPath("$.amountSat", is(amountAsString)))
.andExpect(jsonPath("$.feesMilliSat", is(feesAsString)))
.andExpect(jsonPath("$.feeRate", is(200)))
.andExpect(jsonPath("$.routes", hasSize(1)))
.andExpect(jsonPath("$.routes[0].amountSat", is(amountAsString)))
.andExpect(jsonPath("$.routes[0].channelIds", contains(CHANNEL_ID.toString())))