autogenerate-rpc-examples.py: more refinement.
What changed, and why it matters
This commit only changes a test helper script that generates documentation examples for RPC commands. It switches which simulated Lightning node is used for some example screenshots and stops filtering bookkeeper events. There is no change to the actual Core Lightning software that users run, so it cannot affect real wallets, payments, or network security.
No security action needed; this is a documentation/test tooling change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/autogenerate-rpc-examples.py, a developer tooling script that produces RPC example outputs for documentation. It removes a filter that kept only ‘channel_open’ events in bkpr-listaccountevents examples, and changes several list* RPC examples to query node l2 or l3 instead of l1 to reduce output variability. No production code, protocol handling, cryptography, or permissions are touched.
Changed components
tests/autogenerate-rpc-examples.pyInspect captured patch +10 / −11
diff --git a/tests/autogenerate-rpc-examples.py b/tests/autogenerate-rpc-examples.py
index ca1c8f52..965bf8bd 100644
--- a/tests/autogenerate-rpc-examples.py
+++ b/tests/autogenerate-rpc-examples.py
@@ -416,7 +416,6 @@ def generate_bookkeeper_examples(l2, l3, c23_2_chan_id):
update_example(node=l3, method='bkpr-listbalances', params={})
bkprlistaccountevents_res1 = l3.rpc.bkpr_listaccountevents(c23_2_chan_id)
- bkprlistaccountevents_res1['events'] = [next((event for event in bkprlistaccountevents_res1['events'] if event['tag'] == 'channel_open'), None)]
update_example(node=l3, method='bkpr-listaccountevents', params=[c23_2_chan_id], response=bkprlistaccountevents_res1)
bkprlistaccountevents_res2 = l3.rpc.bkpr_listaccountevents()
update_example(node=l3, method='bkpr-listaccountevents', params={}, response=bkprlistaccountevents_res2)
@@ -1084,8 +1083,8 @@ def generate_list_examples(bitcoind, l1, l2, l3, c12, c23_2, inv_l31, inv_l32, o
# Make sure all nodes are caught up.
sync_blockheight(bitcoind, [l1, l2, l3])
# Transactions Lists
- listfunds_res1 = l1.rpc.listfunds()
- update_example(node=l1, method='listfunds', params={}, response=listfunds_res1)
+ listfunds_res1 = l2.rpc.listfunds()
+ update_example(node=l2, method='listfunds', params={}, response=listfunds_res1)
listforwards_res1 = l2.rpc.listforwards(in_channel=c12, out_channel=c23_2, status='settled')
update_example(node=l2, method='listforwards', params={'in_channel': c12, 'out_channel': c23_2, 'status': 'settled'}, response=listforwards_res1)
@@ -1112,8 +1111,8 @@ def generate_list_examples(bitcoind, l1, l2, l3, c12, c23_2, inv_l31, inv_l32, o
listpays_res2 = l2.rpc.listpays()
update_example(node=l2, method='listpays', params={}, response=listpays_res2)
- listtransactions_res1 = l1.rpc.listtransactions()
- update_example(node=l1, method='listtransactions', params={}, response=listtransactions_res1)
+ listtransactions_res3 = l3.rpc.listtransactions()
+ update_example(node=l3, method='listtransactions', params={}, response=listtransactions_res3)
listclosedchannels_res1 = l2.rpc.listclosedchannels()
update_example(node=l2, method='listclosedchannels', params={}, response=listclosedchannels_res1)
@@ -1126,15 +1125,15 @@ def generate_list_examples(bitcoind, l1, l2, l3, c12, c23_2, inv_l31, inv_l32, o
update_example(node=l2, method='listsqlschemas', params={'table': 'offers'})
update_example(node=l2, method='listsqlschemas', params=['closedchannels'])
- listpeerchannels_res1 = l1.rpc.listpeerchannels(l2.info['id'])
- update_example(node=l1, method='listpeerchannels', params={'id': l2.info['id']}, response=listpeerchannels_res1)
- listpeerchannels_res2 = l1.rpc.listpeerchannels()
- update_example(node=l1, method='listpeerchannels', params={}, response=listpeerchannels_res2)
+ listpeerchannels_res1 = l2.rpc.listpeerchannels(l1.info['id'])
+ update_example(node=l2, method='listpeerchannels', params={'id': l1.info['id']}, response=listpeerchannels_res1)
+ listpeerchannels_res2 = l2.rpc.listpeerchannels()
+ update_example(node=l2, method='listpeerchannels', params={}, response=listpeerchannels_res2)
listchannels_res1 = l1.rpc.listchannels(c12)
update_example(node=l1, method='listchannels', params={'short_channel_id': c12}, response=listchannels_res1)
- listchannels_res2 = l1.rpc.listchannels()
- update_example(node=l1, method='listchannels', params={}, response=listchannels_res2)
+ listchannels_res2 = l2.rpc.listchannels()
+ update_example(node=l2, method='listchannels', params={}, response=listchannels_res2)
listnodes_res1 = l2.rpc.listnodes(l3.info['id'])
update_example(node=l2, method='listnodes', params={'id': l3.info['id']}, response=listnodes_res1)
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.