@@ -90,7 +90,7 @@ func BlockEncoderToPGStruct(block *lib.MsgDeSoBlock, keyBytes []byte, params *li
90
90
91
91
// PostBatchOperation is the entry point for processing a batch of post entries. It determines the appropriate handler
92
92
// based on the operation type and executes it.
93
- func BlockBatchOperation (entries []* lib.StateChangeEntry , db * bun.DB , params * lib.DeSoParams ) error {
93
+ func BlockBatchOperation (entries []* lib.StateChangeEntry , db bun.IDB , params * lib.DeSoParams ) error {
94
94
// We check before we call this function that there is at least one operation type.
95
95
// We also ensure before this that all entries have the same operation type.
96
96
operationType := entries [0 ].OperationType
@@ -107,7 +107,7 @@ func BlockBatchOperation(entries []*lib.StateChangeEntry, db *bun.DB, params *li
107
107
}
108
108
109
109
// bulkInsertUtxoOperationsEntry inserts a batch of user_association entries into the database.
110
- func bulkInsertBlockEntry (entries []* lib.StateChangeEntry , db * bun.DB , operationType lib.StateSyncerOperationType , params * lib.DeSoParams ) error {
110
+ func bulkInsertBlockEntry (entries []* lib.StateChangeEntry , db bun.IDB , operationType lib.StateSyncerOperationType , params * lib.DeSoParams ) error {
111
111
// If this block is a part of the initial sync, skip it - it will be handled by the utxo operations.
112
112
if operationType == lib .DbOperationTypeInsert {
113
113
return nil
@@ -217,7 +217,7 @@ func bulkInsertBlockEntry(entries []*lib.StateChangeEntry, db *bun.DB, operation
217
217
}
218
218
219
219
// bulkDeleteBlockEntry deletes a batch of block entries from the database.
220
- func bulkDeleteBlockEntry (entries []* lib.StateChangeEntry , db * bun.DB , operationType lib.StateSyncerOperationType ) error {
220
+ func bulkDeleteBlockEntry (entries []* lib.StateChangeEntry , db bun.IDB , operationType lib.StateSyncerOperationType ) error {
221
221
// Track the unique entries we've inserted so we don't insert the same entry twice.
222
222
uniqueEntries := consumer .UniqueEntries (entries )
223
223
@@ -229,7 +229,7 @@ func bulkDeleteBlockEntry(entries []*lib.StateChangeEntry, db *bun.DB, operation
229
229
230
230
// bulkDeleteBlockEntriesFromKeysToDelete deletes a batch of block entries from the database.
231
231
// It also deletes any transactions and utxo operations associated with the block.
232
- func bulkDeleteBlockEntriesFromKeysToDelete (db * bun.DB , keysToDelete [][]byte ) error {
232
+ func bulkDeleteBlockEntriesFromKeysToDelete (db bun.IDB , keysToDelete [][]byte ) error {
233
233
// Execute the delete query on the blocks table.
234
234
if _ , err := db .NewDelete ().
235
235
Model (& PGBlockEntry {}).
0 commit comments