Skip to content

Commit

Permalink
Merge pull request #77 from fjarri/error-impl
Browse files Browse the repository at this point in the history
Add an error conversion impl for `NormalBroadcast`
  • Loading branch information
fjarri authored Dec 25, 2024
2 parents 95450bf + 942db4a commit 8ee47c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `ProtocolError::verify_messages_constitute_error()` now takes messages and mapping of messages by value. ([#76])


### Added

- `impl From<NormalBroadcastError> for ProtocolValidationError` (to match what already exists for other messages). ([#77])


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


## [0.1.0] - 2024-11-19
Expand Down
6 changes: 6 additions & 0 deletions manul/src/protocol/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ impl From<EchoBroadcastError> for ProtocolValidationError {
}
}

impl From<NormalBroadcastError> for ProtocolValidationError {
fn from(error: NormalBroadcastError) -> Self {
Self::InvalidEvidence(format!("Failed to deserialize normal broadcast: {error:?}"))
}
}

impl From<LocalError> for ProtocolValidationError {
fn from(error: LocalError) -> Self {
Self::Local(error)
Expand Down

0 comments on commit 8ee47c9

Please sign in to comment.