Skip to content

Commit 0ea6a84

Browse files
committed
Make all signer & aggregator provider method pub if they were pub(crate)
As the pub(crate) visibility modifier is enforced for the whole `provider` module on the database::mod file.
1 parent da8a642 commit 0ea6a84

File tree

14 files changed

+25
-34
lines changed

14 files changed

+25
-34
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<'client> GetCardanoTransactionProvider<'client> {
1919
}
2020

2121
// Useful in test and probably in the future.
22-
pub(crate) fn get_transaction_hash_condition(
22+
pub fn get_transaction_hash_condition(
2323
&self,
2424
transaction_hash: &TransactionHash,
2525
) -> WhereCondition {
@@ -29,7 +29,7 @@ impl<'client> GetCardanoTransactionProvider<'client> {
2929
)
3030
}
3131

32-
pub(crate) fn get_transaction_up_to_beacon_condition(
32+
pub fn get_transaction_up_to_beacon_condition(
3333
&self,
3434
beacon: ImmutableFileNumber,
3535
) -> WhereCondition {

mithril-aggregator/src/database/provider/open_message/delete_open_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl<'client> DeleteOpenMessageProvider<'client> {
1818
Self { connection }
1919
}
2020

21-
pub(crate) fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
21+
pub fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
2222
WhereCondition::new("epoch_setting_id < ?*", vec![Value::Integer(*epoch as i64)])
2323
}
2424
}

mithril-aggregator/src/database/provider/open_message/get_open_message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ impl<'client> GetOpenMessageProvider<'client> {
2121
Self { connection }
2222
}
2323

24-
pub(crate) fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
24+
pub fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
2525
WhereCondition::new("epoch_setting_id = ?*", vec![Value::Integer(*epoch as i64)])
2626
}
2727

28-
pub(crate) fn get_signed_entity_type_condition(
28+
pub fn get_signed_entity_type_condition(
2929
&self,
3030
signed_entity_type: &SignedEntityType,
3131
) -> StdResult<WhereCondition> {
@@ -38,7 +38,7 @@ impl<'client> GetOpenMessageProvider<'client> {
3838
))
3939
}
4040

41-
pub(crate) fn get_expired_entity_type_condition(&self, now: &str) -> WhereCondition {
41+
pub fn get_expired_entity_type_condition(&self, now: &str) -> WhereCondition {
4242
WhereCondition::new("expires_at < ?*", vec![Value::String(now.to_string())])
4343
}
4444

mithril-aggregator/src/database/provider/open_message/get_open_message_with_single_signatures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ impl<'client> GetOpenMessageWithSingleSignaturesProvider<'client> {
1818
Self { connection }
1919
}
2020

21-
pub(crate) fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
21+
pub fn get_epoch_condition(&self, epoch: Epoch) -> WhereCondition {
2222
WhereCondition::new("epoch_setting_id = ?*", vec![Value::Integer(*epoch as i64)])
2323
}
2424

25-
pub(crate) fn get_signed_entity_type_condition(
25+
pub fn get_signed_entity_type_condition(
2626
&self,
2727
signed_entity_type: &SignedEntityType,
2828
) -> StdResult<WhereCondition> {

mithril-aggregator/src/database/provider/open_message/insert_open_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<'client> InsertOpenMessageProvider<'client> {
2121
Self { connection }
2222
}
2323

24-
pub(crate) fn get_insert_condition(
24+
pub fn get_insert_condition(
2525
&self,
2626
epoch: Epoch,
2727
signed_entity_type: &SignedEntityType,

mithril-aggregator/src/database/provider/open_message/update_open_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<'client> UpdateOpenMessageProvider<'client> {
1919
Self { connection }
2020
}
2121

22-
pub(crate) fn get_update_condition(
22+
pub fn get_update_condition(
2323
&self,
2424
open_message: &OpenMessageRecord,
2525
) -> StdResult<WhereCondition> {

mithril-aggregator/src/database/provider/signed_entity/insert_signed_entity.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ impl<'conn> InsertSignedEntityRecordProvider<'conn> {
1818
Self { connection }
1919
}
2020

21-
pub(crate) fn get_insert_condition(
22-
&self,
23-
signed_entity_record: SignedEntityRecord,
24-
) -> WhereCondition {
21+
pub fn get_insert_condition(&self, signed_entity_record: SignedEntityRecord) -> WhereCondition {
2522
WhereCondition::new(
2623
"(signed_entity_id, signed_entity_type_id, certificate_id, beacon, artifact, created_at) values (?*, ?*, ?*, ?*, ?*, ?*)",
2724
vec![
@@ -35,7 +32,7 @@ impl<'conn> InsertSignedEntityRecordProvider<'conn> {
3532
)
3633
}
3734

38-
pub(crate) fn persist(
35+
pub fn persist(
3936
&self,
4037
signed_entity_record: SignedEntityRecord,
4138
) -> StdResult<SignedEntityRecord> {

mithril-aggregator/src/database/provider/signed_entity/update_signed_entity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ where signed_entity_id = ?*";
3838
Ok(WhereCondition::new(expression, parameters))
3939
}
4040

41-
pub(crate) fn persist(
41+
pub fn persist(
4242
&self,
4343
signed_entity_record: &SignedEntityRecord,
4444
) -> StdResult<SignedEntityRecord> {

mithril-aggregator/src/database/provider/signer/import_signer.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'conn> ImportSignerRecordProvider<'conn> {
2323
Self { connection }
2424
}
2525

26-
pub(crate) fn get_import_condition(&self, signer_records: Vec<SignerRecord>) -> WhereCondition {
26+
pub fn get_import_condition(&self, signer_records: Vec<SignerRecord>) -> WhereCondition {
2727
let columns = "(signer_id, pool_ticker, created_at, updated_at, last_registered_at)";
2828
let values_columns: Vec<&str> = repeat("(?*, ?*, ?*, ?*, ?*)")
2929
.take(signer_records.len())
@@ -53,7 +53,7 @@ impl<'conn> ImportSignerRecordProvider<'conn> {
5353
)
5454
}
5555

56-
pub(crate) fn persist(&self, signer_record: SignerRecord) -> StdResult<SignerRecord> {
56+
pub fn persist(&self, signer_record: SignerRecord) -> StdResult<SignerRecord> {
5757
let filters = self.get_import_condition(vec![signer_record.clone()]);
5858

5959
let entity = self.find(filters)?.next().unwrap_or_else(|| {
@@ -63,10 +63,7 @@ impl<'conn> ImportSignerRecordProvider<'conn> {
6363
Ok(entity)
6464
}
6565

66-
pub(crate) fn persist_many(
67-
&self,
68-
signer_records: Vec<SignerRecord>,
69-
) -> StdResult<Vec<SignerRecord>> {
66+
pub fn persist_many(&self, signer_records: Vec<SignerRecord>) -> StdResult<Vec<SignerRecord>> {
7067
let filters = self.get_import_condition(signer_records);
7168

7269
Ok(self.find(filters)?.collect())

mithril-aggregator/src/database/provider/signer/register_signer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<'conn> RegisterSignerRecordProvider<'conn> {
3939
)
4040
}
4141

42-
pub(crate) fn persist(&self, signer_record: SignerRecord) -> StdResult<SignerRecord> {
42+
pub fn persist(&self, signer_record: SignerRecord) -> StdResult<SignerRecord> {
4343
let filters = self.get_register_condition(signer_record.clone());
4444

4545
let entity = self.find(filters)?.next().unwrap_or_else(|| {

0 commit comments

Comments
 (0)