invoices: fix type hint for get_address()
This commit is contained in:
@@ -117,7 +117,7 @@ class Invoice(StoredObject):
|
|||||||
status_str = _('Expires') + ' ' + age(expiration, include_seconds=True)
|
status_str = _('Expires') + ' ' + age(expiration, include_seconds=True)
|
||||||
return status_str
|
return status_str
|
||||||
|
|
||||||
def get_address(self) -> str:
|
def get_address(self) -> Optional[str]:
|
||||||
"""returns the first address, to be displayed in GUI"""
|
"""returns the first address, to be displayed in GUI"""
|
||||||
if self.is_lightning():
|
if self.is_lightning():
|
||||||
return self._lnaddr.get_fallback_address() or None
|
return self._lnaddr.get_fallback_address() or None
|
||||||
|
|||||||
@@ -2474,7 +2474,7 @@ class Abstract_Wallet(ABC, Logger, EventListener):
|
|||||||
"""Return the key to use for this invoice in self.receive_requests."""
|
"""Return the key to use for this invoice in self.receive_requests."""
|
||||||
# FIXME: this should be a method of Invoice
|
# FIXME: this should be a method of Invoice
|
||||||
if not req.is_lightning():
|
if not req.is_lightning():
|
||||||
addr = req.get_address()
|
addr = req.get_address() or ""
|
||||||
if sanity_checks:
|
if sanity_checks:
|
||||||
if not bitcoin.is_address(addr):
|
if not bitcoin.is_address(addr):
|
||||||
raise Exception(_('Invalid Bitcoin address.'))
|
raise Exception(_('Invalid Bitcoin address.'))
|
||||||
|
|||||||
Reference in New Issue
Block a user