Pass room version object into event_auth.check and check_redaction (#6788)

These are easier to work with than the strings and we normally have one around.

This fixes `FederationHander._persist_auth_tree` which was passing a
RoomVersion object into event_auth.check instead of a string.
This commit is contained in:
Richard van der Hoff 2020-01-28 14:18:29 +00:00 committed by GitHub
parent 02b44db922
commit a8ce7aeb43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 35 deletions

View file

@ -37,7 +37,7 @@ class EventAuthTestCase(unittest.TestCase):
# creator should be able to send state
event_auth.check(
RoomVersions.V1.identifier,
RoomVersions.V1,
_random_state_event(creator),
auth_events,
do_sig_check=False,
@ -47,7 +47,7 @@ class EventAuthTestCase(unittest.TestCase):
self.assertRaises(
AuthError,
event_auth.check,
RoomVersions.V1.identifier,
RoomVersions.V1,
_random_state_event(joiner),
auth_events,
do_sig_check=False,
@ -76,7 +76,7 @@ class EventAuthTestCase(unittest.TestCase):
self.assertRaises(
AuthError,
event_auth.check,
RoomVersions.V1.identifier,
RoomVersions.V1,
_random_state_event(pleb),
auth_events,
do_sig_check=False,
@ -84,10 +84,7 @@ class EventAuthTestCase(unittest.TestCase):
# king should be able to send state
event_auth.check(
RoomVersions.V1.identifier,
_random_state_event(king),
auth_events,
do_sig_check=False,
RoomVersions.V1, _random_state_event(king), auth_events, do_sig_check=False,
)