Fix zap warning messages to show sats instead of millisats

This commit is contained in:
Robert C. Martin 2023-04-20 17:20:08 -05:00
parent b3d4183dd7
commit 11308a8b6a
3 changed files with 11 additions and 5 deletions

View File

@ -156,7 +156,7 @@
event {} event {}
comment "12345678901234567890" comment "12345678901234567890"
lnurl "lnurl"] lnurl "lnurl"]
(should-throw Exception "Amount 100 is below minimum of 1000" (should-throw Exception "Amount 0 is below minimum of 1"
(zaps/make-zap-request wallet-response (zaps/make-zap-request wallet-response
event amount comment lnurl)))) event amount comment lnurl))))
@ -173,7 +173,7 @@
comment "12345678901234567890" comment "12345678901234567890"
lnurl "lnurl" lnurl "lnurl"
amount 2000000] amount 2000000]
(should-throw Exception "Amount 2000000 is larger than maximum of 1000000" (should-throw Exception "Amount 2000 is larger than maximum of 1000"
(zaps/make-zap-request wallet-response (zaps/make-zap-request wallet-response
event amount comment lnurl)))) event amount comment lnurl))))

View File

@ -71,9 +71,15 @@
_ (when-not allowsNostr _ (when-not allowsNostr
(throw (Exception. (str "Recipient does not accept Nostr zaps.")))) (throw (Exception. (str "Recipient does not accept Nostr zaps."))))
_ (when (< amount minSendable) _ (when (< amount minSendable)
(throw (Exception. (str "Amount " amount " is below minimum of " minSendable)))) (throw (Exception. (str "Amount "
(quot amount 1000)
" is below minimum of "
(quot minSendable 1000)))))
_ (when (> amount maxSendable) _ (when (> amount maxSendable)
(throw (Exception. (str "Amount " amount " is larger than maximum of " maxSendable)))) (throw (Exception. (str "Amount "
(quot amount 1000)
" is larger than maximum of "
(quot maxSendable 1000)))))
_ (when (and (some? comment) _ (when (and (some? comment)
(some? commentAllowed) (some? commentAllowed)
(> (count comment) commentAllowed)) (> (count comment) commentAllowed))

View File

@ -273,7 +273,7 @@
(text! up-arrow "👍🏻") (text! up-arrow "👍🏻")
(text! dn-arrow "👎🏻"))) (text! dn-arrow "👎🏻")))
(if zapped? (if zapped?
(text! zap-icon "❗⚡ ") (text! zap-icon "❗⚡ ") ;₿ use the bitcoin char?
(text! zap-icon "")) (text! zap-icon ""))
(swing-util/clear-popup relays-popup) (swing-util/clear-popup relays-popup)
(swing-util/clear-popup reactions-popup) (swing-util/clear-popup reactions-popup)