PrecompileError

Enum PrecompileError 

Source
pub enum PrecompileError {
Show 37 variants OutOfGas, Blake2WrongLength, Blake2WrongFinalIndicatorFlag, ModexpExpOverflow, ModexpBaseOverflow, ModexpModOverflow, ModexpEip7823LimitSize, Bn254FieldPointNotAMember, Bn254AffineGFailedToCreate, Bn254PairLength, BlobInvalidInputLength, BlobMismatchedVersion, BlobVerifyKzgProofFailed, NonCanonicalFp, Bls12381G1NotOnCurve, Bls12381G1NotInSubgroup, Bls12381G2NotOnCurve, Bls12381G2NotInSubgroup, Bls12381ScalarInputLength, Bls12381G1AddInputLength, Bls12381G1MsmInputLength, Bls12381G2AddInputLength, Bls12381G2MsmInputLength, Bls12381PairingInputLength, Bls12381MapFpToG1InputLength, Bls12381MapFp2ToG2InputLength, Bls12381FpPaddingInvalid, Bls12381FpPaddingLength, Bls12381G1PaddingLength, Bls12381G2PaddingLength, KzgInvalidG1Point, KzgG1PointNotOnCurve, KzgG1PointNotInSubgroup, KzgInvalidInputLength, Secp256k1RecoverFailed, Fatal(String), Other(String),
}
Expand description

Precompile error type.

Variants§

§

OutOfGas

out of gas is the main error. Others are here just for completeness

§

Blake2WrongLength

Blake2 errors

§

Blake2WrongFinalIndicatorFlag

Blake2 wrong final indicator flag

§

ModexpExpOverflow

Modexp errors

§

ModexpBaseOverflow

Modexp base overflow

§

ModexpModOverflow

Modexp mod overflow

§

ModexpEip7823LimitSize

Modexp limit all input sizes.

§

Bn254FieldPointNotAMember

Bn254 errors

§

Bn254AffineGFailedToCreate

Bn254 affine g failed to create

§

Bn254PairLength

Bn254 pair length

§

BlobInvalidInputLength

The input length is not exactly 192 bytes

§

BlobMismatchedVersion

The commitment does not match the versioned hash

§

BlobVerifyKzgProofFailed

The proof verification failed

§

NonCanonicalFp

Non-canonical field element

§

Bls12381G1NotOnCurve

BLS12-381 G1 point not on curve

§

Bls12381G1NotInSubgroup

BLS12-381 G1 point not in correct subgroup

§

Bls12381G2NotOnCurve

BLS12-381 G2 point not on curve

§

Bls12381G2NotInSubgroup

BLS12-381 G2 point not in correct subgroup

§

Bls12381ScalarInputLength

BLS12-381 scalar input length error

§

Bls12381G1AddInputLength

BLS12-381 G1 add input length error

§

Bls12381G1MsmInputLength

BLS12-381 G1 msm input length error

§

Bls12381G2AddInputLength

BLS12-381 G2 add input length error

§

Bls12381G2MsmInputLength

BLS12-381 G2 msm input length error

§

Bls12381PairingInputLength

BLS12-381 pairing input length error

§

Bls12381MapFpToG1InputLength

BLS12-381 map fp to g1 input length error

§

Bls12381MapFp2ToG2InputLength

BLS12-381 map fp2 to g2 input length error

§

Bls12381FpPaddingInvalid

BLS12-381 padding error

§

Bls12381FpPaddingLength

BLS12-381 fp padding length error

§

Bls12381G1PaddingLength

BLS12-381 g1 padding length error

§

Bls12381G2PaddingLength

BLS12-381 g2 padding length error

§

KzgInvalidG1Point

KZG invalid G1 point

§

KzgG1PointNotOnCurve

KZG G1 point not on curve

§

KzgG1PointNotInSubgroup

KZG G1 point not in correct subgroup

§

KzgInvalidInputLength

KZG input length error

§

Secp256k1RecoverFailed

secp256k1 ecrecover failed

§

Fatal(String)

Fatal error with a custom error message

§

Other(String)

Catch-all variant for other errors

Implementations§

Source§

impl PrecompileError

Source

pub fn other(err: impl Into<String>) -> Self

Returns another error with the given message.

Source

pub fn is_oog(&self) -> bool

Returns true if the error is out of gas.

Trait Implementations§

Source§

impl Clone for PrecompileError

Source§

fn clone(&self) -> PrecompileError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PrecompileError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PrecompileError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for PrecompileError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl Hash for PrecompileError

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PrecompileError

Source§

fn eq(&self, other: &PrecompileError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for PrecompileError

Source§

impl StructuralPartialEq for PrecompileError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V