mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 07:03:56 +02:00
refactor: prefer conversion methods to infallable casts
This commit is contained in:
parent
2dea589c0e
commit
0768b0ad67
2 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ use sha3::{Digest, Keccak256};
|
|||
pub fn recover_signer(sig: &[u8; 65], root_hash: &Message) -> Result<[u8; 20]> {
|
||||
let sig = RecoverableSignature::from_compact(
|
||||
&sig[0..64],
|
||||
RecoveryId::try_from(sig[64] as i32 - 27)?,
|
||||
RecoveryId::try_from(i32::from(sig[64]) - 27)?,
|
||||
)?;
|
||||
let public = SECP256K1.recover_ecdsa(root_hash, &sig)?;
|
||||
Ok(public_key_to_ethereum_address(&public))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue