Skip to content

Commit

Permalink
doc: fix injectpaymentonion schema.
Browse files Browse the repository at this point in the history
I used an unknown arg and it didn't complain.  injectpaymentonion's schema predated
the sweep which fixed up use of "additionalProperties".

Indeed, we were missing some properties!

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Dec 17, 2024
1 parent 597a414 commit 6311a54
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 37 deletions.
7 changes: 6 additions & 1 deletion .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,8 @@
"InjectpaymentonionResponse": {
"InjectPaymentOnion.completed_at": 2,
"InjectPaymentOnion.created_at": 1,
"InjectPaymentOnion.created_index": 3
"InjectPaymentOnion.created_index": 3,
"InjectPaymentOnion.payment_preimage": 4
},
"InvoiceRequest": {
"Invoice.amount_msat": 10,
Expand Down Expand Up @@ -7575,6 +7576,10 @@
"added": "v24.11",
"deprecated": null
},
"InjectPaymentOnion.payment_preimage": {
"added": "v24.11",
"deprecated": null
},
"Invoice": {
"added": "pre-v0.10.1",
"deprecated": null
Expand Down
1 change: 1 addition & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16143,14 +16143,14 @@
"lightning-injectpaymentonion.json": {
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "injectpaymentonion",
"title": "Send a payment with a custom onion packet",
"description": [
"The **injectpaymentonion** RPC command causes the node to receive a payment attempt similar to the way it would receive one from a peer. The onion packet is unwrapped, then handled normally: either as a local payment, or forwarded to the next peer.",
"Compared to lightning-sendonion(7): the handling of blinded paths and self-payments is trivial, and the interface blocks until the payment succeeds or fails. The call also fails if this payment_hash has already been successfully paid."
],
"request": {
"additionalProperties": false,
"required": [
"onion",
"payment_hash",
Expand Down Expand Up @@ -16217,6 +16217,7 @@
}
},
"response": {
"additionalProperties": false,
"required": [
"created_index",
"created_at",
Expand All @@ -16241,6 +16242,13 @@
"description": [
"1-based index indicating order this payment was created in."
]
},
"payment_preimage": {
"added": "v24.11",
"type": "secret",
"description": [
"The proof of payment: SHA256 of this is the invoice's **payment_hash**."
]
}
}
},
Expand Down
68 changes: 34 additions & 34 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3218,6 +3218,7 @@ def injectpaymentonion2py(m):
"completed_at": m.completed_at, # PrimitiveField in generate_composite
"created_at": m.created_at, # PrimitiveField in generate_composite
"created_index": m.created_index, # PrimitiveField in generate_composite
"payment_preimage": hexlify(m.payment_preimage), # PrimitiveField in generate_composite
})


Expand Down
10 changes: 9 additions & 1 deletion doc/schemas/lightning-injectpaymentonion.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "injectpaymentonion",
"title": "Send a payment with a custom onion packet",
"description": [
"The **injectpaymentonion** RPC command causes the node to receive a payment attempt similar to the way it would receive one from a peer. The onion packet is unwrapped, then handled normally: either as a local payment, or forwarded to the next peer.",
"Compared to lightning-sendonion(7): the handling of blinded paths and self-payments is trivial, and the interface blocks until the payment succeeds or fails. The call also fails if this payment_hash has already been successfully paid."
],
"request": {
"additionalProperties": false,
"required": [
"onion",
"payment_hash",
Expand Down Expand Up @@ -75,6 +75,7 @@
}
},
"response": {
"additionalProperties": false,
"required": [
"created_index",
"created_at",
Expand All @@ -99,6 +100,13 @@
"description": [
"1-based index indicating order this payment was created in."
]
},
"payment_preimage": {
"added": "v24.11",
"type": "secret",
"description": [
"The proof of payment: SHA256 of this is the invoice's **payment_hash**."
]
}
}
},
Expand Down

0 comments on commit 6311a54

Please sign in to comment.