@@ -139,7 +139,8 @@ impl CardanoTransactionRepository {
139
139
}
140
140
141
141
// TODO: remove this function when the Cardano transaction signature is based on block number instead of immutable number
142
- async fn get_highest_block_number_for_immutable_number (
142
+ /// Get the highest [BlockNumber] of the cardano transactions stored in the database.
143
+ pub async fn get_highest_block_number_for_immutable_number (
143
144
& self ,
144
145
immutable_file_number : ImmutableFileNumber ,
145
146
) -> StdResult < Option < BlockNumber > > {
@@ -188,20 +189,23 @@ impl CardanoTransactionRepository {
188
189
Ok ( Box :: new ( iterator) )
189
190
}
190
191
192
+ /// Retrieve all the [CardanoTransaction] in database.
191
193
pub async fn get_all ( & self ) -> StdResult < Vec < CardanoTransaction > > {
192
194
let provider = GetCardanoTransactionProvider :: new ( & self . connection ) ;
193
195
let records = provider. get_all ( ) ?;
194
196
195
197
Ok ( records. map ( |record| record. into ( ) ) . collect ( ) )
196
198
}
197
199
200
+ /// Retrieve all the [BlockRangeRootRecord] in database.
198
201
pub fn get_all_block_range_root ( & self ) -> StdResult < Vec < BlockRangeRootRecord > > {
199
202
let provider = GetBlockRangeRootProvider :: new ( & self . connection ) ;
200
203
let records = provider. get_all ( ) ?;
201
204
202
205
Ok ( records. collect ( ) )
203
206
}
204
207
208
+ /// Get the highest [ImmutableFileNumber] of the cardano transactions stored in the database.
205
209
pub async fn get_transaction_highest_immutable_file_number (
206
210
& self ,
207
211
) -> StdResult < Option < ImmutableFileNumber > > {
@@ -231,6 +235,9 @@ impl CardanoTransactionRepository {
231
235
}
232
236
}
233
237
238
+ /// Store the given transactions in the database.
239
+ ///
240
+ /// The storage is done in chunks to avoid exceeding sqlite binding limitations.
234
241
pub async fn store_transactions < T : Into < CardanoTransactionRecord > + Clone > (
235
242
& self ,
236
243
transactions : Vec < T > ,
@@ -251,6 +258,7 @@ impl CardanoTransactionRepository {
251
258
Ok ( ( ) )
252
259
}
253
260
261
+ /// Get the block interval without block range root if any.
254
262
pub async fn get_block_interval_without_block_range_root (
255
263
& self ,
256
264
) -> StdResult < Option < Range < BlockNumber > > > {
@@ -266,6 +274,7 @@ impl CardanoTransactionRepository {
266
274
}
267
275
}
268
276
277
+ /// Get the [CardanoTransactionRecord] for the given transaction hashes.
269
278
pub async fn get_transaction_by_hashes < T : Into < TransactionHash > > (
270
279
& self ,
271
280
hashes : Vec < T > ,
@@ -278,6 +287,7 @@ impl CardanoTransactionRepository {
278
287
Ok ( transactions. collect ( ) )
279
288
}
280
289
290
+ /// Get the [CardanoTransactionRecord] for the given block ranges.
281
291
pub async fn get_transaction_by_block_ranges (
282
292
& self ,
283
293
block_ranges : Vec < BlockRange > ,
0 commit comments