MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / from

Method from

utils/src/crypto.rs:23–31  ·  view source on GitHub ↗
(value: RecoverableSignature)

Source from the content-addressed store, hash-verified

21
22impl From<RecoverableSignature> for Signature {
23 fn from(value: RecoverableSignature) -> Self {
24 let (recovery_id, signature) = value.serialize_compact();
25
26 let v = recovery_id.to_i32() as u64;
27 let r = H256::from_slice(&signature[..32]);
28 let s = H256::from_slice(&signature[32..]);
29
30 Signature { v, r, s }
31 }
32}
33
34impl TryInto<RecoverableSignature> for Signature {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected