Skip to content

Commit

Permalink
pytest: update examples generation for listpeerchannels
Browse files Browse the repository at this point in the history
with fixed our/their_max_htlc_value_in_flight_msat values

suggested by @ShahanaFarooqui
  • Loading branch information
endothermicdev committed Feb 21, 2025
1 parent a6e476a commit 5b83eff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/autogenerate-rpc-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,8 @@ def generate_list_examples(l1, l2, l3, c12, c23_2, inv_l31, inv_l32, offer_l23,
channel['alias']['local'] = '3000000' + str(i) + 'x6000000' + str(i) + 'x6000' + str(i)
channel['alias']['remote'] = '1000000' + str(i) + 'x2000000' + str(i) + 'x3000' + str(i)
channel['max_total_htlc_in_msat'] = NEW_VALUES_LIST['htlc_max_msat']
channel['their_max_htlc_value_in_flight_msat'] = NEW_VALUES_LIST['htlc_max_msat']
channel['our_max_htlc_value_in_flight_msat'] = NEW_VALUES_LIST['htlc_max_msat']
for j, state in enumerate(channel['state_changes'], start=1):
state['timestamp'] = '2024-10-10T00:0' + str(j) + ':00.000Z'
update_example(node=l1, method='listpeerchannels', params={'id': l2.info['id']}, response=listpeerchannels_res1)
Expand All @@ -1991,6 +1993,8 @@ def generate_list_examples(l1, l2, l3, c12, c23_2, inv_l31, inv_l32, offer_l23,
channel['close_to'] = 'db2dec31' + (('0' + str(i)) * 30)
channel['status'][0] = re.sub(r'(tx:)[a-f0-9]+', r'\1' + scrt_id, channel['status'][0])
channel['max_total_htlc_in_msat'] = NEW_VALUES_LIST['htlc_max_msat']
channel['their_max_htlc_value_in_flight_msat'] = NEW_VALUES_LIST['htlc_max_msat']
channel['our_max_htlc_value_in_flight_msat'] = NEW_VALUES_LIST['htlc_max_msat']
if 'inflight' in channel and len(channel['inflight']) > 0:
channel['inflight'][0]['scratch_txid'] = scrt_id
for j, state in enumerate(channel['state_changes'], start=1):
Expand Down

0 comments on commit 5b83eff

Please sign in to comment.