mirror of https://github.com/nucypher/nucypher.git
For now, Ursula stores Contracts in a dict.
parent
0fd71bf07b
commit
0a9002893e
|
@ -360,6 +360,7 @@ class Ursula(Character):
|
|||
|
||||
self._rest_app = None
|
||||
self._work_orders = []
|
||||
self._contracts = {} # TODO: This needs to actually be a persistent data store. See #127.
|
||||
|
||||
@property
|
||||
def rest_app(self):
|
||||
|
@ -467,6 +468,14 @@ class Ursula(Character):
|
|||
work_orders_from_bob.append(work_order)
|
||||
return work_orders_from_bob
|
||||
|
||||
def consider_contract(self, contract):
|
||||
# TODO: This actually needs to be a REST endpoint, with the payload carrying the kfrag hash separately.
|
||||
self._contracts[self.hash(bytes(contract.kfrag))] = contract
|
||||
|
||||
# TODO: Make the rest of this logic actually work.
|
||||
from tests.utilities import MockPolicyOfferResponse
|
||||
return MockPolicyOfferResponse()
|
||||
|
||||
|
||||
class Seal(object):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue