For now, Ursula stores Contracts in a dict.

pull/145/head
jMyles 2017-12-14 16:52:36 -08:00
parent 0fd71bf07b
commit 0a9002893e
1 changed files with 9 additions and 0 deletions

View File

@ -360,6 +360,7 @@ class Ursula(Character):
self._rest_app = None self._rest_app = None
self._work_orders = [] self._work_orders = []
self._contracts = {} # TODO: This needs to actually be a persistent data store. See #127.
@property @property
def rest_app(self): def rest_app(self):
@ -467,6 +468,14 @@ class Ursula(Character):
work_orders_from_bob.append(work_order) work_orders_from_bob.append(work_order)
return work_orders_from_bob 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): class Seal(object):
""" """