From 0a9002893e6b3e4653d694055af5ccd381831654 Mon Sep 17 00:00:00 2001 From: jMyles Date: Thu, 14 Dec 2017 16:52:36 -0800 Subject: [PATCH] For now, Ursula stores Contracts in a dict. --- nkms/characters.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nkms/characters.py b/nkms/characters.py index e00d0e7ff..117676c4f 100644 --- a/nkms/characters.py +++ b/nkms/characters.py @@ -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): """