Skip to content

Commit 8f296a9

Browse files
committed
fix dependencies in Signer and Client
1 parent 91853b5 commit 8f296a9

File tree

9 files changed

+23
-20
lines changed

9 files changed

+23
-20
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.2.33"
3+
version = "0.2.34"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/src/stake_distribution_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use tokio::sync::{Mutex, MutexGuard};
1717

1818
use crate::database::provider::StakePoolStore;
1919

20-
/// Errors related to the [StakePoolDistributionService].
20+
/// Errors related to the [StakeDistributionService].
2121
#[derive(Debug)]
2222
pub enum StakePoolDistributionServiceError {
2323
/// Critical errors cannot be recovered.

mithril-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-common"
3-
version = "0.2.28"
3+
version = "0.2.29"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

mithril-common/src/store/adapter/sqlite_adapter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ where
2929
/// Create a new SQLiteAdapter instance.
3030
pub fn new(table_name: &str, connection: Arc<Mutex<Connection>>) -> Result<Self> {
3131
{
32-
let conn = &*connection.blocking_lock();
32+
let conn = &*connection
33+
.try_lock()
34+
.map_err(|e| AdapterError::InitializationError(e.into()))?;
3335
Self::check_table_exists(conn, table_name)?;
3436
}
3537

mithril-common/src/store/store_pruner.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ pub trait StorePruner {
4141

4242
#[cfg(test)]
4343
mod tests {
44-
use std::{
45-
cmp::min,
46-
sync::{Arc, Mutex},
47-
};
44+
use std::{cmp::min, sync::Arc};
4845

4946
use sqlite::Connection;
47+
use tokio::sync::Mutex;
5048

5149
use crate::store::adapter::SQLiteAdapter;
5250

mithril-signer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-signer"
3-
version = "0.2.24"
3+
version = "0.2.25"
44
description = "A Mithril Signer"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-signer/src/main.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::path::PathBuf;
55
use std::sync::Arc;
66
use std::time::Duration;
77

8-
use mithril_common::database::{ApplicationNodeType, DatabaseVersionChecker};
98
use mithril_signer::{
109
Configuration, DefaultConfiguration, ProductionServiceBuilder, ServiceBuilder, SignerRunner,
1110
SignerState, StateMachine,
@@ -102,13 +101,6 @@ async fn main() -> Result<(), String> {
102101
.build()
103102
.await
104103
.map_err(|e| e.to_string())?;
105-
DatabaseVersionChecker::new(
106-
slog_scope::logger(),
107-
ApplicationNodeType::Signer,
108-
config.get_sqlite_file(),
109-
)
110-
.apply()
111-
.map_err(|e| e.to_string())?;
112104
debug!("Started"; "run_mode" => &args.run_mode, "config" => format!("{config:?}"));
113105

114106
let mut state_machine = StateMachine::new(

mithril-signer/src/runtime/signer_services.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use mithril_common::{
77
api_version::APIVersionProvider,
88
chain_observer::{CardanoCliChainObserver, CardanoCliRunner, ChainObserver},
99
crypto_helper::{OpCert, ProtocolPartyId, SerDeShelleyFileFormat},
10+
database::{ApplicationNodeType, DatabaseVersionChecker},
1011
digesters::{
1112
cache::{ImmutableFileDigestCacheProvider, JsonImmutableFileDigestCacheProviderBuilder},
1213
ImmutableFileObserver,
@@ -143,6 +144,16 @@ impl<'a> ServiceBuilder for ProductionServiceBuilder<'a> {
143144

144145
let sqlite_db_path = self.config.get_sqlite_file();
145146
let sqlite_connection = Arc::new(Mutex::new(Connection::open(sqlite_db_path)?));
147+
DatabaseVersionChecker::new(
148+
slog_scope::logger(),
149+
ApplicationNodeType::Signer,
150+
sqlite_connection.clone(),
151+
)
152+
.apply()
153+
.await
154+
.map_err(|e| -> Box<dyn std::error::Error> {
155+
format!("Database migration error {e}").into()
156+
})?;
146157
let protocol_initializer_store = Arc::new(ProtocolInitializerStore::new(
147158
Box::new(SQLiteAdapter::new(
148159
"protocol_initializer",

0 commit comments

Comments
 (0)