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

Method lock

chapter 5/transactions.rs:75–79  ·  view source on GitHub ↗
(&mut self, address: &str)

Source from the content-addressed store, hash-verified

73 }
74
75 fn lock(&mut self, address: &str) {
76 let payload = base58_decode(address);
77 let pub_key_hash = payload[1..payload.len() - wallet::ADDRESS_CHECK_SUM_LEN].to_vec();
78 self.pub_key_hash = pub_key_hash;
79 }
80
81 pub fn is_locked_with_key(&self, pub_key_hash: &[u8]) -> bool {
82 self.pub_key_hash.eq(pub_key_hash)

Callers 1

newMethod · 0.45

Calls 2

base58_decodeFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected