summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2023-04-13 14:35:03 +0000
committerGitHub <noreply@github.com>2023-04-13 15:35:03 +0100
commitedae20f926d9d1225111f1d40a1073ce3f1d3fb7 (patch)
tree900cb6fdfa14849a766f009655911ab0e52e9249 /tests/unittest.py
parentAdd comma missing from #15382. (#15429) (diff)
downloadsynapse-edae20f926d9d1225111f1d40a1073ce3f1d3fb7.tar.xz
Improve robustness when handling a perspective key response by deduplicating received server keys. (#15423)
* Change `store_server_verify_keys` to take a `Mapping[(str, str), FKR]`

This is because we already can't handle duplicate keys — leads to cardinality violation

* Newsfile

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>

---------

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index 8a16fd3665..93fee1c0e6 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -793,16 +793,12 @@ class FederatingHomeserverTestCase(HomeserverTestCase):
             hs.get_datastores().main.store_server_verify_keys(
                 from_server=self.OTHER_SERVER_NAME,
                 ts_added_ms=clock.time_msec(),
-                verify_keys=[
-                    (
-                        self.OTHER_SERVER_NAME,
-                        verify_key_id,
-                        FetchKeyResult(
-                            verify_key=verify_key,
-                            valid_until_ts=clock.time_msec() + 10000,
-                        ),
-                    )
-                ],
+                verify_keys={
+                    (self.OTHER_SERVER_NAME, verify_key_id): FetchKeyResult(
+                        verify_key=verify_key,
+                        valid_until_ts=clock.time_msec() + 10000,
+                    ),
+                },
             )
         )