Skip to content

Commit

Permalink
add PrecomileError::other
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimenez committed Mar 7, 2024
1 parent 6a0bdfa commit 65fd9ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/primitives/src/precompile.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{Bytes, Env};
use core::fmt;
use dyn_clone::DynClone;
use std::{boxed::Box, sync::Arc};
use std::{boxed::Box, string::String, sync::Arc};

/// A precompile operation result.
///
Expand Down Expand Up @@ -126,7 +126,13 @@ pub enum PrecompileError {
/// The proof verification failed.
BlobVerifyKzgProofFailed,
/// Catch-all variant for other errors.
Other(std::string::String),
Other(String),
}

impl PrecompileError {
pub fn other(err: impl Into<String>) -> Self {
Self::Other(err.into())
}
}

#[cfg(feature = "std")]
Expand Down

0 comments on commit 65fd9ca

Please sign in to comment.