Skip to content

Commit 5f041dd

Browse files
authored
Merge pull request #2613 from input-output-hk/dlachaume/2582/upgrade-to-rust-2024-edition
Upgrade to Rust `2024` edition
2 parents d3d0037 + e653a67 commit 5f041dd

File tree

479 files changed

+2664
-4222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

479 files changed

+2664
-4222
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ As a minor extension, we have adopted a slightly different versioning convention
2323

2424
- Abstracted the implementation of KES signature and verification to allow multiple and reusable implementations.
2525

26+
- Upgrade the Rust edition of the repository from 2021 to 2024
27+
2628
- **UNSTABLE** :
2729
- Support for DMQ signature publisher in the signer and signature consumer in the aggregator.
2830

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ members = [
4040
[workspace.package]
4141
4242
documentation = "https://mithril.network/doc"
43-
edition = "2021"
43+
edition = "2024"
4444
homepage = "https://mithril.network"
4545
license = "Apache-2.0"
4646
repository = "https://github.com/input-output-hk/mithril/"

demo/protocol-demo/src/demonstrator.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,7 @@ impl Party {
108108
}
109109
let closed_reg = key_reg.close();
110110

111-
let signer = self
112-
.initializer
113-
.clone()
114-
.unwrap()
115-
.new_signer(closed_reg)
116-
.unwrap();
111+
let signer = self.initializer.clone().unwrap().new_signer(closed_reg).unwrap();
117112
self.signer = Some(signer);
118113
self.clerk = Some(ProtocolClerk::from_signer(self.signer.as_ref().unwrap()));
119114
}
@@ -446,12 +441,7 @@ impl ProtocolDemonstrator for Demonstrator {
446441
Err(err) => return Err(err),
447442
}
448443
let msig = party.get_aggregate(message).unwrap();
449-
match self
450-
.verifier
451-
.as_ref()
452-
.unwrap()
453-
.verify_message(message, msig)
454-
{
444+
match self.verifier.as_ref().unwrap().verify_message(message, msig) {
455445
Ok(_) => (),
456446
Err(err) => return Err(err),
457447
}

demo/protocol-demo/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use mithril_stm::{
33
StmVerificationKeyPoP,
44
};
55

6-
use blake2::{digest::consts::U32, Blake2b};
6+
use blake2::{Blake2b, digest::consts::U32};
77

88
// Protocol types alias
99
type D = Blake2b<U32>;

examples/client-cardano-database-v2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-database-v2"
33
description = "Mithril client Cardano database example"
4-
version = "0.0.9"
4+
version = "0.0.10"
55
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-database-v2/src/main.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,9 @@ async fn main() -> MithrilResult<()> {
7070
.hash
7171
.as_ref();
7272

73-
let cardano_database_snapshot =
74-
client
75-
.cardano_database_v2()
76-
.get(latest_hash)
77-
.await?
78-
.ok_or(anyhow!(
79-
"A Cardano database should exist for hash '{latest_hash}'"
80-
))?;
73+
let cardano_database_snapshot = client.cardano_database_v2().get(latest_hash).await?.ok_or(
74+
anyhow!("A Cardano database should exist for hash '{latest_hash}'"),
75+
)?;
8176

8277
let unpacked_dir = work_dir.join("unpack");
8378
std::fs::create_dir(&unpacked_dir).unwrap();

examples/client-cardano-database/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-database"
33
description = "Mithril client Cardano database example"
4-
version = "0.1.33"
4+
version = "0.1.34"
55
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-database/src/main.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ async fn main() -> MithrilResult<()> {
7878
let unpacked_dir = work_dir.join("unpack");
7979
std::fs::create_dir(&unpacked_dir).unwrap();
8080

81-
let certificate = client
82-
.certificate()
83-
.verify_chain(&snapshot.certificate_hash)
84-
.await?;
81+
let certificate = client.certificate().verify_chain(&snapshot.certificate_hash).await?;
8582

8683
client
8784
.cardano_database()
@@ -240,9 +237,7 @@ impl FeedbackReceiver for IndicatifFeedbackReceiver {
240237
}
241238

242239
fn get_temp_dir() -> MithrilResult<PathBuf> {
243-
let dir = std::env::temp_dir()
244-
.join("mithril_examples")
245-
.join("client_snapshot");
240+
let dir = std::env::temp_dir().join("mithril_examples").join("client_snapshot");
246241

247242
if dir.exists() {
248243
std::fs::remove_dir_all(&dir).with_context(|| format!("Could not remove dir {dir:?}"))?;

examples/client-wasm-nodejs/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/client-wasm-web/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/cardano-node/mithril-cardano-node-chain/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-cardano-node-chain"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
authors.workspace = true
55
documentation.workspace = true
66
edition.workspace = true

internal/cardano-node/mithril-cardano-node-chain/src/chain_observer/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use serde::{Deserialize, Serialize};
22
use std::{fmt::Display, path::PathBuf, sync::Arc};
33
use thiserror::Error;
44

5-
use mithril_common::entities::CardanoNetwork;
65
use mithril_common::StdResult;
6+
use mithril_common::entities::CardanoNetwork;
77

88
use crate::chain_observer::ChainObserver;
99
use crate::test::double::FakeChainObserver;

0 commit comments

Comments
 (0)