mirror of https://github.com/nucypher/nucypher.git
Test fixes: another manual tpower activation and attempt to fix tmap reference.
parent
73d1022c94
commit
e594ff5e8c
|
@ -1033,7 +1033,7 @@ class Ursula(Teacher, Character, Worker):
|
|||
|
||||
if is_me:
|
||||
# In-Memory TreasureMap tracking
|
||||
self._stored_treasure_maps = dict()
|
||||
self._stored_treasure_maps = dict() # TODO: Something more persistent (See PR #2132)
|
||||
|
||||
# Learner
|
||||
self._start_learning_now = start_learning_now
|
||||
|
|
|
@ -23,6 +23,7 @@ import pytest
|
|||
from eth_utils import to_wei
|
||||
from web3 import Web3
|
||||
|
||||
from nucypher.crypto.powers import TransactingPower
|
||||
from nucypher.blockchain.eth.actors import Bidder, Staker
|
||||
from nucypher.blockchain.eth.agents import (
|
||||
ContractAgency,
|
||||
|
@ -238,6 +239,10 @@ def test_refund(click_runner, testerchain, agency_local_registry, token_economic
|
|||
remaining_work = worklock_agent.get_remaining_work(checksum_address=bidder)
|
||||
assert remaining_work > 0
|
||||
|
||||
# Unlock
|
||||
transacting_power = worker._crypto_power.power_ups(TransactingPower)
|
||||
transacting_power.activate(password=INSECURE_DEVELOPMENT_PASSWORD)
|
||||
|
||||
# Do some work
|
||||
for i in range(3):
|
||||
receipt = worker.commit_to_next_period()
|
||||
|
|
|
@ -178,7 +178,7 @@ def test_treasure_map_cannot_be_duplicated(blockchain_ursulas, blockchain_alice,
|
|||
expiration=policy_end_datetime)
|
||||
|
||||
u = blockchain_bob.matching_nodes_among(blockchain_alice.known_nodes)[0]
|
||||
saved_map = u.treasure_maps[bytes.fromhex(policy.treasure_map.public_id())]
|
||||
saved_map = u._stored_treasure_maps[bytes.fromhex(policy.treasure_map.public_id())]
|
||||
assert saved_map == policy.treasure_map
|
||||
# This Ursula was actually a Vladimir.
|
||||
# Thus, he has access to the (encrypted) TreasureMap and can use its details to
|
||||
|
|
|
@ -47,7 +47,9 @@ def test_alice_sets_treasure_map(enacted_federated_policy, federated_ursulas):
|
|||
assert found
|
||||
|
||||
|
||||
def test_treasure_map_stored_by_ursula_is_the_correct_one_for_bob(federated_alice, federated_bob, federated_ursulas,
|
||||
def test_treasure_map_stored_by_ursula_is_the_correct_one_for_bob(federated_alice,
|
||||
federated_bob,
|
||||
federated_ursulas,
|
||||
enacted_federated_policy):
|
||||
"""
|
||||
The TreasureMap given by Alice to Ursula is the correct one for Bob; he can decrypt and read it.
|
||||
|
|
Loading…
Reference in New Issue