commit ed0e8ac4d0dca0c58cc17e2314839351590038b8 Author: Damian Johnson atagar@torproject.org Date: Fri Apr 13 22:39:33 2012 -0700
Renaming calculate_digest() to just digest() --- stem/descriptor/server_descriptor.py | 5 +++-- test/integ/descriptor/server_descriptor.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/stem/descriptor/server_descriptor.py b/stem/descriptor/server_descriptor.py index 9abe06b..e91cab8 100644 --- a/stem/descriptor/server_descriptor.py +++ b/stem/descriptor/server_descriptor.py @@ -10,7 +10,8 @@ etc). This information is provided from a few sources... parse_file_v3 - Iterates over the server descriptors in a file. ServerDescriptorV3 - Tor server descriptor, version 3. | |- RelayDescriptorV3 - Server descriptor for a relay. - | | +- is_valid - checks the signature against the descriptor content + | | |- is_valid - checks the signature against the descriptor content + | | +- digest - calculates the digest value for our content | | | +- BridgeDescriptorV3 - Scrubbed server descriptor for a bridge. | @@ -558,7 +559,7 @@ class RelayDescriptorV3(ServerDescriptorV3):
raise NotImplementedError # TODO: implement
- def calculate_digest(self): + def digest(self): """ Provides the base64 encoded sha1 of our content. This value is part of the server descriptor entry for this relay. diff --git a/test/integ/descriptor/server_descriptor.py b/test/integ/descriptor/server_descriptor.py index c4265d7..b7577da 100644 --- a/test/integ/descriptor/server_descriptor.py +++ b/test/integ/descriptor/server_descriptor.py @@ -229,7 +229,7 @@ Qlx9HNCqCY877ztFRC624ja2ql6A2hBcuoYMbkHjcQ4= self.assertEquals(["reject *:*"], desc.exit_policy) self.assertEquals([], desc.get_unrecognized_lines())
- def test_calculate_digest(self): + def test_digest(self): """ Checks that the digest for a descriptor matches its consensus digest value. """ @@ -267,5 +267,5 @@ Qlx9HNCqCY877ztFRC624ja2ql6A2hBcuoYMbkHjcQ4= desc_content = desc_content[desc_content.find("=\n") + 2:]
desc = stem.descriptor.server_descriptor.RelayDescriptorV3(desc_content) - self.assertEquals(consensus_digest, desc.calculate_digest()) + self.assertEquals(consensus_digest, desc.digest())