mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Add roomserver tests (1/?) (#2434)
* Add EventJSONTable tests * Add eventJSON tests * Add EventStateKeysTable tests * Add EventTypesTable tests * Add Events Table tests Move variable declaration outside loops Switch to testify/assert for tests * Move variable declaration outside loop * Remove random data * Fix issue where the EventReferenceSHA256 is not set * Add more tests * Revert "Fix issue where the EventReferenceSHA256 is not set" This reverts commit 8ae34c4e5f78584f0edb479f5a893556d2b95d19. * Update GMSL * Add tests for duplicate entries * Test what happens if we select non-existing NIDs * Add test for non-existing eventType * Really update GMSL
This commit is contained in:
parent
09d754cfbf
commit
f69ebc6af2
17 changed files with 499 additions and 88 deletions
|
@ -10,9 +10,8 @@ import (
|
|||
)
|
||||
|
||||
type EventJSONPair struct {
|
||||
EventNID types.EventNID
|
||||
RoomVersion gomatrixserverlib.RoomVersion
|
||||
EventJSON []byte
|
||||
EventNID types.EventNID
|
||||
EventJSON []byte
|
||||
}
|
||||
|
||||
type EventJSON interface {
|
||||
|
@ -36,7 +35,8 @@ type EventStateKeys interface {
|
|||
|
||||
type Events interface {
|
||||
InsertEvent(
|
||||
ctx context.Context, txn *sql.Tx, i types.RoomNID, j types.EventTypeNID, k types.EventStateKeyNID, eventID string,
|
||||
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID, eventTypeNID types.EventTypeNID,
|
||||
eventStateKeyNID types.EventStateKeyNID, eventID string,
|
||||
referenceSHA256 []byte, authEventNIDs []types.EventNID, depth int64, isRejected bool,
|
||||
) (types.EventNID, types.StateSnapshotNID, error)
|
||||
SelectEvent(ctx context.Context, txn *sql.Tx, eventID string) (types.EventNID, types.StateSnapshotNID, error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue