@@ -366,7 +366,6 @@ def update_examples_in_schema_files():
366
366
updated_examples = {}
367
367
for method , method_examples in EXAMPLES_JSON .items ():
368
368
try :
369
- global CWD
370
369
file_path = os .path .join (CWD , 'doc' , 'schemas' , f'{ method } .json' ) if method != 'sql' else os .path .join (CWD , 'doc' , 'schemas' , f'{ method } -template.json' )
371
370
logger .info (f'Updating examples for { method } in file { file_path } ' )
372
371
with open (file_path , 'r+' , encoding = 'utf-8' ) as file :
@@ -441,7 +440,6 @@ def setup_test_nodes(node_factory, bitcoind):
441
440
l6.info['id']: 0265b6ab5ec860cd257865d61ef0bbf5b3339c36cbda8b26b74e7f1dca490b6518
442
441
"""
443
442
try :
444
- global FUND_WALLET_AMOUNT_SAT , FUND_CHANNEL_AMOUNT_SAT
445
443
options = [
446
444
{
447
445
'experimental-dual-fund' : None ,
@@ -537,7 +535,6 @@ def generate_transactions_examples(l1, l2, l3, l4, l5, c25, bitcoind):
537
535
"""Generate examples for various transactions and forwards"""
538
536
try :
539
537
logger .info ('Simple Transactions Start...' )
540
- global FUND_CHANNEL_AMOUNT_SAT
541
538
# Simple Transactions by creating invoices, paying invoices, keysends
542
539
inv_l31 = update_example (node = l3 , method = 'invoice' , params = {'amount_msat' : 10 ** 4 , 'label' : 'lbl_l31' , 'description' : 'Invoice description l31' })
543
540
route_l1_l3 = update_example (node = l1 , method = 'getroute' , params = {'id' : l3 .info ['id' ], 'amount_msat' : 10 ** 4 , 'riskfactor' : 1 })['route' ]
@@ -1157,7 +1154,6 @@ def generate_utils_examples(l1, l2, l3, l4, l5, l6, c23_2, c34_2, inv_l11, inv_l
1157
1154
"""Generates other utilities examples"""
1158
1155
try :
1159
1156
logger .info ('General Utils Start...' )
1160
- global CWD , FUND_CHANNEL_AMOUNT_SAT
1161
1157
update_example (node = l2 , method = 'batching' , params = {'enable' : True })
1162
1158
update_example (node = l2 , method = 'ping' , params = {'id' : l1 .info ['id' ], 'len' : 128 , 'pongbytes' : 128 })
1163
1159
update_example (node = l2 , method = 'ping' , params = {'id' : l3 .info ['id' ], 'len' : 1000 , 'pongbytes' : 65535 })
@@ -1303,7 +1299,6 @@ def generate_splice_examples(node_factory, bitcoind):
1303
1299
"""Generates splice related examples"""
1304
1300
try :
1305
1301
logger .info ('Splice Start...' )
1306
- global FUND_WALLET_AMOUNT_SAT , FUND_CHANNEL_AMOUNT_SAT
1307
1302
# Basic setup for l7->l8
1308
1303
options = [
1309
1304
{
@@ -1376,7 +1371,6 @@ def generate_channels_examples(node_factory, bitcoind, l1, l3, l4, l5):
1376
1371
"""Generates fundchannel and openchannel related examples"""
1377
1372
try :
1378
1373
logger .info ('Channels Start...' )
1379
- global FUND_WALLET_AMOUNT_SAT , FUND_CHANNEL_AMOUNT_SAT
1380
1374
# Basic setup for l9->l10 for fundchannel examples
1381
1375
options = [
1382
1376
{
@@ -1684,7 +1678,6 @@ def generate_autoclean_delete_examples(l1, l2, l3, l4, l5, c12, c23):
1684
1678
"""Records autoclean and delete examples"""
1685
1679
try :
1686
1680
logger .info ('Auto-clean and Delete Start...' )
1687
- global FUND_CHANNEL_AMOUNT_SAT
1688
1681
l2 .rpc .close (l5 .info ['id' ])
1689
1682
dfc_res1 = update_example (node = l2 , method = 'dev-forget-channel' , params = {'id' : l5 .info ['id' ]}, description = [f'Forget a channel by peer pubkey when only one channel exists with the peer:' ])
1690
1683
@@ -2034,7 +2027,6 @@ def generate_list_examples(l1, l2, l3, c12, c23_2, inv_l31, inv_l32, offer_l23,
2034
2027
2035
2028
@pytest .fixture (autouse = True )
2036
2029
def setup_logging ():
2037
- global logger
2038
2030
logger .setLevel (logging .DEBUG )
2039
2031
formatter = logging .Formatter ("%(asctime)s - %(levelname)s - %(message)s" , "%H:%M:%S" )
2040
2032
stream_handler = logging .StreamHandler ()
@@ -2054,7 +2046,6 @@ def test_generate_examples(node_factory, bitcoind, executor):
2054
2046
def list_all_examples ():
2055
2047
"""list all methods used in 'update_example' calls to ensure that all methods are covered"""
2056
2048
try :
2057
- global REGENERATING_RPCS
2058
2049
methods = []
2059
2050
file_path = os .path .abspath (__file__ )
2060
2051
@@ -2076,7 +2067,6 @@ def list_all_examples():
2076
2067
def list_missing_examples ():
2077
2068
"""Checks for missing example & log an error if missing."""
2078
2069
try :
2079
- global ALL_RPC_EXAMPLES
2080
2070
missing_examples = ''
2081
2071
for file_name in os .listdir ('doc/schemas' ):
2082
2072
if not file_name .endswith ('.json' ):
0 commit comments