diff --git a/Cargo.lock b/Cargo.lock index 1ec7d24eebe..acba9e256d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4162,7 +4162,7 @@ dependencies = [ [[package]] name = "mithril-client" -version = "0.12.32" +version = "0.12.33" dependencies = [ "anyhow", "async-recursion", diff --git a/mithril-client/Cargo.toml b/mithril-client/Cargo.toml index 82cb76c7f2d..aa33b65de25 100644 --- a/mithril-client/Cargo.toml +++ b/mithril-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-client" -version = "0.12.32" +version = "0.12.33" description = "Mithril client library" authors = { workspace = true } edition = { workspace = true } diff --git a/mithril-client/src/client.rs b/mithril-client/src/client.rs index e61e6f7b515..c65164b55ae 100644 --- a/mithril-client/src/client.rs +++ b/mithril-client/src/client.rs @@ -204,6 +204,7 @@ impl ClientBuilder { /// /// Use [ClientBuilder::aggregator] if you don't need to set a custom [AggregatorClient] /// to request data from the aggregator. + #[deprecated(since = "0.12.33", note = "Will be removed in 0.13.0")] pub fn new(genesis_verification_key: &str) -> ClientBuilder { Self { aggregator_endpoint: None, @@ -382,6 +383,7 @@ impl ClientBuilder { } /// Set the [AggregatorClient] that will be used to request data to the aggregator. + #[deprecated(since = "0.12.33", note = "Will be removed in 0.13.0")] pub fn with_aggregator_client( mut self, aggregator_client: Arc, @@ -485,7 +487,7 @@ mod tests { #[tokio::test] async fn compute_http_headers_returns_options_http_headers() { let http_headers = default_headers(); - let client_builder = ClientBuilder::new("").with_options(ClientOptions { + let client_builder = ClientBuilder::aggregator("", "").with_options(ClientOptions { http_headers: Some(http_headers.clone()), }); @@ -497,7 +499,7 @@ mod tests { #[tokio::test] async fn compute_http_headers_with_origin_tag_returns_options_http_headers_with_origin_tag() { let http_headers = default_headers(); - let client_builder = ClientBuilder::new("") + let client_builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: Some(http_headers.clone()), }) @@ -514,14 +516,14 @@ mod tests { #[tokio::test] async fn test_with_origin_tag_not_overwrite_other_client_options_attributes() { - let builder = ClientBuilder::new("") + let builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: None }) .with_origin_tag(Some("TEST".to_string())); assert_eq!(None, builder.options.http_headers); assert_eq!(Some("TEST".to_string()), builder.origin_tag); let http_headers = HashMap::from([("Key".to_string(), "Value".to_string())]); - let builder = ClientBuilder::new("") + let builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: Some(http_headers.clone()), }) @@ -536,7 +538,7 @@ mod tests { let client_options = ClientOptions { http_headers: Some(http_headers.clone()), }; - let builder = ClientBuilder::new("") + let builder = ClientBuilder::aggregator("", "") .with_options(client_options) .with_origin_tag(None); @@ -547,7 +549,7 @@ mod tests { #[tokio::test] async fn compute_http_headers_with_client_type_returns_options_http_headers_with_client_type() { let http_headers = HashMap::from([("Key".to_string(), "Value".to_string())]); - let client_builder = ClientBuilder::new("") + let client_builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: Some(http_headers.clone()), }) @@ -573,7 +575,7 @@ mod tests { MITHRIL_CLIENT_TYPE_HEADER.to_string(), "client type from options".to_string(), )]); - let client_builder = ClientBuilder::new("").with_options(ClientOptions { + let client_builder = ClientBuilder::aggregator("", "").with_options(ClientOptions { http_headers: Some(http_headers.clone()), }); @@ -584,14 +586,14 @@ mod tests { #[tokio::test] async fn test_with_client_type_not_overwrite_other_client_options_attributes() { - let builder = ClientBuilder::new("") + let builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: None }) .with_client_type(Some("TEST".to_string())); assert_eq!(None, builder.options.http_headers); assert_eq!(Some("TEST".to_string()), builder.client_type); let http_headers = HashMap::from([("Key".to_string(), "Value".to_string())]); - let builder = ClientBuilder::new("") + let builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: Some(http_headers.clone()), }) @@ -603,7 +605,7 @@ mod tests { #[tokio::test] async fn test_given_a_none_client_type_compute_http_headers_will_set_client_type_to_default_value() { - let builder_without_client_type = ClientBuilder::new(""); + let builder_without_client_type = ClientBuilder::aggregator("", ""); let computed_headers = builder_without_client_type.compute_http_headers(); assert_eq!( @@ -614,7 +616,8 @@ mod tests { )]) ); - let builder_with_none_client_type = ClientBuilder::new("").with_client_type(None); + let builder_with_none_client_type = + ClientBuilder::aggregator("", "").with_client_type(None); let computed_headers = builder_with_none_client_type.compute_http_headers(); assert_eq!( @@ -633,7 +636,7 @@ mod tests { MITHRIL_CLIENT_TYPE_HEADER.to_string(), "client type from options".to_string(), )]); - let client_builder = ClientBuilder::new("") + let client_builder = ClientBuilder::aggregator("", "") .with_options(ClientOptions { http_headers: Some(http_headers.clone()), }) diff --git a/mithril-client/src/lib.rs b/mithril-client/src/lib.rs index 22647c6333e..9a2d430fc32 100644 --- a/mithril-client/src/lib.rs +++ b/mithril-client/src/lib.rs @@ -1,5 +1,7 @@ #![warn(missing_docs)] #![cfg_attr(docsrs, feature(doc_cfg))] +// TODO: Remove this allow once migration from deprecated AggregatorClient types is complete +#![allow(deprecated)] //! Define all the tooling necessary to manipulate Mithril certified types from a //! [Mithril Aggregator](https://mithril.network/rust-doc/mithril_aggregator/index.html). @@ -120,6 +122,7 @@ macro_rules! cfg_fs_unstable { } } +#[deprecated(since = "0.12.33", note = "Will be removed soon")] pub mod aggregator_client; pub mod cardano_database_client; pub mod cardano_stake_distribution_client; diff --git a/mithril-client/tests/cardano_db_snapshot_list_get_download_verify.rs b/mithril-client/tests/cardano_db_snapshot_list_get_download_verify.rs index fdabc147389..adb03418f24 100644 --- a/mithril-client/tests/cardano_db_snapshot_list_get_download_verify.rs +++ b/mithril-client/tests/cardano_db_snapshot_list_get_download_verify.rs @@ -1,3 +1,6 @@ +// TODO: Remove this allow once migration from deprecated AggregatorClient types is complete +#![allow(deprecated)] + mod extensions; use std::sync::Arc; diff --git a/mithril-client/tests/cardano_transaction_proof.rs b/mithril-client/tests/cardano_transaction_proof.rs index c1da74e7b6c..2595bc3878b 100644 --- a/mithril-client/tests/cardano_transaction_proof.rs +++ b/mithril-client/tests/cardano_transaction_proof.rs @@ -1,3 +1,6 @@ +// TODO: Remove this allow once migration from deprecated AggregatorClient types is complete +#![allow(deprecated)] + mod extensions; use mithril_client::{ClientBuilder, MessageBuilder, aggregator_client::AggregatorRequest}; diff --git a/mithril-client/tests/certificate_get_list.rs b/mithril-client/tests/certificate_get_list.rs index 46453c5c8db..5c45542ba84 100644 --- a/mithril-client/tests/certificate_get_list.rs +++ b/mithril-client/tests/certificate_get_list.rs @@ -1,3 +1,6 @@ +// TODO: Remove this allow once migration from deprecated AggregatorClient types is complete +#![allow(deprecated)] + mod extensions; use mithril_client::{ClientBuilder, aggregator_client::AggregatorRequest}; diff --git a/mithril-client/tests/mithril_stake_distribution_list_get_show_verify.rs b/mithril-client/tests/mithril_stake_distribution_list_get_show_verify.rs index 736f2578bac..e992de5c52c 100644 --- a/mithril-client/tests/mithril_stake_distribution_list_get_show_verify.rs +++ b/mithril-client/tests/mithril_stake_distribution_list_get_show_verify.rs @@ -1,3 +1,6 @@ +// TODO: Remove this allow once migration from deprecated AggregatorClient types is complete +#![allow(deprecated)] + mod extensions; use mithril_client::{ClientBuilder, MessageBuilder, aggregator_client::AggregatorRequest}; diff --git a/mithril-client/tests/snapshot_list_get_show_download_verify.rs b/mithril-client/tests/snapshot_list_get_show_download_verify.rs index abc030c3437..e4e1622f22c 100644 --- a/mithril-client/tests/snapshot_list_get_show_download_verify.rs +++ b/mithril-client/tests/snapshot_list_get_show_download_verify.rs @@ -1,3 +1,6 @@ +// TODO: Remove this allow once migration from deprecated AggregatorClient types is complete +#![allow(deprecated)] + mod extensions; use std::sync::Arc;