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

Change the generic of ProcessedArtifacts to be uniform with the rest #37

Merged
merged 1 commit into from
Oct 21, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `Session` is now generic over `SessionParameters` instead of a bunch of separate types. ([#36])
- `MessageBundle` is not generic anymore. ([#36])
- `ProcessedArtifact` is now also generic on `SessionParameters`. ([#37])


### Added
Expand All @@ -18,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

[#32]: https://github.com/entropyxyz/manul/pull/32
[#36]: https://github.com/entropyxyz/manul/pull/36
[#37]: https://github.com/entropyxyz/manul/pull/37


## [0.0.1] - 2024-10-12
Expand Down
14 changes: 7 additions & 7 deletions manul/src/session/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ where
&self,
rng: &mut impl CryptoRngCore,
destination: &SP::Verifier,
) -> Result<(MessageBundle, ProcessedArtifact<SP::Verifier>), LocalError> {
) -> Result<(MessageBundle, ProcessedArtifact<SP>), LocalError> {
let (direct_message, artifact) = self.round.make_direct_message(rng, destination)?;

let bundle = MessageBundle::new::<P, SP>(
Expand All @@ -212,7 +212,7 @@ where
pub fn add_artifact(
&self,
accum: &mut RoundAccumulator<P, SP>,
processed: ProcessedArtifact<SP::Verifier>,
processed: ProcessedArtifact<SP>,
) -> Result<(), LocalError> {
accum.add_artifact(processed)
}
Expand Down Expand Up @@ -546,7 +546,7 @@ where
}
}

fn add_artifact(&mut self, processed: ProcessedArtifact<SP::Verifier>) -> Result<(), LocalError> {
fn add_artifact(&mut self, processed: ProcessedArtifact<SP>) -> Result<(), LocalError> {
if self
.artifacts
.insert(processed.destination.clone(), processed.artifact)
Expand Down Expand Up @@ -639,8 +639,8 @@ where
}
}

pub struct ProcessedArtifact<Verifier> {
destination: Verifier,
pub struct ProcessedArtifact<SP: SessionParameters> {
destination: SP::Verifier,
artifact: Artifact,
}

Expand Down Expand Up @@ -672,7 +672,7 @@ mod tests {
DeserializationError, DirectMessage, EchoBroadcast, LocalError, Protocol, ProtocolError,
ProtocolValidationError, RoundId,
},
testing::{TestingSessionParams, Verifier},
testing::TestingSessionParams,
};

#[test]
Expand Down Expand Up @@ -731,7 +731,7 @@ mod tests {

// These objects are sent to/from message processing tasks
assert!(impls!(MessageBundle: Send));
assert!(impls!(ProcessedArtifact<Verifier>: Send));
assert!(impls!(ProcessedArtifact<TestingSessionParams>: Send));
assert!(impls!(VerifiedMessageBundle<TestingSessionParams>: Send));
assert!(impls!(ProcessedMessage<DummyProtocol, TestingSessionParams>: Send));
}
Expand Down
Loading