diff --git a/src/precompiles/blake2.rs b/src/precompiles/blake2.rs index 47797ccaf..dffd19e3d 100644 --- a/src/precompiles/blake2.rs +++ b/src/precompiles/blake2.rs @@ -226,28 +226,28 @@ mod tests { assert!(matches!( test_blake2f_empty(), Err(ExitError::Other(Borrowed( - "input length invalid, must be 213 bytes" + "ERR_BLAKE2F_INVALID_LEN" ))) )); assert!(matches!( test_blake2f_invalid_len_1(), Err(ExitError::Other(Borrowed( - "input length invalid, must be 213 bytes" + "ERR_BLAKE2F_INVALID_LEN" ))) )); assert!(matches!( test_blake2f_invalid_len_2(), Err(ExitError::Other(Borrowed( - "input length invalid, must be 213 bytes" + "ERR_BLAKE2F_INVALID_LEN" ))) )); assert!(matches!( test_blake2f_invalid_flag(), Err(ExitError::Other(Borrowed( - "incorrect final block indicator flag", + "ERR_BLAKE2F_FINAL_FLAG", ))) )); diff --git a/src/precompiles/bn128.rs b/src/precompiles/bn128.rs index a42ccaf25..83f703288 100644 --- a/src/precompiles/bn128.rs +++ b/src/precompiles/bn128.rs @@ -421,7 +421,7 @@ mod tests { let res = BN128Add::::run(&input, 500, &new_context()); assert!(matches!( res, - Err(ExitError::Other(Borrowed("invalid curve point"))) + Err(ExitError::Other(Borrowed("ERR_BN128_INVALID_POINT"))) )); } @@ -503,7 +503,7 @@ mod tests { let res = BN128Mul::::run(&input, 40_000, &new_context()); assert!(matches!( res, - Err(ExitError::Other(Borrowed("invalid curve point"))) + Err(ExitError::Other(Borrowed("ERR_BN128_INVALID_POINT"))) )); } @@ -580,9 +580,7 @@ mod tests { let res = BN128Pair::::run(&input, 260_000, &new_context()); assert!(matches!( res, - Err(ExitError::Other(Borrowed( - "invalid `a` argument, not on curve" - ))) + Err(ExitError::Other(Borrowed("ERR_BN128_INVALID_A"))) )); // invalid input length @@ -598,9 +596,7 @@ mod tests { let res = BN128Pair::::run(&input, 260_000, &new_context()); assert!(matches!( res, - Err(ExitError::Other(Borrowed( - "input length invalid, must be multiple of 192", - ))) + Err(ExitError::Other(Borrowed("ERR_BN128_INVALID_LEN",))) )); } } diff --git a/src/prelude.rs b/src/prelude.rs index e2c36df92..a81da0d5d 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -15,8 +15,7 @@ pub use core::{convert::TryInto, marker::PhantomData, mem}; #[cfg(feature = "std")] pub use std::{ borrow::Cow::Borrowed, borrow::ToOwned, boxed::Box, collections::HashMap, convert::TryInto, - error::Error, fmt, marker::PhantomData, mem, string::String, string::ToString, vec, - vec::Vec, + error::Error, fmt, marker::PhantomData, mem, string::String, string::ToString, vec, vec::Vec, }; pub use primitive_types::{H160, H256, U256};