fakewallet: convert sat to msat (#899)

This commit is contained in:
asmo
2025-07-22 15:27:18 +02:00
committed by GitHub
parent f018465aa6
commit e639bd4021

View File

@@ -352,7 +352,12 @@ impl MintPayment for FakeWallet {
}
IncomingPaymentOptions::Bolt11(bolt11_options) => {
let description = bolt11_options.description.unwrap_or_default();
let amount = bolt11_options.amount;
let amount = if unit == &CurrencyUnit::Sat {
to_unit(bolt11_options.amount, unit, &CurrencyUnit::Msat)
.unwrap_or(bolt11_options.amount * Amount::from(1000))
} else {
bolt11_options.amount
};
let expiry = bolt11_options.unix_expiry;
// Since this is fake we just use the amount no matter the unit to create an invoice