1
0

Merge pull request #7282 from wakiyamap/add_signet

add signet support
This commit is contained in:
ghost43
2021-06-22 16:15:38 +02:00
committed by GitHub
9 changed files with 77 additions and 5 deletions

View File

@@ -178,6 +178,9 @@ def pull_tagged(stream):
return (CHARSET[tag], stream.read(length * 5), stream)
def lnencode(addr: 'LnAddr', privkey) -> str:
# see https://github.com/lightningnetwork/lightning-rfc/pull/844
if constants.net.NET_NAME == "signet":
addr.currency = constants.net.BOLT11_HRP
if addr.amount:
amount = addr.currency + shorten_amount(addr.amount)
else:
@@ -367,6 +370,9 @@ class SerializableKey:
def lndecode(invoice: str, *, verbose=False, expected_hrp=None) -> LnAddr:
if expected_hrp is None:
expected_hrp = constants.net.SEGWIT_HRP
# see https://github.com/lightningnetwork/lightning-rfc/pull/844
if constants.net.NET_NAME == "signet":
expected_hrp = constants.net.BOLT11_HRP
decoded_bech32 = bech32_decode(invoice, ignore_long_length=True)
hrp = decoded_bech32.hrp
data = decoded_bech32.data