diff --git a/nucypher/blockchain/eth/actors.py b/nucypher/blockchain/eth/actors.py index bd65f1b71..13f3c1a7f 100644 --- a/nucypher/blockchain/eth/actors.py +++ b/nucypher/blockchain/eth/actors.py @@ -270,6 +270,7 @@ class PolicyAuthor(NucypherTokenActor): if policy_agent is None: # From defaults + self.token_agent = NucypherTokenAgent() self.miner_agent = MinerAgent(token_agent=self.token_agent) self.policy_agent = PolicyAgent(miner_agent=self.miner_agent) else: diff --git a/nucypher/characters/base.py b/nucypher/characters/base.py index 8315dc261..5de040d61 100644 --- a/nucypher/characters/base.py +++ b/nucypher/characters/base.py @@ -21,7 +21,6 @@ from typing import Union, List from umbral.keys import UmbralPublicKey from umbral.signing import Signature -from nucypher.blockchain.eth.agents import MinerAgent from nucypher.crypto.api import encrypt_and_sign from nucypher.crypto.kits import UmbralMessageKit from nucypher.crypto.powers import CryptoPower, SigningPower, EncryptingPower, NoSigningPower, CryptoPowerUp @@ -321,12 +320,6 @@ class Character(Learner): from nucypher.network.protocols import SuspiciousActivity # Ship this exception with every Character. - class NotEnoughUrsulas(MinerAgent.NotEnoughMiners): - """ - All Characters depend on knowing about enough Ursulas to perform their role. - This exception is raised when a piece of logic can't proceed without more Ursulas. - """ - class InvalidSignature(Exception): """ Raised when a signature doesn't pass validation/verification. diff --git a/nucypher/characters/lawful.py b/nucypher/characters/lawful.py index 548bc0810..30ac01b84 100644 --- a/nucypher/characters/lawful.py +++ b/nucypher/characters/lawful.py @@ -242,7 +242,7 @@ class Bob(Character): if not self.known_nodes and not self._learning_task.running: # Quick sanity check - if we don't know of *any* Ursulas, and we have no # plans to learn about any more, than this function will surely fail. - raise self.NotEnoughUrsulas + raise Ursula.NotEnoughUrsulas treasure_map = self.get_treasure_map_from_known_ursulas(self.network_middleware, map_id) @@ -387,6 +387,12 @@ class Ursula(Character, VerifiableNode, Miner): # TLSHostingPower still can enjoy default status, but on a different class _default_crypto_powerups = [SigningPower, EncryptingPower] + class NotEnoughUrsulas(Learner.NotEnoughTeachers, MinerAgent.NotEnoughMiners): + """ + All Characters depend on knowing about enough Ursulas to perform their role. + This exception is raised when a piece of logic can't proceed without more Ursulas. + """ + class NotFound(Exception): pass