Skip to content

Upgrade the rand* crates to v0.9 #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
rust:
- 1.81.0 # MSRV
- 1.85.0 # MSRV
- stable
target:
- wasm32-unknown-unknown
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
matrix:
include:
- target: x86_64-unknown-linux-gnu
rust: 1.81.0 # MSRV
rust: 1.85.0 # MSRV
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
Expand All @@ -76,7 +76,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.81.0 # MSRV
toolchain: 1.85.0 # MSRV
components: clippy
override: true
profile: minimal
Expand Down
106 changes: 86 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ manul = { path = "../manul" }
postcard = { version = "1", features = ["alloc"] }
serde = "1"
sha3 = "0.10"
rand_core = "0.6"
rand_core = "0.9"
tracing = "0.1"
displaydoc = "0.2"

[dev-dependencies]
tokio = { version = "1", features = ["rt", "sync", "time", "macros"] }
rand = "0.8"
digest = "0.10"
rand = "0.9"
digest = { version = "0.11.0-pre.9", default-features = false }
manul = { path = "../manul", features = ["dev", "tokio"] }
test-log = { version = "0.2", features = ["trace", "color"] }
20 changes: 10 additions & 10 deletions examples/src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use manul::protocol::{
ProtocolMessagePart, ProtocolValidationError, ReceiveError, RequiredMessageParts, RequiredMessages, Round, RoundId,
Serializer, TransitionInfo,
};
use rand_core::CryptoRngCore;
use rand_core::CryptoRng;
use serde::{Deserialize, Serialize};
use tracing::debug;

Expand Down Expand Up @@ -166,7 +166,7 @@ impl<Id: PartyId> EntryPoint<Id> for SimpleProtocolEntryPoint<Id> {

fn make_round(
self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
_shared_randomness: &[u8],
id: &Id,
) -> Result<BoxedRound<Id, Self::Protocol>, LocalError> {
Expand Down Expand Up @@ -205,7 +205,7 @@ impl<Id: PartyId> Round<Id> for Round1<Id> {

fn make_normal_broadcast(
&self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
serializer: &Serializer,
) -> Result<NormalBroadcast, LocalError> {
debug!("{:?}: making normal broadcast", self.context.id);
Expand All @@ -220,7 +220,7 @@ impl<Id: PartyId> Round<Id> for Round1<Id> {

fn make_echo_broadcast(
&self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
serializer: &Serializer,
) -> Result<EchoBroadcast, LocalError> {
debug!("{:?}: making echo broadcast", self.context.id);
Expand All @@ -234,7 +234,7 @@ impl<Id: PartyId> Round<Id> for Round1<Id> {

fn make_direct_message(
&self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
serializer: &Serializer,
destination: &Id,
) -> Result<(DirectMessage, Option<Artifact>), LocalError> {
Expand Down Expand Up @@ -271,7 +271,7 @@ impl<Id: PartyId> Round<Id> for Round1<Id> {

fn finalize(
self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
payloads: BTreeMap<Id, Payload>,
_artifacts: BTreeMap<Id, Artifact>,
) -> Result<FinalizeOutcome<Id, Self::Protocol>, LocalError> {
Expand Down Expand Up @@ -321,7 +321,7 @@ impl<Id: PartyId> Round<Id> for Round2<Id> {

fn make_direct_message(
&self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
serializer: &Serializer,
destination: &Id,
) -> Result<(DirectMessage, Option<Artifact>), LocalError> {
Expand Down Expand Up @@ -359,7 +359,7 @@ impl<Id: PartyId> Round<Id> for Round2<Id> {

fn finalize(
self,
_rng: &mut impl CryptoRngCore,
_rng: &mut impl CryptoRng,
payloads: BTreeMap<Id, Payload>,
_artifacts: BTreeMap<Id, Artifact>,
) -> Result<FinalizeOutcome<Id, Self::Protocol>, LocalError> {
Expand Down Expand Up @@ -388,7 +388,7 @@ mod tests {
dev::{run_sync, BinaryFormat, TestSessionParams, TestSigner},
signature::Keypair,
};
use rand_core::OsRng;
use rand_core::{OsRng, TryRngCore};
use test_log::test;

use super::SimpleProtocolEntryPoint;
Expand All @@ -405,7 +405,7 @@ mod tests {
.map(|signer| (signer, SimpleProtocolEntryPoint::new(all_ids.clone())))
.collect::<Vec<_>>();

let results = run_sync::<_, TestSessionParams<BinaryFormat>>(&mut OsRng, entry_points)
let results = run_sync::<_, TestSessionParams<BinaryFormat>>(&mut OsRng.unwrap_err(), entry_points)
.unwrap()
.results()
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/src/simple_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mod tests {
dev::{run_sync, BinaryFormat, TestSessionParams, TestSigner},
signature::Keypair,
};
use rand_core::OsRng;
use rand_core::{OsRng, TryRngCore};
use test_log::test;

use super::DoubleSimpleEntryPoint;
Expand All @@ -87,7 +87,7 @@ mod tests {
.map(|signer| (signer, DoubleSimpleEntryPoint::new(all_ids.clone())))
.collect::<Vec<_>>();

let results = run_sync::<_, TestSessionParams<BinaryFormat>>(&mut OsRng, entry_points)
let results = run_sync::<_, TestSessionParams<BinaryFormat>>(&mut OsRng.unwrap_err(), entry_points)
.unwrap()
.results()
.unwrap();
Expand Down
Loading
Loading