Skip to content

Commit 69ca040

Browse files
committed
Synchronise most of signer & aggregator ctx repository code
1 parent 16a54fe commit 69ca040

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

mithril-aggregator/src/database/provider/cardano_transaction/get_cardano_transaction.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ use std::ops::Range;
33
use sqlite::Value;
44

55
use mithril_common::entities::{BlockNumber, BlockRange, TransactionHash};
6+
#[cfg(test)]
7+
use mithril_persistence::sqlite::GetAllCondition;
68
use mithril_persistence::sqlite::{
79
Provider, SourceAlias, SqLiteEntity, SqliteConnection, WhereCondition,
810
};
911

10-
#[cfg(test)]
11-
use mithril_persistence::sqlite::GetAllCondition;
12-
1312
use crate::database::record::CardanoTransactionRecord;
1413

1514
/// Simple queries to retrieve [CardanoTransaction] from the sqlite database.

mithril-aggregator/src/database/repository/cardano_transaction_repository.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,13 @@ impl BlockRangeRootRetriever for CardanoTransactionRepository {
343343
let provider = GetBlockRangeRootProvider::new(&self.connection);
344344
let filters = provider.get_up_to_block_number_condition(block_number);
345345
let block_range_roots = provider.find(filters)?;
346-
let block_range_roots = block_range_roots
346+
let iterator = block_range_roots
347347
.into_iter()
348348
.map(|record| -> (BlockRange, MKTreeNode) { record.into() })
349349
.collect::<Vec<_>>() // TODO: remove this collect when we should ba able return the iterator directly
350350
.into_iter();
351351

352-
Ok(Box::new(block_range_roots))
352+
Ok(Box::new(iterator))
353353
}
354354
}
355355

mithril-signer/src/database/repository/cardano_transaction_repository.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ impl BlockRangeRootRetriever for CardanoTransactionRepository {
273273
&self,
274274
up_to_beacon: ImmutableFileNumber,
275275
) -> StdResult<Box<dyn Iterator<Item = (BlockRange, MKTreeNode)>>> {
276+
// Get the highest block number for the given immutable number.
277+
// This is a temporary fix that will be removed when the retrieval is based on block number instead of immutable number.
276278
let block_number = self
277279
.get_highest_block_number_for_immutable_number(up_to_beacon)
278280
.await?

0 commit comments

Comments
 (0)