mirror of https://github.com/nucypher/nucypher.git
Merge pull request #223 from jMyles/bytesplitting
No more as_b64 for UmbralPublicKeys.pull/224/merge
commit
3eab8cb083
|
@ -546,7 +546,7 @@ class Ursula(Character, ProxyRESTServer):
|
|||
raise RuntimeError("Got a bad response: {}".format(response))
|
||||
|
||||
key_splitter = RepeatingBytestringSplitter(
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH, {"as_b64": False}))
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH))
|
||||
signing_key, encrypting_key = key_splitter(response.content)
|
||||
|
||||
stranger_ursula_from_public_keys = cls.from_public_keys(
|
||||
|
|
|
@ -5,6 +5,6 @@ from umbral.pre import Capsule
|
|||
from nkms.crypto.signature import Signature
|
||||
|
||||
|
||||
key_splitter = BytestringSplitter((UmbralPublicKey, PUBLIC_KEY_LENGTH, {"as_b64": False}))
|
||||
key_splitter = BytestringSplitter((UmbralPublicKey, PUBLIC_KEY_LENGTH))
|
||||
capsule_splitter = BytestringSplitter((Capsule, CAPSULE_LENGTH))
|
||||
signature_splitter = BytestringSplitter(Signature)
|
||||
|
|
|
@ -70,7 +70,7 @@ class KeyStore(object):
|
|||
raise NotFound(
|
||||
"No key with fingerprint {} found.".format(fingerprint))
|
||||
|
||||
pubkey = UmbralPublicKey.from_bytes(key.key_data, as_b64=False)
|
||||
pubkey = UmbralPublicKey.from_bytes(key.key_data)
|
||||
return pubkey
|
||||
|
||||
def del_key(self, fingerprint: bytes, session=None):
|
||||
|
|
|
@ -12,7 +12,7 @@ from nkms.network.routing import NuCypherRoutingTable
|
|||
from umbral.keys import UmbralPublicKey
|
||||
|
||||
dht_value_splitter = default_constant_splitter + BytestringSplitter(Signature,
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH, {"as_b64": False}),
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH),
|
||||
(bytes, KECCAK_DIGEST_LENGTH))
|
||||
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ def test_alice_can_get_ursulas_keys_via_rest(alice, ursulas):
|
|||
mock_client = TestClient(ursulas[0].rest_app)
|
||||
response = mock_client.get('http://localhost/public_keys')
|
||||
splitter = BytestringSplitter(
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH, {"as_b64": False}),
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH, {"as_b64": False})
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH),
|
||||
(UmbralPublicKey, PUBLIC_KEY_LENGTH)
|
||||
)
|
||||
signing_key, encrypting_key = splitter(response.content)
|
||||
stranger_ursula_from_public_keys = Ursula.from_public_keys({SigningPower: signing_key,
|
||||
|
|
|
@ -58,7 +58,7 @@ def alice(ursulas):
|
|||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def bob(alice, ursulas):
|
||||
def bob():
|
||||
BOB = Bob()
|
||||
BOB.server.listen(8475)
|
||||
EVENT_LOOP.run_until_complete(BOB.server.bootstrap([("127.0.0.1", URSULA_PORT)]))
|
||||
|
@ -77,7 +77,7 @@ def ursulas():
|
|||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def treasure_map_is_set_on_dht(alice, enacted_policy):
|
||||
def treasure_map_is_set_on_dht(enacted_policy):
|
||||
enacted_policy.publish_treasure_map()
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import pytest
|
|||
from kademlia.utils import digest
|
||||
|
||||
from constant_sorrow import constants
|
||||
from nkms.blockchain.eth.utilities import spawn_miners
|
||||
from nkms.crypto.api import keccak_digest
|
||||
from nkms.crypto.kits import UmbralMessageKit
|
||||
from nkms.network import blockchain_client
|
||||
|
|
Loading…
Reference in New Issue