mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 05:12:26 +03:00
Drop reference_sha
column (#3083)
Companion PR to https://github.com/matrix-org/gomatrixserverlib/pull/383
This commit is contained in:
parent
5d6221d191
commit
11b557097c
29 changed files with 299 additions and 227 deletions
|
@ -45,17 +45,17 @@ func TestPreviousEventsTable(t *testing.T) {
|
|||
defer close()
|
||||
|
||||
for _, x := range room.Events() {
|
||||
for _, prevEvent := range x.PrevEvents() {
|
||||
err := tab.InsertPreviousEvent(ctx, nil, prevEvent.EventID, prevEvent.EventSHA256, 1)
|
||||
for _, eventID := range x.PrevEventIDs() {
|
||||
err := tab.InsertPreviousEvent(ctx, nil, eventID, 1)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = tab.SelectPreviousEventExists(ctx, nil, prevEvent.EventID, prevEvent.EventSHA256)
|
||||
err = tab.SelectPreviousEventExists(ctx, nil, eventID)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
}
|
||||
|
||||
// RandomString with a correct EventSHA256 should fail and return sql.ErrNoRows
|
||||
err := tab.SelectPreviousEventExists(ctx, nil, util.RandomString(16), room.Events()[0].EventReference().EventSHA256)
|
||||
// RandomString should fail and return sql.ErrNoRows
|
||||
err := tab.SelectPreviousEventExists(ctx, nil, util.RandomString(16))
|
||||
assert.Error(t, err)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue