From da586b6ffae312d55e1b57a20a55d94b26283f19 Mon Sep 17 00:00:00 2001 From: malik Date: Sat, 12 Oct 2024 06:53:14 +0100 Subject: [PATCH] nits --- crates/precompile/src/secp256r1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/precompile/src/secp256r1.rs b/crates/precompile/src/secp256r1.rs index e6cb505..f5b21e4 100644 --- a/crates/precompile/src/secp256r1.rs +++ b/crates/precompile/src/secp256r1.rs @@ -110,9 +110,9 @@ fn p256_verify(input: &Bytes, gas_limit: u64) -> PrecompileResult { if P256VERIFY_BASE > gas_limit { return Err(PrecompileErrors::Error(PrecompileError::OutOfGas)); } - let mut result = B256::default(); - result.0[31] = (verify_impl(input).is_some()) as u8; - Ok(PrecompileOutput::new(P256VERIFY_BASE, result.into())) + let result = verify_impl(input).is_some(); + let out = PrecompileOutput::new(P256VERIFY_BASE, B256::with_last_byte(result as u8).into()); + Ok(out) } /// Returns `Some(())` if the signature included in the input byte slice is