mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
multi: add a re-usable TxOptions type
Add a re-usable implementation of the sqldb.TxOptions interface and make use of this in the various spots (invoices, batch and graph/db) where we had previously defined individual implementations that were all doing the same thing.
This commit is contained in:
@@ -317,8 +317,8 @@ func testMigrateSingleInvoiceRapid(t *rapid.T, store *SQLStore, mpp bool,
|
||||
invoices[hash] = invoice
|
||||
}
|
||||
|
||||
var ops SQLInvoiceQueriesTxOptions
|
||||
err := store.db.ExecTx(ctxb, &ops, func(tx SQLInvoiceQueries) error {
|
||||
ops := sqldb.WriteTxOpt()
|
||||
err := store.db.ExecTx(ctxb, ops, func(tx SQLInvoiceQueries) error {
|
||||
for hash, invoice := range invoices {
|
||||
err := MigrateSingleInvoice(ctxb, tx, invoice, hash)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user