Skip to content

Commit a02d028

Browse files
committed
Add missing documentation
Those undocumented methods were the one implementing the business traits, so they inherited those traits docs.
1 parent a44b3a6 commit a02d028

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

internal/mithril-persistence/src/database/repository/cardano_transaction_repository.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ impl CardanoTransactionRepository {
139139
}
140140

141141
// 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(
143144
&self,
144145
immutable_file_number: ImmutableFileNumber,
145146
) -> StdResult<Option<BlockNumber>> {
@@ -188,20 +189,23 @@ impl CardanoTransactionRepository {
188189
Ok(Box::new(iterator))
189190
}
190191

192+
/// Retrieve all the [CardanoTransaction] in database.
191193
pub async fn get_all(&self) -> StdResult<Vec<CardanoTransaction>> {
192194
let provider = GetCardanoTransactionProvider::new(&self.connection);
193195
let records = provider.get_all()?;
194196

195197
Ok(records.map(|record| record.into()).collect())
196198
}
197199

200+
/// Retrieve all the [BlockRangeRootRecord] in database.
198201
pub fn get_all_block_range_root(&self) -> StdResult<Vec<BlockRangeRootRecord>> {
199202
let provider = GetBlockRangeRootProvider::new(&self.connection);
200203
let records = provider.get_all()?;
201204

202205
Ok(records.collect())
203206
}
204207

208+
/// Get the highest [ImmutableFileNumber] of the cardano transactions stored in the database.
205209
pub async fn get_transaction_highest_immutable_file_number(
206210
&self,
207211
) -> StdResult<Option<ImmutableFileNumber>> {
@@ -231,6 +235,9 @@ impl CardanoTransactionRepository {
231235
}
232236
}
233237

238+
/// Store the given transactions in the database.
239+
///
240+
/// The storage is done in chunks to avoid exceeding sqlite binding limitations.
234241
pub async fn store_transactions<T: Into<CardanoTransactionRecord> + Clone>(
235242
&self,
236243
transactions: Vec<T>,
@@ -251,6 +258,7 @@ impl CardanoTransactionRepository {
251258
Ok(())
252259
}
253260

261+
/// Get the block interval without block range root if any.
254262
pub async fn get_block_interval_without_block_range_root(
255263
&self,
256264
) -> StdResult<Option<Range<BlockNumber>>> {
@@ -266,6 +274,7 @@ impl CardanoTransactionRepository {
266274
}
267275
}
268276

277+
/// Get the [CardanoTransactionRecord] for the given transaction hashes.
269278
pub async fn get_transaction_by_hashes<T: Into<TransactionHash>>(
270279
&self,
271280
hashes: Vec<T>,
@@ -278,6 +287,7 @@ impl CardanoTransactionRepository {
278287
Ok(transactions.collect())
279288
}
280289

290+
/// Get the [CardanoTransactionRecord] for the given block ranges.
281291
pub async fn get_transaction_by_block_ranges(
282292
&self,
283293
block_ranges: Vec<BlockRange>,

0 commit comments

Comments
 (0)