Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gui1117 committed Jul 8, 2023
1 parent 3ba4122 commit c746c9c
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions primitives/inherents/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,27 +292,6 @@ impl Default for CheckInherentsResult {
}
}

/// Errors that occur in context of [CheckInherentsResult::put_error].
#[derive(Debug)]
#[cfg_attr(feature = "std", derive(thiserror::Error))]
#[allow(missing_docs)]
pub enum CheckInherentsResultPutErrorError {
#[cfg_attr(
feature = "std",
error("Inherent data already exists for identifier: {}", "String::from_utf8_lossy(_0)")
)]
InherentDataExists(InherentIdentifier),
#[cfg_attr(
feature = "std",
error("Failed to decode inherent data for identifier: {}", "String::from_utf8_lossy(_1)")
)]
#[cfg_attr(
feature = "std",
error("There was already a fatal error reported and no other errors are allowed")
)]
FatalErrorReported,
}

impl CheckInherentsResult {
/// Create a new instance.
pub fn new() -> Self {
Expand All @@ -331,10 +310,10 @@ impl CheckInherentsResult {
&mut self,
identifier: InherentIdentifier,
error: &E,
) -> Result<(), CheckInherentsResultPutErrorError> {
) -> Result<(), Error> {
// Don't accept any other error
if self.fatal_error {
return Err(CheckInherentsResultPutErrorError::FatalErrorReported)
return Err(Error::FatalErrorReported)
}

if error.is_fatal_error() {
Expand Down

0 comments on commit c746c9c

Please sign in to comment.