mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 01:34:47 -04:00
Pass room_id to get_auth_chain_difference (#8879)
This is so that we can choose which algorithm to use based on the room ID.
This commit is contained in:
parent
b774c555d8
commit
df4b1e9c74
6 changed files with 33 additions and 17 deletions
|
@ -623,7 +623,9 @@ class AuthChainDifferenceTestCase(unittest.TestCase):
|
|||
|
||||
store = TestStateResolutionStore(persisted_events)
|
||||
|
||||
diff_d = _get_auth_chain_difference(state_sets, unpersited_events, store)
|
||||
diff_d = _get_auth_chain_difference(
|
||||
ROOM_ID, state_sets, unpersited_events, store
|
||||
)
|
||||
difference = self.successResultOf(defer.ensureDeferred(diff_d))
|
||||
|
||||
self.assertEqual(difference, {c.event_id})
|
||||
|
@ -662,7 +664,9 @@ class AuthChainDifferenceTestCase(unittest.TestCase):
|
|||
|
||||
store = TestStateResolutionStore(persisted_events)
|
||||
|
||||
diff_d = _get_auth_chain_difference(state_sets, unpersited_events, store)
|
||||
diff_d = _get_auth_chain_difference(
|
||||
ROOM_ID, state_sets, unpersited_events, store
|
||||
)
|
||||
difference = self.successResultOf(defer.ensureDeferred(diff_d))
|
||||
|
||||
self.assertEqual(difference, {d.event_id, c.event_id})
|
||||
|
@ -707,7 +711,9 @@ class AuthChainDifferenceTestCase(unittest.TestCase):
|
|||
|
||||
store = TestStateResolutionStore(persisted_events)
|
||||
|
||||
diff_d = _get_auth_chain_difference(state_sets, unpersited_events, store)
|
||||
diff_d = _get_auth_chain_difference(
|
||||
ROOM_ID, state_sets, unpersited_events, store
|
||||
)
|
||||
difference = self.successResultOf(defer.ensureDeferred(diff_d))
|
||||
|
||||
self.assertEqual(difference, {d.event_id, e.event_id})
|
||||
|
@ -773,7 +779,7 @@ class TestStateResolutionStore:
|
|||
|
||||
return list(result)
|
||||
|
||||
def get_auth_chain_difference(self, auth_sets):
|
||||
def get_auth_chain_difference(self, room_id, auth_sets):
|
||||
chains = [frozenset(self._get_auth_chain(a)) for a in auth_sets]
|
||||
|
||||
common = set(chains[0]).intersection(*chains[1:])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue