Skip to content

Commit

Permalink
Yet another round of review comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeza committed Feb 6, 2025
1 parent b4fcf43 commit 1f00597
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/bin/zksync_tee_prover/src/tee_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ impl TeeProver {
/// Signs the message in Ethereum-compatible format for on-chain verification.
pub fn sign_message(&self, message: &H256) -> Result<Signature, TeeProverError> {
let secret_bytes = self.config.signing_key.secret_bytes();
let private_key = K256PrivateKey::from_bytes(secret_bytes.into())
.map_err(|e| TeeProverError::Verification(e.into()))?;
let private_key: K256PrivateKey = self.config.signing_key.into();
let signature =
sign(&private_key, message).map_err(|e| TeeProverError::Verification(e.into()))?;
Ok(signature)
Expand Down Expand Up @@ -223,9 +222,10 @@ mod tests {
api_client: TeeApiClient::new(Url::parse("http://mock").unwrap()),
};
let private_key: K256PrivateKey = signing_key.into();
let expected_address =
Address::from_slice(&hex::decode("627306090abaB3A6e1400e9345bC60c78a8BEf57").unwrap());
assert!(private_key.address() == expected_address);
let expected_address = "0x627306090abaB3A6e1400e9345bC60c78a8BEf57"
.parse()
.unwrap();
assert_eq!(private_key.address(), expected_address);

// Generate a random root hash, create a message from the hash, and sign the message using
// the secret key
Expand Down

0 comments on commit 1f00597

Please sign in to comment.