mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-08 03:14:21 +00:00
mutable: cosmetic changes
This commit is contained in:
parent
d6cde55c63
commit
9e460cd22e
@ -514,10 +514,11 @@ class Retrieve:
|
||||
def _got_results_one_share(self, shnum, data, peerid):
|
||||
self.log("_got_results: got shnum #%d from peerid %s"
|
||||
% (shnum, idlib.shortnodeid_b2a(peerid)))
|
||||
|
||||
# this might raise NeedMoreDataError, in which case the rest of
|
||||
# the shares are probably short too. _query_failed() will take
|
||||
# responsiblity for re-issuing the queries with a new length.
|
||||
(seqnum, root_hash, IV, k, N, segsize, datalength,
|
||||
# this might raise NeedMoreDataError, in which case the rest of
|
||||
# the shares are probably short too. _query_failed() will take
|
||||
# responsiblity for re-issuing the queries with a new length.
|
||||
pubkey_s, signature, prefix) = unpack_prefix_and_signature(data)
|
||||
|
||||
if not self._pubkey:
|
||||
@ -1088,7 +1089,7 @@ class Publish:
|
||||
d.addCallback(self._got_all_query_results,
|
||||
total_shares, reachable_peers,
|
||||
current_share_peers)
|
||||
# TODO: add an errback to, probably to ignore that peer
|
||||
# TODO: add an errback too, probably to ignore that peer
|
||||
|
||||
# TODO: if we can't get a privkey from these servers, consider
|
||||
# looking farther afield. Be aware of the old 0.7.0 behavior that
|
||||
|
@ -141,6 +141,23 @@ class FakeClient:
|
||||
d.addCallback(_got_data)
|
||||
return d
|
||||
|
||||
class FakePubKey:
|
||||
def __init__(self, count):
|
||||
self.count = count
|
||||
def serialize(self):
|
||||
return "PUBKEY-%d" % self.count
|
||||
def verify(self, msg, signature):
|
||||
return True
|
||||
|
||||
class FakePrivKey:
|
||||
def __init__(self, count):
|
||||
self.count = count
|
||||
def serialize(self):
|
||||
return "PRIVKEY-%d" % self.count
|
||||
def sign(self, data):
|
||||
return "SIGN(%s)" % data
|
||||
|
||||
|
||||
class Filenode(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.client = FakeClient()
|
||||
@ -396,20 +413,3 @@ class Publish(unittest.TestCase):
|
||||
pass
|
||||
d.addCallback(_done)
|
||||
return d
|
||||
|
||||
|
||||
class FakePubKey:
|
||||
def __init__(self, count):
|
||||
self.count = count
|
||||
def serialize(self):
|
||||
return "PUBKEY-%d" % self.count
|
||||
def verify(self, msg, signature):
|
||||
return True
|
||||
|
||||
class FakePrivKey:
|
||||
def __init__(self, count):
|
||||
self.count = count
|
||||
def serialize(self):
|
||||
return "PRIVKEY-%d" % self.count
|
||||
def sign(self, data):
|
||||
return "SIGN(%s)" % data
|
||||
|
Loading…
x
Reference in New Issue
Block a user