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

Method singleton

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

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

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

tlv_structsMethod · 0.80

Calls 2

nextFunction · 0.85
iterClass · 0.85

Tested by

no test coverage detected