MCPcopy Create free account
hub / github.com/daodst/chat / mustProcessTransaction

Function mustProcessTransaction

federationapi/routing/send_test.go:200–222  ·  view source on GitHub ↗
(t *testing.T, txn *txnReq, pdusWithErrors []string)

Source from the content-addressed store, hash-verified

198}
199
200func mustProcessTransaction(t *testing.T, txn *txnReq, pdusWithErrors []string) {
201 res, err := txn.processTransaction(context.Background())
202 if err != nil {
203 t.Errorf("txn.processTransaction returned an error: %v", err)
204 return
205 }
206 if len(res.PDUs) != len(txn.PDUs) {
207 t.Errorf("txn.processTransaction did not return results for all PDUs, got %d want %d", len(res.PDUs), len(txn.PDUs))
208 return
209 }
210NextPDU:
211 for eventID, result := range res.PDUs {
212 if result.Error == "" {
213 continue
214 }
215 for _, eventIDWantError := range pdusWithErrors {
216 if eventID == eventIDWantError {
217 break NextPDU
218 }
219 }
220 t.Errorf("txn.processTransaction PDU %s returned an error %s", eventID, result.Error)
221 }
222}
223
224/*
225func fromStateTuples(tuples []gomatrixserverlib.StateKeyTuple, omitTuples []gomatrixserverlib.StateKeyTuple) (result []*gomatrixserverlib.HeaderedEvent) {

Callers 2

TestBasicTransactionFunction · 0.85

Calls 1

processTransactionMethod · 0.80

Tested by

no test coverage detected