mirror of https://github.com/nucypher/nucypher.git
Shame on you, Ursula.
parent
fc6f7e5c59
commit
450c1c64bc
|
@ -66,8 +66,6 @@ from nucypher.network.nodes import Teacher
|
|||
from nucypher.network.protocols import InterfaceInfo, parse_node_uri
|
||||
from nucypher.network.server import ProxyRESTServer, TLSHostingPower, make_rest_app
|
||||
from nucypher.utilities.decorators import validate_checksum_address
|
||||
# TODO: Fix circular import issue
|
||||
#from nucypher.policy.models import UnquestionableEvidence
|
||||
|
||||
|
||||
class Alice(Character, PolicyAuthor):
|
||||
|
@ -552,10 +550,9 @@ class Bob(Character):
|
|||
except UmbralCorrectnessError:
|
||||
evidence = self.collect_evidence(capsule=capsule,
|
||||
cfrag=cfrag,
|
||||
)
|
||||
ursula=work_order.ursula)
|
||||
# TODO: Here's the evidence of Ursula misbehavior. Now what? #500
|
||||
raise self.IncorrectCFragReceived(evidence)
|
||||
|
||||
else:
|
||||
raise Ursula.NotEnoughUrsulas("Unable to snag m cfrags.")
|
||||
|
||||
|
@ -567,10 +564,9 @@ class Bob(Character):
|
|||
cleartexts.append(delivered_cleartext)
|
||||
return cleartexts
|
||||
|
||||
def collect_evidence(self, capsule, cfrag):
|
||||
pass
|
||||
# TODO: Fix circular import problem
|
||||
# return UnquestionableEvidence(capsule, cfrag)
|
||||
def collect_evidence(self, capsule, cfrag, ursula):
|
||||
from nucypher.policy.models import UnquestionableEvidence
|
||||
return UnquestionableEvidence(capsule, cfrag, ursula)
|
||||
|
||||
def make_wsgi_app(drone_bob, start_learning=True):
|
||||
bob_control = Flask('bob-control')
|
||||
|
|
|
@ -681,9 +681,10 @@ class Revocation:
|
|||
|
||||
class UnquestionableEvidence:
|
||||
|
||||
def __init__(self, capsule: Capsule, cfrag: CapsuleFrag) -> None:
|
||||
def __init__(self, capsule: Capsule, cfrag: CapsuleFrag, ursula) -> None:
|
||||
self.capsule = capsule
|
||||
self.cfrag = cfrag
|
||||
self.ursula = ursula
|
||||
|
||||
def get_proof_challenge_scalar(self) -> CurveBN:
|
||||
umbral_params = default_params()
|
||||
|
|
|
@ -125,7 +125,7 @@ def test_evaluate_cfrag(testerchain, escrow, adjudicator_contract):
|
|||
cfrag_bytes = cfrag.to_bytes()
|
||||
|
||||
# Bob prepares supporting Evidence
|
||||
evidence = UnquestionableEvidence(capsule, cfrag)
|
||||
evidence = UnquestionableEvidence(capsule, cfrag, ursula=None)
|
||||
|
||||
some_data = evidence.precompute_values()
|
||||
assert len(some_data) == 20 * 32
|
||||
|
|
Loading…
Reference in New Issue