BOLT quote corrections in Python files (previously unchecked).
What changed, and why it matters
This commit only updates comments and documentation strings in Python test and library files to match the current wording of the BOLT (Basis of Lightning Technology) specifications. It changes punctuation, capitalization, field ordering in invoice breakdowns, and backtick formatting. No executable code behavior is changed, so there is no security impact.
No security action required. This is a documentation/comment cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure comment/documentation edit across seven Python files. It corrects BOLT quote formatting (periods to semicolons, ‘Lightning on Bitcoin mainnet’ capitalization), fixes field ordering in invoice breakdown comments, adds ellipses to skip feature/SHA256 details, corrects backtick quoting, removes an incorrect BOLT #7 label from a plain comment, and standardizes ‘BOLT 11’ to ‘BOLT-11’ in some test comments. No runtime logic, parsing, validation, or cryptographic code is modified.
Changed components
contrib/pyln-proto/pyln/proto/invoice.pycontrib/pyln-proto/pyln/proto/message/fundamental_types.pytests/test_closing.pytests/test_connection.pytests/test_pay.pytests/test_renepay.pytests/test_xpay.pyInspect captured patch +85 / −75
diff --git a/contrib/pyln-proto/pyln/proto/invoice.py b/contrib/pyln-proto/pyln/proto/invoice.py
index 5b9e38ce..27591cb0 100755
--- a/contrib/pyln-proto/pyln/proto/invoice.py
+++ b/contrib/pyln-proto/pyln/proto/invoice.py
@@ -12,9 +12,8 @@ import struct
# BOLT #11:
-#
-# A writer MUST encode `amount` as a positive decimal integer with no
-# leading zeroes, SHOULD use the shortest representation possible.
+# A writer:...
+# - MUST encode `amount` as a positive decimal integer with no leading 0s.
def shorten_amount(amount):
""" Given an amount in bitcoin, shorten it
"""
@@ -47,8 +46,10 @@ def unshorten_amount(amount):
}
unit = str(amount)[-1]
# BOLT #11:
- # A reader SHOULD fail if `amount` contains a non-digit, or is followed by
- # anything except a `multiplier` in the table above.
+ # A reader:...
+ # - if `amount` contains a non-digit OR is followed by anything except
+ # a `multiplier` (see table above):
+ # - MUST fail the payment.
if not re.fullmatch(r'\d+[pnum]?', str(amount)):
raise ValueError("Invalid amount '{}'".format(amount))
@@ -233,8 +234,12 @@ class Invoice(object):
for k, v in self.tags:
# BOLT #11:
- #
- # A writer MUST NOT include more than one `d`, `h`, `n` or `x` fields,
+ # A writer:...
+ # - MUST include either exactly one `d` or exactly one `h` field.
+ # ...
+ # - MAY include one `x` field.
+ # ...
+ # - MAY include one `n` field.
if k in ('d', 'h', 'n', 'x'):
if k in tags_set:
raise ValueError("Duplicate '{}' tag".format(k))
@@ -264,9 +269,8 @@ class Invoice(object):
tags_set.add(k)
# BOLT #11:
- #
- # A writer MUST include either a `d` or `h` field, and MUST NOT include
- # both.
+ # A writer:...
+ # - MUST include either exactly one `d` or exactly one `h` field.
if 'd' in tags_set and 'h' in tags_set:
raise ValueError("Cannot include both 'd' and 'h'")
if 'd' not in tags_set and 'h' not in tags_set:
@@ -285,8 +289,9 @@ class Invoice(object):
raise ValueError("Bad bech32 checksum")
# BOLT #11:
- #
- # A reader MUST fail if it does not understand the `prefix`.
+ # A reader:
+ # - if it does NOT understand the `prefix`:
+ # - MUST fail the payment.
if not hrp.startswith('ln'):
raise ValueError("Does not start with ln")
@@ -306,10 +311,13 @@ class Invoice(object):
inv.currency = m.group(0)
amountstr = hrp[2 + m.end():]
# BOLT #11:
- #
- # A reader SHOULD indicate if amount is unspecified, otherwise it MUST
- # multiply `amount` by the `multiplier` value (if any) to derive the
- # amount required for payment.
+ # A reader:...
+ # - if the `amount` is empty:
+ # - SHOULD indicate to the payer that amount is unspecified.
+ # - otherwise:...
+ # - if the `multiplier` is present:
+ # - MUST multiply `amount` by the `multiplier` value to derive the
+ # amount required for payment.
if amountstr != '':
inv.amount = unshorten_amount(amountstr)
@@ -319,10 +327,9 @@ class Invoice(object):
tag, tagdata, data = pull_tagged(data)
# BOLT #11:
- #
- # A reader MUST skip over unknown fields, an `f` field with unknown
- # `version`, or a `p`, `h`, `n` or `r` field which does not have
- # `data_length` 52, 52, 53 or 82 respectively.
+ # A reader:
+ # - MUST skip over `f` fields that use an unknown `version`.
+ # - MUST fail the payment if any mandatory field (`p`, `h`, `s`, `n`) does not have the correct length (52, 52, 52, 53).
data_length = len(tagdata) / 5
if tag == 'r':
@@ -379,14 +386,13 @@ class Invoice(object):
inv.unknown_tags.append((tag, tagdata))
# BOLT #11:
- #
- # A reader MUST check that the `signature` is valid (see the `n` tagged
- # field specified below).
+ # A reader:
+ # - MUST check that the `signature` is valid (see the `n` tagged field specified below).
if inv.pubkey: # Specified by `n`
# BOLT #11:
- #
- # A reader MUST use the `n` field to validate the signature instead of
- # performing signature recovery if a valid `n` field is provided.
+ # A reader:...
+ # - if a valid `n` field is provided:
+ # - MUST use the `n` field to validate the signature instead of performing signature recovery.
inv.signature = inv.pubkey.ecdsa_deserialize_compact(sigdecoded[0:64])
if not inv.pubkey.ecdsa_verify(bytearray([ord(c) for c in hrp]) + data.tobytes(), inv.signature):
raise ValueError('Invalid signature')
diff --git a/contrib/pyln-proto/pyln/proto/message/fundamental_types.py b/contrib/pyln-proto/pyln/proto/message/fundamental_types.py
index 36ef3174..fdf91071 100644
--- a/contrib/pyln-proto/pyln/proto/message/fundamental_types.py
+++ b/contrib/pyln-proto/pyln/proto/message/fundamental_types.py
@@ -254,21 +254,18 @@ def fundamental_types() -> List[FieldType]:
# Various fundamental types are referred to in the message specifications:
#
# * `byte`: an 8-bit byte
- # * `u16`: a 2 byte unsigned integer
- # * `u32`: a 4 byte unsigned integer
- # * `u64`: an 8 byte unsigned integer
# * `s8`: an 8-bit signed integer
+ # * `u16`: a 2 byte unsigned integer
# * `s16`: a 2 byte signed integer
+ # * `u32`: a 4 byte unsigned integer
# * `s32`: a 4 byte signed integer
+ # * `u64`: an 8 byte unsigned integer
# * `s64`: an 8 byte signed integer
- #
- # Inside TLV records which contain a single value, leading zeros in
- # integers can be omitted:
- #
- # * `tu16`: a 0 to 2 byte unsigned integer
- # * `tu32`: a 0 to 4 byte unsigned integer
- # * `tu64`: a 0 to 8 byte unsigned integer
- #
+ # ...
+ # * `tu16`: a 0 to 2 byte truncated unsigned integer
+ # * `tu32`: a 0 to 4 byte truncated unsigned integer
+ # * `tu64`: a 0 to 8 byte truncated unsigned integer
+ # ...
# The following convenience types are also defined:
#
# * `chain_hash`: a 32-byte chain identifier (see [BOLT
@@ -277,10 +274,12 @@ def fundamental_types() -> List[FieldType]:
# #2](02-peer-protocol.md#definition-of-channel-id))
# * `sha256`: a 32-byte SHA2-256 hash
# * `signature`: a 64-byte bitcoin Elliptic Curve signature
+ # ...
# * `point`: a 33-byte Elliptic Curve point (compressed encoding as per
# [SEC 1 standard](http://www.secg.org/sec1-v2.pdf#subsubsection.2.3.3))
# * `short_channel_id`: an 8 byte value identifying a channel (see [BOLT
# #7](07-routing-gossip.md#definition-of-short-channel-id))
+ # ...
# * `bigsize`: a variable-length, unsigned integer similar to Bitcoin's
# CompactSize encoding, but big-endian. Described in
# [BigSize](#appendix-a-bigsize-test-vectors).
diff --git a/tests/test_closing.py b/tests/test_closing.py
index 8ff587ab..9dec96d7 100644
--- a/tests/test_closing.py
+++ b/tests/test_closing.py
@@ -3337,9 +3337,9 @@ Try a range of future segwit versions as shutdown scripts. We create many nodes
l1 = node_factory.get_node(allow_warning=True)
# BOLT #2:
- # 5. if (and only if) `option_shutdown_anysegwit` is negotiated:
+ # 3. if (and only if) `option_shutdown_anysegwit` is negotiated:
# * `OP_1` through `OP_16` inclusive, followed by a single push of 2 to 40 bytes
- # (witness program versions 1 through 16)
+ # (witness program versions 1 through 16)
edge_valid = ['51020000', '5128' + '00' * 0x28,
'60020000', '6028' + '00' * 0x28]
other_valid = ['52020000', '5228' + '00' * 0x28,
diff --git a/tests/test_connection.py b/tests/test_connection.py
index 2aef8568..f868b31c 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -346,9 +346,13 @@ def test_opening_tiny_channel(node_factory, anchors):
# 1. Try to establish channel with capacity 1sat smaller than min_capacity_sat
# 2. Try to establish channel with capacity exact min_capacity_sat
#
- # BOLT2
+ # BOLT #2:
# The receiving node MAY fail the channel if:
- # - funding_satoshis is too small
+ # ...
+ # - `funding_satoshis` is too small.
+ # ...
+ # The receiving node MUST fail the channel if:
+ # ...
# - it considers `feerate_per_kw` too small for timely processing or unreasonably large.
#
dustlimit = 546
diff --git a/tests/test_pay.py b/tests/test_pay.py
index ec3b8d49..af59e118 100644
--- a/tests/test_pay.py
+++ b/tests/test_pay.py
@@ -830,18 +830,19 @@ def test_decode(node_factory):
#
# Breakdown:
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
# * `s`: payment secret
# * `p5`: `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
# * `zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs`: payment secret 1111111111111111111111111111111111111111111111111111111111111111
# * `p`: payment hash
- # * `p5`: `data_length` (`p` = 1, `5` = 20. 1 * 32 + 20 == 52)
+ # * `p5`: `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
# * `qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypq`: payment hash 0001020304050607080900010203040506070809000102030405060708090102
# * `d`: short description
- # * `pl`: `data_length` (`p` = 1, `l` = 31. 1 * 32 + 31 == 63)
+ # * `pl`: `data_length` (`p` = 1, `l` = 31; 1 * 32 + 31 == 63)
# * `2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq`: 'Please consider supporting this project'
+ # ...
# * `357wnc5r2ueh7ck6q93dj32dlqnls087fxdwk8qakdyafkq3yap9us6v52vjjsrvywa6rt52cm9r9zqt8r2t7mlcwspyetp5h2tztugp`: signature
# * `9lfyql`: Bech32 checksum
b11 = l1.rpc.decode(
@@ -864,18 +865,19 @@ def test_decode(node_factory):
#
# Breakdown:
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `2500u`: amount (2500 micro-bitcoin)
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
# * `s`: payment secret...
# * `p`: payment hash...
# * `d`: short description
- # * `q5`: `data_length` (`q` = 0, `5` = 20. 0 * 32 + 20 == 20)
+ # * `q5`: `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
# * `xysxxatsyp3k7enxv4js`: '1 cup coffee'
# * `x`: expiry time
- # * `qz`: `data_length` (`q` = 0, `z` = 2. 0 * 32 + 2 == 2)
- # * `pu`: 60 seconds (`p` = 1, `u` = 28. 1 * 32 + 28 == 60)
+ # * `qz`: `data_length` (`q` = 0, `z` = 2; 0 * 32 + 2 == 2)
+ # * `pu`: 60 seconds (`p` = 1, `u` = 28; 1 * 32 + 28 == 60)
+ # ...
# * `uk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgp`: signature
# * `fna3rh`: Bech32 checksum
b11 = l1.rpc.decode(
@@ -935,15 +937,15 @@ def test_decode(node_factory):
#
# Breakdown:
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `20m`: amount (20 milli-bitcoin)
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
- # * `p`: payment hash...
# * `s`: payment secret...
+ # * `p`: payment hash...
# * `h`: tagged field: hash of description
- # * `p5`: `data_length` (`p` = 1, `5` = 20. 1 * 32 + 20 == 52)
- # * `8yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs`: SHA256 of 'One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon'
+ # * `p5`: `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
+ # * `8yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs`: SHA256 of 'One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon'...
# * `9`: features
# * `qr`: `data_length` (`q` = 0, `r` = 3; 0 * 32 + 3 == 3)
# * `sgq`: b100000100000000
@@ -975,7 +977,7 @@ def test_decode(node_factory):
# * `s`: payment secret...
# * `p`: payment hash...
# * `f`: tagged field: fallback address
- # * `pp`: `data_length` (`p` = 1. 1 * 32 + 1 == 33)
+ # * `pp`: `data_length` (`p` = 1; 1 * 32 + 1 == 33)
# * `3x9et2e20v6pu37c5d9vax37wxq72un98`: `3` = 17, so P2PKH address
# * `h`: tagged field: hash of description...
# * `qh84fmvn2klvglsjxfy0vq2mz6t9kjfzlxfwgljj35w2kwa60qv49k7jlsgx43yhs9nuutllkhhnt090mmenuhp8ue33pv4klmrzlcqp`: signature
@@ -1003,7 +1005,7 @@ def test_decode(node_factory):
#
# Breakdown:
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `20m`: amount (20 milli-bitcoin)
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
@@ -1011,7 +1013,7 @@ def test_decode(node_factory):
# * `p`: payment hash...
# * `h`: tagged field: hash of description...
# * `f`: tagged field: fallback address
- # * `pp`: `data_length` (`p` = 1. 1 * 32 + 1 == 33)
+ # * `pp`: `data_length` (`p` = 1; 1 * 32 + 1 == 33)
# * `3` = 17, so P2PKH address
# * `qjmp7lwpagxun9pygexvgpjdc4jdj85f`: 160 bit P2PKH address
# * `r`: tagged field: route information
@@ -1051,13 +1053,13 @@ def test_decode(node_factory):
#
# Breakdown:
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `20m`: amount (20 milli-bitcoin)
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
# * `p`: payment hash...
# * `f`: tagged field: fallback address.
- # * `pp`: `data_length` (`p` = 1. 1 * 32 + 1 == 33)
+ # * `pp`: `data_length` (`p` = 1; 1 * 32 + 1 == 33)
# * `j3a24vwu6r8ejrss3axul8rxldph2q7z9`: `j` = 18, so P2SH address
# * `h`: tagged field: hash of description...
# * `z6qsgww34xlatfj6e3sngrwfy3ytkt29d2qttr8qz2mnedfqysuqypgqex4haa2h8fx3wnypranf3pdwyluftwe680jjcfp438u82xqp`: signature
@@ -1076,13 +1078,13 @@ def test_decode(node_factory):
# > ### On mainnet, with fallback (P2WPKH) address bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
# > lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygshp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqfppqw508d6qejxtdg4y5r3zarvary0c5xw7k9qrsgqt29a0wturnys2hhxpner2e3plp6jyj8qx7548zr2z7ptgjjc7hljm98xhjym0dg52sdrvqamxdezkmqg4gdrvwwnf0kv2jdfnl4xatsqmrnsse
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `20m`: amount (20 milli-bitcoin)
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
# * `p`: payment hash...
# * `f`: tagged field: fallback address.
- # * `pp`: `data_length` (`p` = 1. 1 * 32 + 1 == 33)
+ # * `pp`: `data_length` (`p` = 1; 1 * 32 + 1 == 33)
# * `q`: 0, so witness version 0.
# * `qw508d6qejxtdg4y5r3zarvary0c5xw7k`: 160 bits = P2WPKH.
# * `h`: tagged field: hash of description...
@@ -1102,13 +1104,13 @@ def test_decode(node_factory):
# > ### On mainnet, with fallback (P2WSH) address bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3
# > lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygshp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqfp4qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q9qrsgq9vlvyj8cqvq6ggvpwd53jncp9nwc47xlrsnenq2zp70fq83qlgesn4u3uyf4tesfkkwwfg3qs54qe426hp3tz7z6sweqdjg05axsrjqp9yrrwc
#
- # * `lnbc`: prefix, lightning on bitcoin mainnet
+ # * `lnbc`: prefix, Lightning on Bitcoin mainnet
# * `20m`: amount (20 milli-bitcoin)
# * `1`: Bech32 separator
# * `pvjluez`: timestamp (1496314658)
# * `p`: payment hash...
# * `f`: tagged field: fallback address.
- # * `p4`: `data_length` (`p` = 1, `4` = 21. 1 * 32 + 21 == 53)
+ # * `p4`: `data_length` (`p` = 1, `4` = 21; 1 * 32 + 21 == 53)
# * `q`: 0, so witness version 0.
# * `rp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q`: 260 bits = P2WSH.
# * `h`: tagged field: hash of description...
@@ -2409,7 +2411,6 @@ def test_setchannel_routing(node_factory, bitcoind):
# test fees are applied to HTLC forwards
#
- # BOLT #7:
# If l1 were to send 4,999,999 millisatoshi to l3 via l2, it needs to
# pay l2 the fee it specified in the l2->l3 `channel_update`, calculated as
# per [HTLC Fees](#htlc_fees): base + amt * pm / 10**6
@@ -6070,7 +6071,7 @@ def test_fetch_no_description_with_amount(node_factory):
# Deprecated fields make schema checker upset.
# BOLT #12:
#
- # - if offer_amount is set and offer_description is not set:
+ # - if `offer_amount` is set and `offer_description` is not set:
# - MUST NOT respond to the offer.
err = r'description is required for the user to know what it was they paid for'
with pytest.raises(RpcError, match=err) as err:
diff --git a/tests/test_renepay.py b/tests/test_renepay.py
index 65735426..c30bde01 100644
--- a/tests/test_renepay.py
+++ b/tests/test_renepay.py
@@ -857,13 +857,13 @@ def test_offer_selfpay(node_factory):
def test_unannounced(node_factory):
l1, l2 = node_factory.line_graph(2, announce_channels=False)
- # BOLT11 direct peer
+ # BOLT-11 direct peer
b11 = l2.rpc.invoice(
"100sat", "test_renepay_unannounced", "test_renepay_unannounced"
)["bolt11"]
ret = l1.rpc.call("renepay", {"invstring": b11})
assert ret["status"] == "complete"
- # BOLT12 direct peer
+ # BOLT-12 direct peer
offer = l2.rpc.offer("any")["bolt12"]
b12 = l1.rpc.fetchinvoice(offer, "21sat")["invoice"]
ret = l1.rpc.call("renepay", {"invstring": b12})
diff --git a/tests/test_xpay.py b/tests/test_xpay.py
index a8979acb..3ba80066 100644
--- a/tests/test_xpay.py
+++ b/tests/test_xpay.py
@@ -147,7 +147,7 @@ def test_xpay_simple(node_factory):
node_factory.join_nodes([l1, l2, l3], wait_for_announce=True)
node_factory.join_nodes([l3, l4], announce_channels=False)
- # BOLT 11, direct peer
+ # BOLT-11, direct peer
b11 = l2.rpc.invoice('10000msat', 'test_xpay_simple', 'test_xpay_simple bolt11')['bolt11']
ret = l1.rpc.xpay(b11)
assert ret['failed_parts'] == 0
@@ -160,7 +160,7 @@ def test_xpay_simple(node_factory):
with pytest.raises(RpcError, match="Already paid"):
l1.rpc.xpay(b11_paid)
- # BOLT 11, indirect peer
+ # BOLT-11, indirect peer
b11 = l3.rpc.invoice('10000msat', 'test_xpay_simple', 'test_xpay_simple bolt11')['bolt11']
ret = l1.rpc.xpay(b11)
assert ret['failed_parts'] == 0
@@ -168,16 +168,16 @@ def test_xpay_simple(node_factory):
assert ret['amount_msat'] == 10000
assert ret['amount_sent_msat'] == 10001
- # BOLT 11, routehint
+ # BOLT-11, routehint
b11 = l4.rpc.invoice('10000msat', 'test_xpay_simple', 'test_xpay_simple bolt11')['bolt11']
l1.rpc.xpay(b11)
- # BOLT 12 (with payer_note specified).
+ # BOLT-12 (with payer_note specified).
offer = l3.rpc.offer('any')['bolt12']
b12 = l1.rpc.fetchinvoice(offer, '100000msat')['invoice']
l1.rpc.xpay(invstring=b12, payer_note="Payment for a cup of coffee")
- # BOLT 12, direct peer
+ # BOLT-12, direct peer
offer = l2.rpc.offer('any')['bolt12']
b12 = l1.rpc.fetchinvoice(offer, '10000msat')['invoice']
ret = l1.rpc.xpay(invstring=b12)
@@ -425,7 +425,7 @@ def test_xpay_takeover(node_factory, executor):
l1.rpc.pay(b12)
l1.daemon.wait_for_log('Redirecting pay->xpay')
- # BOLT11 with amount.
+ # BOLT-11 with amount.
inv = l3.rpc.invoice('any', "test_xpay_takeover3", "test_xpay_takeover3")['bolt11']
l1.rpc.pay(inv, amount_msat=10000)
l1.daemon.wait_for_log('Redirecting pay->xpay')
@@ -566,7 +566,7 @@ def test_xpay_maxdelay(node_factory):
def test_xpay_unannounced(node_factory):
l1, l2 = node_factory.line_graph(2, announce_channels=False)
- # BOLT 11, direct peer
+ # BOLT-11, direct peer
b11 = l2.rpc.invoice('10000msat', 'test_xpay_unannounced', 'test_xpay_unannounced bolt11')['bolt11']
ret = l1.rpc.xpay(b11)
assert ret['failed_parts'] == 0
@@ -574,7 +574,7 @@ def test_xpay_unannounced(node_factory):
assert ret['amount_msat'] == 10000
assert ret['amount_sent_msat'] == 10000
- # BOLT 12, direct peer
+ # BOLT-12, direct peer
offer = l2.rpc.offer('any')['bolt12']
b12 = l1.rpc.fetchinvoice(offer, '100000msat')['invoice']
l1.rpc.xpay(b12)
@@ -593,7 +593,7 @@ def test_xpay_zeroconf(node_factory):
wait_for(lambda: all([c['state'] == 'CHANNELD_NORMAL' for c in l1.rpc.listpeerchannels()['channels'] + l2.rpc.listpeerchannels()['channels']]))
- # BOLT 11, direct peer
+ # BOLT-11, direct peer
b11 = l2.rpc.invoice('10000msat', 'test_xpay_unannounced', 'test_xpay_unannounced bolt11')['bolt11']
ret = l1.rpc.xpay(b11)
assert ret['failed_parts'] == 0
@@ -601,7 +601,7 @@ def test_xpay_zeroconf(node_factory):
assert ret['amount_msat'] == 10000
assert ret['amount_sent_msat'] == 10000
- # BOLT 12, direct peer
+ # BOLT-12, direct peer
offer = l2.rpc.offer('any')['bolt12']
b12 = l1.rpc.fetchinvoice(offer, '100000msat')['invoice']
l1.rpc.xpay(b12)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.