mirror of https://github.com/nucypher/nucypher.git
New names for things!
parent
100e7478b6
commit
9cf06c58e5
|
@ -13,10 +13,10 @@ def test_grant(alice, bob, ursulas):
|
|||
expiration=policy_end_datetime)
|
||||
|
||||
# The number of policies is equal to the number of Ursulas we're using (n)
|
||||
assert len(policy._active_contracts) == n
|
||||
assert len(policy._accepted_contracts) == n
|
||||
|
||||
# Let's look at the first Ursula.
|
||||
ursula = list(policy._active_contracts.values())[0].ursula
|
||||
ursula = list(policy._accepted_contracts.values())[0].ursula
|
||||
|
||||
# Get the kfrag, based in the hrac.
|
||||
proper_hrac = keccak_digest(bytes(alice.seal) + bytes(bob.seal) + uri)
|
||||
|
|
|
@ -9,7 +9,7 @@ def test_bob_can_follow_treasure_map(enacted_policy, ursulas, alice, bob):
|
|||
|
||||
# Simulate Bob finding a TreasureMap on the DHT.
|
||||
# A test to show that Bob can do this can be found in test_network_actors.
|
||||
hrac, treasure_map = enacted_policy_group.hrac(), enacted_policy_group.treasure_map
|
||||
hrac, treasure_map = enacted_policy.hrac(), enacted_policy.treasure_map
|
||||
bob.treasure_maps[hrac] = treasure_map
|
||||
|
||||
# Bob knows of no Ursulas.
|
||||
|
@ -32,10 +32,13 @@ def test_bob_can_issue_a_work_order_to_a_specific_ursula(enacted_policy, alice,
|
|||
"""
|
||||
|
||||
# We pick up our story with Bob already having followed the treasure map above, ie:
|
||||
hrac, treasure_map = enacted_policy.hrac(), enacted_policy.treasure_map
|
||||
bob.treasure_maps[hrac] = treasure_map
|
||||
bob.follow_treasure_map(hrac)
|
||||
assert len(bob._ursulas) == len(ursulas)
|
||||
|
||||
the_pfrag = enacted_policy_group.pfrag
|
||||
the_hrac = enacted_policy_group.hrac()
|
||||
the_pfrag = enacted_policy.pfrag
|
||||
the_hrac = enacted_policy.hrac()
|
||||
|
||||
# Bob has no saved work orders yet, ever.
|
||||
assert len(bob._saved_work_orders) == 0
|
||||
|
@ -87,7 +90,7 @@ def test_bob_remember_that_he_has_cfrags_for_a_particular_pfrag(enacted_policy,
|
|||
|
||||
# The rest of this test will show that if Bob generates another WorkOrder, it's for a *different* Ursula.
|
||||
|
||||
generated_work_order_map = bob.generate_work_orders(enacted_policy_group.hrac(), enacted_policy_group.pfrag, num_ursulas=1)
|
||||
generated_work_order_map = bob.generate_work_orders(enacted_policy.hrac(), enacted_policy.pfrag, num_ursulas=1)
|
||||
id_of_this_new_ursula, new_work_order = list(generated_work_order_map.items())[0]
|
||||
|
||||
# This new Ursula isn't the same one to whom we've already issued a WorkOrder.
|
||||
|
|
Loading…
Reference in New Issue