diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-28 07:28:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 07:28:53 -0400 |
commit | d5e73cb6aa56fbd267ca957e64ad893a9ef28708 (patch) | |
tree | 37fad0a115287864b1031d4511958ba4bef4ab85 /synapse/state/v2.py | |
parent | Move and refactor LoginRestServlet helper methods (#8182) (diff) | |
download | synapse-d5e73cb6aa56fbd267ca957e64ad893a9ef28708.tar.xz |
Define StateMap as immutable and add a MutableStateMap type. (#8183)
Diffstat (limited to 'synapse/state/v2.py')
-rw-r--r-- | synapse/state/v2.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/state/v2.py b/synapse/state/v2.py index 0e9ffbd6e6..edf94e7ad6 100644 --- a/synapse/state/v2.py +++ b/synapse/state/v2.py @@ -38,7 +38,7 @@ from synapse.api.constants import EventTypes from synapse.api.errors import AuthError from synapse.api.room_versions import KNOWN_ROOM_VERSIONS from synapse.events import EventBase -from synapse.types import StateMap +from synapse.types import MutableStateMap, StateMap from synapse.util import Clock logger = logging.getLogger(__name__) @@ -414,7 +414,7 @@ async def _iterative_auth_checks( base_state: StateMap[str], event_map: Dict[str, EventBase], state_res_store: "synapse.state.StateResolutionStore", -) -> StateMap[str]: +) -> MutableStateMap[str]: """Sequentially apply auth checks to each event in given list, updating the state as it goes along. @@ -430,7 +430,7 @@ async def _iterative_auth_checks( Returns: Returns the final updated state """ - resolved_state = base_state.copy() + resolved_state = dict(base_state) room_version_obj = KNOWN_ROOM_VERSIONS[room_version] for idx, event_id in enumerate(event_ids, start=1): |