mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Refactor relay perform_test for clarity
This commit is contained in:
parent
27b40621fd
commit
0e4d2593eb
|
|
@ -41,21 +41,21 @@ func (f *testFedClient) P2PGetTransactionFromRelay(
|
|||
relayServer gomatrixserverlib.ServerName,
|
||||
) (res gomatrixserverlib.RespGetRelayTransaction, err error) {
|
||||
f.queryCount++
|
||||
if !f.shouldFail {
|
||||
res = gomatrixserverlib.RespGetRelayTransaction{
|
||||
Txn: gomatrixserverlib.Transaction{},
|
||||
EntryID: 0,
|
||||
}
|
||||
if f.queueDepth > 0 {
|
||||
res.EntriesQueued = true
|
||||
} else {
|
||||
res.EntriesQueued = false
|
||||
}
|
||||
f.queueDepth -= 1
|
||||
} else {
|
||||
err = fmt.Errorf("Error")
|
||||
if f.shouldFail {
|
||||
return res, fmt.Errorf("Error")
|
||||
}
|
||||
|
||||
res = gomatrixserverlib.RespGetRelayTransaction{
|
||||
Txn: gomatrixserverlib.Transaction{},
|
||||
EntryID: 0,
|
||||
}
|
||||
if f.queueDepth > 0 {
|
||||
res.EntriesQueued = true
|
||||
} else {
|
||||
res.EntriesQueued = false
|
||||
}
|
||||
f.queueDepth -= 1
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue