lnaddr: rename LnAddr -> bolt11
The LnAddr, lndecode and lnencode naming didn't imply that it is bolt 11 specific, making it confusing to work with, now that there are also bolt 12 "lnaddr". Renaming it to *bolt11* creates a clear separation to bolt 12 things and reduces mental load. This commit is pure renaming (using the PyCharm IDE refactor function), except for the removal of the `object` inheritance of LnAddr/BOLT11Addr, this is Python 2 legacy.
This commit is contained in:
@@ -73,7 +73,7 @@ from electrum.exchange_rate import FxThread
|
||||
from electrum.simple_config import SimpleConfig
|
||||
from electrum.logging import Logger
|
||||
from electrum.lntransport import extract_nodeid, ConnStringFormatError
|
||||
from electrum.lnaddr import lndecode, LnAddr
|
||||
from electrum.bolt11 import decode_bolt11_invoice, BOLT11Addr
|
||||
from electrum.submarine_swaps import SwapServerTransport, NostrTransport
|
||||
from electrum.fee_policy import FeePolicy
|
||||
|
||||
@@ -1678,7 +1678,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
||||
|
||||
def show_lightning_invoice(self, invoice: Invoice):
|
||||
from electrum.util import format_short_id
|
||||
lnaddr = lndecode(invoice.lightning_invoice)
|
||||
lnaddr = decode_bolt11_invoice(invoice.lightning_invoice)
|
||||
d = WindowModalDialog(self, _("Lightning Invoice"))
|
||||
vbox = QVBoxLayout(d)
|
||||
grid = QGridLayout()
|
||||
@@ -1713,7 +1713,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
||||
grid.addWidget(QLabel(_('Text') + ':'), 8, 0)
|
||||
grid.addWidget(invoice_e, 8, 1)
|
||||
r_tags = lnaddr.get_routing_info('r')
|
||||
r_tags = '\n'.join(repr(r) for r in LnAddr.format_bolt11_routing_info_as_human_readable(r_tags))
|
||||
r_tags = '\n'.join(repr(r) for r in BOLT11Addr.format_bolt11_routing_info_as_human_readable(r_tags))
|
||||
routing_e = QTextEdit(str(r_tags))
|
||||
routing_e.setReadOnly(True)
|
||||
grid.addWidget(QLabel(_("Routing Hints") + ':'), 9, 0)
|
||||
|
||||
Reference in New Issue
Block a user