mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Add tests around federationapi's txnReq (#1010)
* Add necessary stubs for testing txnReq * Add basic tests
This commit is contained in:
parent
1db5dfe4d0
commit
1294852270
2 changed files with 410 additions and 2 deletions
|
@ -103,8 +103,17 @@ type txnReq struct {
|
|||
rsAPI api.RoomserverInternalAPI
|
||||
producer *producers.RoomserverProducer
|
||||
eduProducer *producers.EDUServerProducer
|
||||
keys gomatrixserverlib.KeyRing
|
||||
federation *gomatrixserverlib.FederationClient
|
||||
keys gomatrixserverlib.JSONVerifier
|
||||
federation txnFederationClient
|
||||
}
|
||||
|
||||
// A subset of FederationClient functionality that txn requires. Useful for testing.
|
||||
type txnFederationClient interface {
|
||||
LookupState(ctx context.Context, s gomatrixserverlib.ServerName, roomID string, eventID string, roomVersion gomatrixserverlib.RoomVersion) (
|
||||
res gomatrixserverlib.RespState, err error,
|
||||
)
|
||||
LookupStateIDs(ctx context.Context, s gomatrixserverlib.ServerName, roomID string, eventID string) (res gomatrixserverlib.RespStateIDs, err error)
|
||||
GetEvent(ctx context.Context, s gomatrixserverlib.ServerName, eventID string) (res gomatrixserverlib.Transaction, err error)
|
||||
}
|
||||
|
||||
func (t *txnReq) processTransaction() (*gomatrixserverlib.RespSend, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue