OK, let's return the mature node here afterall. Saves the awkward rename.

pull/1868/head
jMyles 2020-04-15 00:16:33 -07:00
parent bbe8588700
commit f3dddf4b06
2 changed files with 4 additions and 2 deletions

View File

@ -53,8 +53,7 @@ class NucypherMiddlewareClient:
"""
if node_or_sprout:
if node_or_sprout is not EXEMPT_FROM_VERIFICATION:
node_or_sprout.mature() # Morph into a node.
node = node_or_sprout # Definitely a node.
node = node_or_sprout.mature() # Morph into a node.
node.verify_node(network_middleware_client=self, registry=self.registry)
return self.parse_node_or_host_and_port(node_or_sprout, host, port)

View File

@ -271,6 +271,7 @@ class NodeSprout(PartiallyKwargifiedBytes):
self.__class__ = mature_node.__class__
self.__dict__ = mature_node.__dict__
return self # To reduce the awkwardity of renaming; this is always the weird part of polymorphism for me.
class Learner:
@ -1011,6 +1012,8 @@ class Teacher:
"""
This is the most mature form, so we do nothing.
"""
return self
@classmethod
def set_federated_mode(cls, federated_only: bool):
cls._federated_only_instances = federated_only