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

Method singleton

tools/generate-wire.py:178–182  ·  view source on GitHub ↗

Return the single message, if there's only one, otherwise None

(self)

Source from the content-addressed store, hash-verified

176 return any([field.needs_context() or field.is_optional for field in self.fields.values()])
177
178 def singleton(self):
179 """Return the single message, if there's only one, otherwise None"""
180 if len(self.fields) == 1:
181 return next(iter(self.fields.values()))
182 return None
183
184
185class Type(FieldSet):

Callers 1

tlv_structsMethod · 0.80

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected