Use PDU in more places (#3072)

This commit is contained in:
kegsay 2023-04-28 16:00:22 +01:00 committed by GitHub
parent d23d0369cc
commit 1432743d1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 49 additions and 84 deletions

View file

@ -29,7 +29,7 @@ func TestRuleSetEvaluatorMatchEvent(t *testing.T) {
Name string
RuleSet RuleSet
Want *Rule
Event *gomatrixserverlib.Event
Event gomatrixserverlib.PDU
}{
{"empty", RuleSet{}, nil, ev},
{"defaultCanWin", RuleSet{Override: []*Rule{defaultEnabled}}, defaultEnabled, ev},
@ -188,7 +188,7 @@ func TestPatternMatches(t *testing.T) {
}
}
func mustEventFromJSON(t *testing.T, json string) *gomatrixserverlib.Event {
func mustEventFromJSON(t *testing.T, json string) gomatrixserverlib.PDU {
ev, err := gomatrixserverlib.MustGetRoomVersion(gomatrixserverlib.RoomVersionV7).NewEventFromTrustedJSON([]byte(json), false)
if err != nil {
t.Fatal(err)