MCPcopy Create free account
hub / github.com/ElementsProject/lightning / generate_datastore_examples

Function generate_datastore_examples

tests/autogenerate-rpc-examples.py:815–832  ·  view source on GitHub ↗

Covers all datastore related examples

(l2)

Source from the content-addressed store, hash-verified

813
814
815def generate_datastore_examples(l2):
816 """Covers all datastore related examples"""
817 try:
818 logger.info('Datastore Start...')
819 l2.rpc.datastore(key='somekey', hex='61', mode='create-or-append')
820 l2.rpc.datastore(key=['test', 'name'], string='saving data to the store', mode='must-create')
821 update_example(node=l2, method='datastore', params={'key': ['employee', 'index'], 'string': 'saving employee keys to the store', 'mode': 'must-create'})
822 update_example(node=l2, method='datastore', params={'key': 'otherkey', 'string': 'other', 'mode': 'must-create'})
823 update_example(node=l2, method='datastore', params={'key': 'otherkey', 'string': ' key: text to be appended to the otherkey', 'mode': 'must-append', 'generation': 0})
824 update_example(node=l2, method='datastoreusage', params={})
825 update_example(node=l2, method='datastoreusage', params={'key': ['test', 'name']})
826 update_example(node=l2, method='datastoreusage', params={'key': 'otherkey'})
827 update_example(node=l2, method='deldatastore', params={'key': ['test', 'name']})
828 update_example(node=l2, method='deldatastore', params={'key': 'otherkey', 'generation': 1})
829 logger.info('Datastore Done!')
830 except Exception as e:
831 logger.error(f'Error in generating datastore examples: {e}')
832 raise
833
834
835def generate_bookkeeper_examples(l2, l3, c23_2_chan_id):

Callers 1

test_generate_examplesFunction · 0.85

Calls 3

update_exampleFunction · 0.85
errorMethod · 0.80
datastoreMethod · 0.45

Tested by 1

test_generate_examplesFunction · 0.68