[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Drop redundant microdescriptor digest



commit d72573be3ea8a5acd42b6593fff67136333a612c
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Feb 8 14:41:33 2020 -0800

    Drop redundant microdescriptor digest
---
 stem/descriptor/router_status_entry.py      | 11 +----------
 test/unit/descriptor/router_status_entry.py |  3 +--
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/stem/descriptor/router_status_entry.py b/stem/descriptor/router_status_entry.py
index d248774a..f84997ac 100644
--- a/stem/descriptor/router_status_entry.py
+++ b/stem/descriptor/router_status_entry.py
@@ -346,10 +346,6 @@ def _parse_microdescriptor_m_line(descriptor, entries):
 
   descriptor.microdescriptor_digest = _value('m', entries)
 
-  # TODO: drop the following in stem 2.x
-
-  descriptor.digest = _base64_to_hex(_value('m', entries), check_if_fingerprint = False)
-
 
 def _base64_to_hex(identity, check_if_fingerprint = True):
   """
@@ -644,9 +640,6 @@ class RouterStatusEntryMicroV3(RouterStatusEntry):
   :var list unrecognized_bandwidth_entries: **\\*** bandwidth weighting
     information that isn't yet recognized
   :var dict protocols: mapping of protocols to their supported versions
-
-  :var str digest: **\\*** router's hex encoded digest of our corresponding
-    microdescriptor (**deprecated**, use microdescriptor_digest instead)
   :var str microdescriptor_digest: **\\*** router's base64 encoded digest of our corresponding microdescriptor
 
   .. versionchanged:: 1.6.0
@@ -656,7 +649,7 @@ class RouterStatusEntryMicroV3(RouterStatusEntry):
      Added the or_addresses attribute.
 
   .. versionchanged:: 1.7.0
-     Added the microdescriptor_digest attribute to replace our now deprecated digest attribute.
+     Added the microdescriptor_digest attribute.
 
   **\\*** attribute is either required when we're parsed with validation or has
   a default value, others are left as **None** if undefined
@@ -671,9 +664,7 @@ class RouterStatusEntryMicroV3(RouterStatusEntry):
     'is_unmeasured': (False, _parse_w_line),
     'unrecognized_bandwidth_entries': ([], _parse_w_line),
     'protocols': ({}, _parse_pr_line),
-
     'microdescriptor_digest': (None, _parse_microdescriptor_m_line),
-    'digest': (None, _parse_microdescriptor_m_line),
   })
 
   PARSER_FOR_LINE = dict(RouterStatusEntry.PARSER_FOR_LINE, **{
diff --git a/test/unit/descriptor/router_status_entry.py b/test/unit/descriptor/router_status_entry.py
index 7ee942e0..3aa02ecc 100644
--- a/test/unit/descriptor/router_status_entry.py
+++ b/test/unit/descriptor/router_status_entry.py
@@ -173,7 +173,6 @@ class TestRouterStatusEntry(unittest.TestCase):
     self.assertEqual(None, entry.version_line)
     self.assertEqual(None, entry.version)
     self.assertEqual('aiUklwBrua82obG5AsTX+iEpkjQA2+AQHxZ7GwMfY70', entry.microdescriptor_digest)
-    self.assertEqual('6A252497006BB9AF36A1B1B902C4D7FA2129923400DBE0101F167B1B031F63BD', entry.digest)
     self.assertEqual([], entry.get_unrecognized_lines())
 
   @test.require.cryptography
@@ -282,7 +281,7 @@ class TestRouterStatusEntry(unittest.TestCase):
     self.assertEqual(False, entry.is_unmeasured)
     self.assertEqual([], entry.unrecognized_bandwidth_entries)
     self.assertEqual(expected_protocols, entry.protocols)
-    self.assertEqual('1966FEC636AFD1FB2EC0FC0F36752F5BD43522F9399F3F26D4C70408CE0A63C0', entry.digest)
+    self.assertEqual('GWb+xjav0fsuwPwPNnUvW9Q1Ivk5nz8m1McECM4KY8A', entry.microdescriptor_digest)
     self.assertEqual([], entry.get_unrecognized_lines())
 
   def test_missing_fields(self):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits