mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-20 22:44:31 +01:00
remove redundant amount from invoice memo
This commit is contained in:
@@ -100,7 +100,7 @@ public class TopUpService {
|
||||
}
|
||||
|
||||
private Optional<DecodedPaymentRequest> getPaymentRequest(Pubkey pubkey, Coins topUpAmount) {
|
||||
String description = getDescription(pubkey, topUpAmount);
|
||||
String description = getDescription(pubkey);
|
||||
return grpcInvoices.createPaymentRequest(topUpAmount, description, getExpiry());
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ public class TopUpService {
|
||||
return Duration.ofSeconds(configurationService.getIntegerValue(EXPIRY).orElse(DEFAULT_EXPIRY));
|
||||
}
|
||||
|
||||
private String getDescription(Pubkey pubkey, Coins amount) {
|
||||
private String getDescription(Pubkey pubkey) {
|
||||
String alias = nodeService.getAlias(pubkey);
|
||||
return "Topping up channel with %s (%s), adding %s".formatted(pubkey, alias, amount);
|
||||
return "Topping up channel with %s (%s)".formatted(pubkey, alias);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import static org.mockito.Mockito.when;
|
||||
class TopUpServiceTest {
|
||||
private static final Coins AMOUNT = Coins.ofSatoshis(123_000);
|
||||
private static final Coins DEFAULT_THRESHOLD = Coins.ofSatoshis(10_000);
|
||||
private static final String DESCRIPTION_PREFIX = "Topping up channel with " + PUBKEY + " (alias), adding ";
|
||||
private static final String DESCRIPTION = "Topping up channel with " + PUBKEY + " (alias)";
|
||||
private static final long OUR_FEE_RATE = 1234;
|
||||
private static final long PEER_FEE_RATE = 1233;
|
||||
private static final Duration DEFAULT_EXPIRY = Duration.ofMinutes(10);
|
||||
@@ -182,11 +182,7 @@ class TopUpServiceTest {
|
||||
|
||||
private void assertTopUp(Coins expectedTopUpAmount, Duration expiry) {
|
||||
PaymentStatus paymentStatus = topUpService.topUp(PUBKEY, AMOUNT);
|
||||
verify(grpcInvoices).createPaymentRequest(
|
||||
expectedTopUpAmount,
|
||||
DESCRIPTION_PREFIX + expectedTopUpAmount,
|
||||
expiry
|
||||
);
|
||||
verify(grpcInvoices).createPaymentRequest(expectedTopUpAmount, DESCRIPTION, expiry);
|
||||
PaymentOptions paymentOptions = PaymentOptions.forTopUp(OUR_FEE_RATE, PUBKEY);
|
||||
verify(multiPathPaymentSender).payPaymentRequest(DECODED_PAYMENT_REQUEST, paymentOptions);
|
||||
assertThat(paymentStatus.isPending()).isTrue();
|
||||
|
||||
Reference in New Issue
Block a user