mirror of https://github.com/nucypher/nucypher.git
A few typos and naming fixes pointed out in RFCs.
parent
263c7a37a8
commit
2f3eeaca85
|
@ -884,7 +884,7 @@ class Bob(Character):
|
|||
|
||||
# Sanity check - do we even have enough nodes?
|
||||
if len(nodes) < no_less_than:
|
||||
raise ValueError(f"Can't select {no_less_than} from {len(nodes)} (Fleet state: {nodes.FleetState}")
|
||||
raise ValueError(f"Can't select {no_less_than} from {len(nodes)} (Fleet state: {nodes.FleetState})")
|
||||
|
||||
search_boundary = 2
|
||||
target_nodes = []
|
||||
|
@ -1645,7 +1645,7 @@ class Enrico(Character):
|
|||
def __init__(self, policy_encrypting_key=None, controller: bool = True, *args, **kwargs):
|
||||
self._policy_pubkey = policy_encrypting_key
|
||||
|
||||
# Encrico never uses the blockchain, hence federated_only)
|
||||
# Enrico never uses the blockchain, hence federated_only)
|
||||
kwargs['federated_only'] = True
|
||||
kwargs['known_node_class'] = None
|
||||
super().__init__(*args, **kwargs)
|
||||
|
|
|
@ -293,7 +293,7 @@ class Learner:
|
|||
|
||||
if self.learning_domains:
|
||||
one_and_only_learning_domain = tuple(self.learning_domains)[
|
||||
0] # TODO: Are we done with multiple domains? 2144
|
||||
0] # TODO: Are we done with multiple domains? 2144, 1580
|
||||
canonical_sage_uris = self.network_middleware.TEACHER_NODES.get(one_and_only_learning_domain, ())
|
||||
|
||||
for uri in canonical_sage_uris:
|
||||
|
|
|
@ -235,7 +235,7 @@ class TreasureMap:
|
|||
try:
|
||||
return self.public_id() == other.public_id()
|
||||
except AttributeError:
|
||||
raise TypeError(f"Can't compare f{other} to a TreasureMap (it needs to implement public_id() )")
|
||||
raise TypeError(f"Can't compare {other} to a TreasureMap (it needs to implement public_id() )")
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.destinations.items())
|
||||
|
|
|
@ -182,7 +182,7 @@ class NodeEngagementMutex:
|
|||
log = Logger("Policy")
|
||||
|
||||
def __init__(self,
|
||||
f, # TODO: typing.Protocol
|
||||
callable_to_engage, # TODO: typing.Protocol
|
||||
nodes,
|
||||
network_middleware,
|
||||
percent_to_complete_before_release=5,
|
||||
|
@ -190,7 +190,7 @@ class NodeEngagementMutex:
|
|||
threadpool_size=120,
|
||||
*args,
|
||||
**kwargs):
|
||||
self.f = f
|
||||
self.f = callable_to_engage
|
||||
self.nodes = nodes
|
||||
self.network_middleware = network_middleware
|
||||
self.args = args
|
||||
|
@ -211,9 +211,9 @@ class NodeEngagementMutex:
|
|||
self.when_complete = Deferred() # TODO: Allow cancelling via KB Interrupt or some other way?
|
||||
|
||||
if note is None:
|
||||
self._repr = f"{f} to {len(nodes)} nodes"
|
||||
self._repr = f"{callable_to_engage} to {len(nodes)} nodes"
|
||||
else:
|
||||
self._repr = f"{note}: {f} to {len(nodes)} nodes"
|
||||
self._repr = f"{note}: {callable_to_engage} to {len(nodes)} nodes"
|
||||
|
||||
self._threadpool = ThreadPool(minthreads=threadpool_size, maxthreads=threadpool_size, name=self._repr)
|
||||
self.log.info(f"NEM spinning up {self._threadpool}")
|
||||
|
@ -412,7 +412,7 @@ class Policy(ABC):
|
|||
self.alice.block_until_number_of_known_nodes_is(8, timeout=2, learn_on_this_thread=True)
|
||||
|
||||
target_nodes = self.bob.matching_nodes_among(self.alice.known_nodes)
|
||||
self.publishing_mutex = NodeEngagementMutex(f=self.put_treasure_map_on_node,
|
||||
self.publishing_mutex = NodeEngagementMutex(callable_to_engage=self.put_treasure_map_on_node,
|
||||
nodes=target_nodes,
|
||||
network_middleware=network_middleware)
|
||||
|
||||
|
|
Loading…
Reference in New Issue