Pushing logic to match KFrags with Contracts down into Policy.

pull/145/head
jMyles 2017-12-14 21:18:25 -08:00
parent 7dec865094
commit 87d25e4ce3
1 changed files with 1 additions and 8 deletions

View File

@ -240,14 +240,7 @@ class Alice(Character):
# deposits and expirations on a limited number of Ursulas.
# Users may decide to inject some market strategies here.
found_ursulas = policy.find_ursulas(networky_stuff, deposit, expiration, num_ursulas=n)
for ursula, contract, result in found_ursulas:
if result.was_accepted: # TODO: Here, we need to assess the result and see if we're actually good to go.
kfrag = policy.assign_kfrag_to_contract(contract)
contract.activate(kfrag, ursula, result)
# TODO: What if there weren't enough Contracts approved to distribute n kfrags? We need to raise NotEnoughQualifiedUrsulas.
policy.match_kfrags_to_found_ursulas(found_ursulas)
policy.enact(networky_stuff) # REST call happens here, as does population of TreasureMap.
return policy