1
0

email plugin: (trivial) adapt to Invoices refactor

This commit is contained in:
SomberNight
2022-05-23 18:53:19 +02:00
parent 98feff07ad
commit 7e77a7e1cc
2 changed files with 5 additions and 7 deletions

View File

@@ -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

View File

@@ -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)