mirror of https://github.com/nucypher/nucypher.git
Namespace and modularize nucypher sandbox utilities
parent
fa71f0c8c5
commit
f3c614db17
|
@ -3,7 +3,6 @@ import os
|
||||||
from apistar import TestClient
|
from apistar import TestClient
|
||||||
|
|
||||||
from nucypher.characters.lawful import Ursula
|
from nucypher.characters.lawful import Ursula
|
||||||
from nucypher.crypto.api import load_tls_certificate
|
|
||||||
from nucypher.network.middleware import RestMiddleware
|
from nucypher.network.middleware import RestMiddleware
|
||||||
from nucypher.utilities.sandbox.constants import TEST_KNOWN_URSULAS_CACHE
|
from nucypher.utilities.sandbox.constants import TEST_KNOWN_URSULAS_CACHE
|
||||||
|
|
||||||
|
@ -50,7 +49,6 @@ class MockRestMiddleware(RestMiddleware):
|
||||||
id_as_hex = work_order.arrangement_id.hex()
|
id_as_hex = work_order.arrangement_id.hex()
|
||||||
|
|
||||||
assert os.path.exists(work_order.ursula.certificate_filepath), 'TLS Certificate does not exist on the filesystem'
|
assert os.path.exists(work_order.ursula.certificate_filepath), 'TLS Certificate does not exist on the filesystem'
|
||||||
|
|
||||||
return mock_client.post('http://localhost/kFrag/{}/reencrypt'.format(id_as_hex), payload)
|
return mock_client.post('http://localhost/kFrag/{}/reencrypt'.format(id_as_hex), payload)
|
||||||
|
|
||||||
def get_treasure_map_from_node(self, node, map_id):
|
def get_treasure_map_from_node(self, node, map_id):
|
||||||
|
|
|
@ -32,6 +32,7 @@ def make_federated_ursulas(ursula_config,
|
||||||
federated_ursulas.add(ursula)
|
federated_ursulas.add(ursula)
|
||||||
|
|
||||||
# Store this Ursula in our global testing cache.
|
# Store this Ursula in our global testing cache.
|
||||||
|
|
||||||
port = ursula.rest_information()[0].port
|
port = ursula.rest_information()[0].port
|
||||||
TEST_KNOWN_URSULAS_CACHE[port] = ursula
|
TEST_KNOWN_URSULAS_CACHE[port] = ursula
|
||||||
|
|
||||||
|
@ -67,6 +68,7 @@ def make_decentralized_ursulas(ursula_config,
|
||||||
rest_port=port + 100,
|
rest_port=port + 100,
|
||||||
**ursula_overrides)
|
**ursula_overrides)
|
||||||
|
|
||||||
|
|
||||||
if stake is True:
|
if stake is True:
|
||||||
|
|
||||||
min_stake, balance = int(constants.MIN_ALLOWED_LOCKED), ursula.token_balance
|
min_stake, balance = int(constants.MIN_ALLOWED_LOCKED), ursula.token_balance
|
||||||
|
|
Loading…
Reference in New Issue