Skip to content

Commit

Permalink
fix: change wallet type on sign hash
Browse files Browse the repository at this point in the history
  • Loading branch information
mektigboy committed Jan 27, 2024
1 parent f79129b commit 733b4a9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/signature/create_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,12 @@ fn sign_typed_data<T: Eip712>(payload: &T, wallet: &LocalWallet) -> Result<Signa
let encoded = payload
.encode_eip712()
.map_err(|e| Error::Eip712(e.to_string()))?;
let signature = sign_hash(H256::from(encoded), wallet)?;
let signature: Signature = sign_hash(H256::from(encoded), &wallet)?;

Ok(signature)
}

fn sign_hash<D>(hash: H256, wallet: &Wallet<D>) -> Result<Signature>
where
D: PrehashSigner<(RecoverableSignature, RecoveryId)>,
{
fn sign_hash(hash: H256, wallet: &LocalWallet) -> Result<Signature> {
let (recoverable_sig, recovery_id) = wallet
.signer()
.sign_prehash(hash.as_ref())
Expand Down

0 comments on commit 733b4a9

Please sign in to comment.