Skip to content

Commit 5255093

Browse files
committed
refactor(types): derive MultiMessageAggregateError with thiserror
1 parent 8ee2c79 commit 5255093

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

crates/common/types/src/block.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,13 @@ impl MultiMessageAggregate {
7777
}
7878

7979
/// Errors returned when constructing a [`MultiMessageAggregate`].
80-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
80+
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
8181
pub enum MultiMessageAggregateError {
8282
/// Proof bytes exceed `ByteList512KiB`'s cap.
83+
#[error("proof {0} bytes exceeds 512 KiB cap")]
8384
ProofTooLarge(usize),
8485
}
8586

86-
impl core::fmt::Display for MultiMessageAggregateError {
87-
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
88-
match self {
89-
Self::ProofTooLarge(n) => write!(f, "proof {n} bytes exceeds 512 KiB cap"),
90-
}
91-
}
92-
}
93-
94-
impl std::error::Error for MultiMessageAggregateError {}
95-
9687
// ============================================================================
9788
// Type-1 multi-signature
9889
// ============================================================================

0 commit comments

Comments
 (0)