mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 08:32:11 -04:00
Refactor _resolve_state_at_missing_prevs
to return an EventContext
(#13404)
Previously, `_resolve_state_at_missing_prevs` returned the resolved state before an event and a partial state flag. These were unwieldy to carry around would only ever be used to build an event context. Build the event context directly instead. Signed-off-by: Sean Quah <seanq@matrix.org>
This commit is contained in:
parent
05aeeb3a80
commit
224d792dd7
5 changed files with 68 additions and 86 deletions
|
@ -280,14 +280,21 @@ class FederationTestCase(unittest.FederatingHomeserverTestCase):
|
|||
|
||||
# we poke this directly into _process_received_pdu, to avoid the
|
||||
# federation handler wanting to backfill the fake event.
|
||||
state_handler = self.hs.get_state_handler()
|
||||
context = self.get_success(
|
||||
state_handler.compute_event_context(
|
||||
event,
|
||||
state_ids_before_event={
|
||||
(e.type, e.state_key): e.event_id for e in current_state
|
||||
},
|
||||
partial_state=False,
|
||||
)
|
||||
)
|
||||
self.get_success(
|
||||
federation_event_handler._process_received_pdu(
|
||||
self.OTHER_SERVER_NAME,
|
||||
event,
|
||||
state_ids={
|
||||
(e.type, e.state_key): e.event_id for e in current_state
|
||||
},
|
||||
partial_state=False,
|
||||
context,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue