Browse Source

email plugin: (trivial) adapt to Invoices refactor

patch-4
SomberNight 3 years ago
parent
commit
7e77a7e1cc
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/paymentrequest.py
  2. 10
      electrum/plugins/email_requests/qt.py

2
electrum/paymentrequest.py

@ -333,7 +333,7 @@ def make_unsigned_request(req: 'Invoice'):
time = 0
if exp and type(exp) != int:
exp = 0
amount = req.amount_sat
amount = req.get_amount_sat()
if amount is None:
amount = 0
memo = req.message

10
electrum/plugins/email_requests/qt.py

@ -51,7 +51,7 @@ from electrum.paymentrequest import PaymentRequest
from electrum.i18n import _
from electrum.logging import Logger
from electrum.wallet import Abstract_Wallet
from electrum.invoices import OnchainInvoice
from electrum.invoices import Invoice
class Processor(threading.Thread, Logger):
@ -170,7 +170,7 @@ class Plugin(BasePlugin):
self.wallets -= {wallet}
def new_invoice(self):
invoice = OnchainInvoice.from_bip70_payreq(self.pr)
invoice = Invoice.from_bip70_payreq(self.pr)
for wallet in self.wallets:
wallet.save_invoice(invoice)
#main_window.invoice_list.update()
@ -181,10 +181,8 @@ class Plugin(BasePlugin):
def send(self, window: ElectrumWindow, addr):
from electrum import paymentrequest
req = window.wallet.receive_requests.get(addr)
if not isinstance(req, OnchainInvoice):
window.show_error("Only on-chain requests are supported.")
return
req = window.wallet.get_request(addr)
# FIXME only on-chain requests are supported
message = req.message
if req.bip70:
payload = bytes.fromhex(req.bip70)

Loading…
Cancel
Save