mirror of https://github.com/nucypher/nucypher.git
commit
c979506436
|
@ -25,8 +25,8 @@ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(messag
|
|||
ch.setFormatter(formatter)
|
||||
root.addHandler(ch)
|
||||
|
||||
teacher_dht_port = 3552
|
||||
teacher_rest_port = 3652
|
||||
teacher_dht_port = sys.argv[2]
|
||||
teacher_rest_port = int(teacher_dht_port) + 100
|
||||
with open("examples-runtime-cruft/node-metadata-{}".format(teacher_rest_port), "r") as f:
|
||||
f.seek(0)
|
||||
teacher_bytes = binascii.unhexlify(f.read())
|
||||
|
|
|
@ -14,8 +14,6 @@ from nucypher.characters import Ursula
|
|||
|
||||
|
||||
DB_NAME = "examples-runtime-cruft/db"
|
||||
STARTING_PORT = 3501
|
||||
|
||||
|
||||
import logging, binascii
|
||||
import sys
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import asyncio
|
||||
import random
|
||||
import time
|
||||
from collections import OrderedDict
|
||||
from collections import deque
|
||||
from contextlib import suppress
|
||||
|
@ -10,15 +11,16 @@ from typing import Union, List
|
|||
|
||||
import kademlia
|
||||
import maya
|
||||
import time
|
||||
from bytestring_splitter import BytestringSplitter, VariableLengthBytestring
|
||||
from constant_sorrow import constants, default_constant_splitter
|
||||
from eth_keys import KeyAPI as EthKeyAPI
|
||||
from eth_utils import to_checksum_address, to_canonical_address
|
||||
from kademlia.network import Server
|
||||
from kademlia.utils import digest
|
||||
from twisted.internet import task, threads
|
||||
from umbral.keys import UmbralPublicKey
|
||||
from umbral.signing import Signature
|
||||
|
||||
from bytestring_splitter import BytestringSplitter, VariableLengthBytestring
|
||||
from constant_sorrow import constants, default_constant_splitter
|
||||
from eth_utils import to_checksum_address, to_canonical_address
|
||||
from nucypher.blockchain.eth.actors import PolicyAuthor, Miner
|
||||
from nucypher.blockchain.eth.agents import MinerAgent
|
||||
from nucypher.config.configs import CharacterConfiguration
|
||||
|
@ -32,8 +34,6 @@ from nucypher.network.middleware import RestMiddleware
|
|||
from nucypher.network.nodes import VerifiableNode
|
||||
from nucypher.network.protocols import InterfaceInfo
|
||||
from nucypher.network.server import NucypherDHTServer, NucypherSeedOnlyDHTServer, ProxyRESTServer
|
||||
from umbral.keys import UmbralPublicKey
|
||||
from umbral.signing import Signature
|
||||
|
||||
|
||||
class Character:
|
||||
|
@ -977,16 +977,12 @@ class Bob(Character):
|
|||
cfrags = self.get_reencrypted_cfrags(work_order)
|
||||
message_kit.capsule.attach_cfrag(cfrags[0])
|
||||
|
||||
verified, delivered_cleartext = self.verify_from(data_source,
|
||||
message_kit,
|
||||
decrypt=True,
|
||||
delegator_signing_key=alice_verifying_key)
|
||||
delivered_cleartext = self.verify_from(data_source,
|
||||
message_kit,
|
||||
decrypt=True,
|
||||
delegator_signing_key=alice_verifying_key)
|
||||
|
||||
if verified:
|
||||
cleartexts.append(delivered_cleartext)
|
||||
else:
|
||||
raise RuntimeError(
|
||||
"Not verified - replace this with real message.") # TODO: Actually raise an error in verify_from instead of here 358
|
||||
cleartexts.append(delivered_cleartext)
|
||||
return cleartexts
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,6 @@ class DataSource:
|
|||
def from_public_keys(cls, policy_public_key, datasource_public_key, label):
|
||||
umbral_public_key = UmbralPublicKey.from_bytes(datasource_public_key)
|
||||
return cls(policy_public_key,
|
||||
signing_keypair=SigningKeypair(umbral_public_key),
|
||||
signing_keypair=SigningKeypair(public_key=umbral_public_key),
|
||||
label=label,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue