()
| 488 | } |
| 489 | |
| 490 | func (m *mockTxn) Commit() (*clientv3.TxnResponse, error) { |
| 491 | op := clientv3.OpTxn(m.cmps, m.thenOps, m.elseOps) |
| 492 | // Note that we're using the Do method here instead of doInternal since we didn't |
| 493 | // acquire the data lock when starting this transaction. |
| 494 | res, err := m.kv.Do(m.ctx, op) |
| 495 | |
| 496 | if err != nil { |
| 497 | return nil, err |
| 498 | } |
| 499 | |
| 500 | return res.Txn(), nil |
| 501 | } |