Skip to content
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

Adjust re-exports #75

Merged
merged 3 commits into from
Nov 19, 2024
Merged
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.2.0] - in development

### Changed

- Removed `protocol::digest` re-export ([#75]).
- `digest` and `signature` are now re-exported from the top level instead of `session` ([#75]).


[#75]: https://github.com/entropyxyz/manul/pull/75


## [0.1.0] - 2024-11-19

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

8 changes: 6 additions & 2 deletions examples/src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use alloc::{
};
use core::fmt::Debug;

use manul::protocol::*;
use manul::protocol::{
Artifact, BoxedRound, Deserializer, DirectMessage, EchoBroadcast, EntryPoint, FinalizeOutcome, LocalError,
MessageValidationError, NormalBroadcast, PartyId, Payload, Protocol, ProtocolError, ProtocolMessagePart,
ProtocolValidationError, ReceiveError, Round, RoundId, Serializer,
};
Comment on lines +8 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about having a prelude when the code stabilizes a bit that users can *-import, giving them most of the basic types?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically protocol and session are such preludes already, for two different types of users.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a slight problem if you try to glob-import both, because they share LocalError and RemoteError. But a) perhaps they shouldn't (see #25), and b) I can't imagine a case where it would be necessary.

use rand_core::CryptoRngCore;
use serde::{Deserialize, Serialize};
use tracing::debug;
Expand Down Expand Up @@ -405,7 +409,7 @@ mod tests {

use manul::{
dev::{run_sync, BinaryFormat, TestSessionParams, TestSigner},
session::signature::Keypair,
signature::Keypair,
};
use rand_core::OsRng;
use test_log::test;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/simple_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ mod tests {

use manul::{
dev::{run_sync, BinaryFormat, TestSessionParams, TestSigner},
session::signature::Keypair,
signature::Keypair,
};
use rand_core::OsRng;
use test_log::test;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/simple_malicious.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use manul::{
Artifact, BoxedRound, Deserializer, DirectMessage, EntryPoint, LocalError, PartyId, ProtocolMessagePart,
RoundId, Serializer,
},
session::signature::Keypair,
signature::Keypair,
};
use rand_core::{CryptoRngCore, OsRng};
use test_log::test;
Expand Down
6 changes: 2 additions & 4 deletions examples/tests/async_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ use alloc::collections::{BTreeMap, BTreeSet};
use manul::{
dev::{BinaryFormat, TestSessionParams, TestSigner},
protocol::Protocol,
session::{
signature::Keypair, CanFinalize, LocalError, Message, RoundOutcome, Session, SessionId, SessionParameters,
SessionReport,
},
session::{CanFinalize, LocalError, Message, RoundOutcome, Session, SessionId, SessionParameters, SessionReport},
signature::Keypair,
};
use manul_example::simple::{SimpleProtocol, SimpleProtocolEntryPoint};
use rand::Rng;
Expand Down
2 changes: 1 addition & 1 deletion manul/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "manul"
version = "0.1.0"
version = "0.2.0-dev"
edition = "2021"
rust-version = "1.81"
authors = ['Entropy Cryptography <[email protected]>']
Expand Down
2 changes: 1 addition & 1 deletion manul/benches/empty_rounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use manul::{
Artifact, BoxedRound, Deserializer, DirectMessage, EchoBroadcast, EntryPoint, FinalizeOutcome, LocalError,
NormalBroadcast, PartyId, Payload, Protocol, ProtocolMessagePart, ReceiveError, Round, RoundId, Serializer,
},
session::signature::Keypair,
signature::Keypair,
};
use rand_core::{CryptoRngCore, OsRng};
use serde::{Deserialize, Serialize};
Expand Down
6 changes: 5 additions & 1 deletion manul/src/combinators/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ use rand_core::CryptoRngCore;
use serde::{Deserialize, Serialize};

use super::markers::{Combinator, CombinatorEntryPoint};
use crate::protocol::*;
use crate::protocol::{
Artifact, BoxedRng, BoxedRound, Deserializer, DirectMessage, EchoBroadcast, EchoRoundParticipation, EntryPoint,
FinalizeOutcome, LocalError, NormalBroadcast, ObjectSafeRound, PartyId, Payload, Protocol, ProtocolError,
ProtocolValidationError, ReceiveError, RoundId, Serializer,
};

/// A marker for the `chain` combinator.
#[derive(Debug, Clone, Copy)]
Expand Down
4 changes: 4 additions & 0 deletions manul/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ pub mod dev;

#[cfg(test)]
mod tests;

// Re-exports for easier version matching
pub use digest;
pub use signature;
2 changes: 0 additions & 2 deletions manul/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ pub use serialization::{Deserializer, Serializer};

pub(crate) use errors::ReceiveErrorType;
pub(crate) use object_safe::{BoxedRng, ObjectSafeRound};

pub use digest;
3 changes: 0 additions & 3 deletions manul/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ pub use transcript::{SessionOutcome, SessionReport};
pub use wire_format::WireFormat;

pub(crate) use echo::EchoRoundError;

pub use digest;
pub use signature;
8 changes: 6 additions & 2 deletions manul/src/tests/partial_echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ use serde::{Deserialize, Serialize};

use crate::{
dev::{run_sync, BinaryFormat, TestSessionParams, TestSigner, TestVerifier},
protocol::*,
session::signature::Keypair,
protocol::{
Artifact, BoxedRound, Deserializer, DirectMessage, EchoBroadcast, EchoRoundParticipation, EntryPoint,
FinalizeOutcome, LocalError, NormalBroadcast, PartyId, Payload, Protocol, ProtocolError, ProtocolMessagePart,
ProtocolValidationError, ReceiveError, Round, RoundId, Serializer,
},
signature::Keypair,
};

#[derive(Debug)]
Expand Down
Loading