MCPcopy Create free account
hub / github.com/PacktPublishing/Rust-for-Blockchain-Application-Development / new

Method new

chapter 5/wallets.rs:16–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14impl Wallet {
15
16 pub fn new() -> Wallet {
17 let pkcs8 = crate::new_key_pair();
18 let key_pair =
19 EcdsaKeyPair::from_pkcs8(&ECDSA_P256_SHA256_FIXED_SIGNING, pkcs8.as_ref()).unwrap();
20 let public_key = key_pair.public_key().as_ref().to_vec();
21 Wallet { pkcs8, public_key }
22 }
23
24
25 pub fn get_address(&self) -> String {

Callers

nothing calls this directly

Calls 2

new_key_pairFunction · 0.70
load_from_fileMethod · 0.45

Tested by

no test coverage detected