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

Function zero_fields

tests/test_xpay.py:817–828  ·  view source on GitHub ↗
(obj, fieldnames)

Source from the content-addressed store, hash-verified

815
816def test_attempt_notifications(node_factory):
817 def zero_fields(obj, fieldnames):
818 if isinstance(obj, dict):
819 for k, v in obj.items():
820 if k in fieldnames:
821 obj[k] = 0
822 else:
823 zero_fields(v, fieldnames)
824 elif isinstance(obj, list):
825 for item in obj:
826 zero_fields(item, fieldnames)
827 # other types are ignored
828 return obj
829
830 plugin_path = os.path.join(os.getcwd(), 'tests/plugins/custom_notifications.py')
831 l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected