Merge pull request #284 from jMyles/master

Small update for new pyUmbral compatibility
pull/287/merge
Justin Holmes 2018-06-04 00:44:41 -04:00 committed by GitHub
commit c8505e8cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 6 deletions

View File

@ -31,6 +31,7 @@ class TestMiner:
chain.time_travel(periods=1) chain.time_travel(periods=1)
assert mock_miner_agent.contract.functions.getLockedTokens(miner.address).call() == mock_miner_agent.min_allowed_locked assert mock_miner_agent.contract.functions.getLockedTokens(miner.address).call() == mock_miner_agent.min_allowed_locked
@pytest.mark.slow() @pytest.mark.slow()
@pytest.mark.usefixtures("mock_policy_agent") @pytest.mark.usefixtures("mock_policy_agent")
def test_miner_collects_staking_reward_tokens(self, chain, miner, mock_token_agent, mock_miner_agent): def test_miner_collects_staking_reward_tokens(self, chain, miner, mock_token_agent, mock_miner_agent):

View File

@ -4,6 +4,7 @@ from nucypher.blockchain.eth.agents import MinerAgent
M = 10 ** 6 M = 10 ** 6
@pytest.mark.slow() @pytest.mark.slow()
def test_get_swarm(chain, mock_token_agent, mock_miner_agent): def test_get_swarm(chain, mock_token_agent, mock_miner_agent):

View File

@ -44,6 +44,7 @@ def test_token_deployer_and_agent(chain):
assert token_agent == same_token_agent # __eq__ assert token_agent == same_token_agent # __eq__
@pytest.mark.slow()
def test_deploy_ethereum_contracts(chain): def test_deploy_ethereum_contracts(chain):
""" """
Launch all ethereum contracts: Launch all ethereum contracts:

View File

@ -113,6 +113,9 @@ def test_bob_can_issue_a_work_order_to_a_specific_ursula(enacted_policy, bob,
# Attach the CFrag to the Capsule. # Attach the CFrag to the Capsule.
capsule = capsule_side_channel[0].capsule capsule = capsule_side_channel[0].capsule
capsule.set_correctness_keys(delegating=enacted_policy.public_key,
receiving=bob.public_key(EncryptingPower),
verifying=alice.stamp.as_umbral_pubkey())
capsule.attach_cfrag(the_cfrag) capsule.attach_cfrag(the_cfrag)
# Having received the cFrag, Bob also saved the WorkOrder as complete. # Having received the cFrag, Bob also saved the WorkOrder as complete.
@ -139,7 +142,7 @@ def test_bob_can_issue_a_work_order_to_a_specific_ursula(enacted_policy, bob,
assert the_correct_cfrag.verify_correctness(capsule, assert the_correct_cfrag.verify_correctness(capsule,
delegating_pubkey=enacted_policy.public_key, delegating_pubkey=enacted_policy.public_key,
signing_pubkey=alice.stamp.as_umbral_pubkey(), signing_pubkey=alice.stamp.as_umbral_pubkey(),
encrypting_pubkey=bob.public_key(EncryptingPower)) receiving_pubkey=bob.public_key(EncryptingPower))
# Now we'll show that Ursula saved the correct WorkOrder. # Now we'll show that Ursula saved the correct WorkOrder.
work_orders_from_bob = ursula.work_orders(bob=bob) work_orders_from_bob = ursula.work_orders(bob=bob)

View File

@ -11,10 +11,6 @@ from nucypher.blockchain.eth.chains import Blockchain
from nucypher.characters import Alice, Bob from nucypher.characters import Alice, Bob
from nucypher.config.configs import NucypherConfig from nucypher.config.configs import NucypherConfig
from nucypher.crypto.signature import SignatureStamp
from nucypher.keystore import keystore
from nucypher.keystore.db import Base
from nucypher.data_sources import DataSource from nucypher.data_sources import DataSource
from nucypher.keystore import keystore from nucypher.keystore import keystore
@ -56,7 +52,7 @@ def idle_policy(alice, bob):
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def enacted_policy(idle_policy, ursulas): def enacted_policy(idle_policy, ursulas):
# Alice has a policy in mind and knows of enough qualifies Ursulas; she crafts an offer for them. # Alice has a policy in mind and knows of enough qualifies Ursulas; she crafts an offer for them.
deposit = constants.NON_PAYMENT deposit = constants.NON_PAYMENT(b"0000000")
contract_end_datetime = maya.now() + datetime.timedelta(days=5) contract_end_datetime = maya.now() + datetime.timedelta(days=5)
networky_stuff = MockNetworkyStuff(ursulas) networky_stuff = MockNetworkyStuff(ursulas)