mirror of https://github.com/nucypher/nucypher.git
Janitorial stuff
parent
3a6bfa23a2
commit
9e0552d7ec
|
@ -154,6 +154,9 @@ class BlockchainPolicy(Policy):
|
|||
value=rate*duration, # TODO Check the math/types here
|
||||
lock_periods=duration,
|
||||
expiration=end_block)
|
||||
# TODO: #1173 - This method is unused and seems broken.
|
||||
# I think that something here will fail as the arrangement ID is not
|
||||
# passed above to the constructor, so a new random ID will be created.
|
||||
|
||||
arrangement.is_published = True
|
||||
return arrangement
|
||||
|
|
|
@ -368,7 +368,7 @@ def make_rest_app(
|
|||
do_store = treasure_map.public_id() == treasure_map_id
|
||||
|
||||
if do_store:
|
||||
log.info("{} storing TreasureMap {}".format(this_node.stamp, treasure_map_id))
|
||||
log.info("{} storing TreasureMap {}".format(this_node, treasure_map_id))
|
||||
|
||||
# TODO 341 - what if we already have this TreasureMap?
|
||||
treasure_map_index = bytes.fromhex(treasure_map_id)
|
||||
|
|
|
@ -20,7 +20,6 @@ from collections import OrderedDict
|
|||
|
||||
import maya
|
||||
import msgpack
|
||||
import uuid
|
||||
from bytestring_splitter import BytestringSplitter, VariableLengthBytestring
|
||||
from constant_sorrow.constants import UNKNOWN_KFRAG, NO_DECRYPTION_PERFORMED, NOT_SIGNED
|
||||
from cryptography.hazmat.backends.openssl import backend
|
||||
|
@ -76,10 +75,14 @@ class Arrangement:
|
|||
|
||||
Other params are hopefully self-evident.
|
||||
"""
|
||||
self.id = arrangement_id or secure_random(self.ID_LENGTH)
|
||||
if arrangement_id:
|
||||
if len(arrangement_id) != self.ID_LENGTH:
|
||||
raise ValueError(f"Arrangement ID must be of length {self.ID_LENGTH}.")
|
||||
self.id = arrangement_id
|
||||
else:
|
||||
self.id = secure_random(self.ID_LENGTH)
|
||||
self.expiration = expiration
|
||||
self.alice = alice
|
||||
self.uuid = uuid.uuid4()
|
||||
self.value = value
|
||||
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue