Skip to content

Commit

Permalink
Remove redundant string conversion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
xlassix committed Feb 11, 2025
1 parent 7a773f5 commit 63baaaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ic/libraries/src/crypto/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod tests {
let message = "hello".to_string();
let metamask_signature =
"0xc49581525ffdb136f2cbf6c2c113bce4b80c5147ac72038aef2ef5393dc3c3a8077f253152d6821396db30f8e4230cf931a0820d90fec40634af3a913e6aff5c1b".to_string();
let expected_address = "0x5c8e3a7c16fa5cdde9f74751d6b2395176f05c55";
let expected_address = "5c8e3a7c16fa5cdde9f74751d6b2395176f05c55";

let recovered_address = recover_address_from_eth_signature(
metamask_signature,
Expand Down
5 changes: 1 addition & 4 deletions ic/libraries/src/verify/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ impl ProofResponse {
ProofResponse::FullProof(text) => {
// Start of Selection
let http_parts: Vec<&str> = text.split("\n\n").filter(|s| !s.is_empty()).collect();
let response = http_parts[1].to_string();

// if empty body amd empty request is returned
if http_parts.len() == 2 {
Expand All @@ -55,9 +54,7 @@ impl ProofResponse {
}
}

let response_parts: Vec<&str> = response.split("\r\n\r\n").collect();
let http_body = response_parts[1].to_string();
http_body
http_parts[2].to_string()
}
ProofResponse::SessionProof(_) => {
panic!("Cannot extract HTTP response for session proof")
Expand Down

0 comments on commit 63baaaf

Please sign in to comment.