bitcoin_key/keyorigin.rs
1crate::ix!();
2
3//-------------------------------------------[.cpp/bitcoin/src/script/keyorigin.h]
4
5#[derive(Default,Clone)]
6pub struct KeyOriginInfo {
7
8 /**
9 | First 32 bits of the Hash160 of the public
10 | key at the root of the path
11 |
12 */
13 fingerprint: [u8; 4],
14 path: Vec<u32>,
15}
16
17impl PartialEq<KeyOriginInfo> for KeyOriginInfo {
18
19 #[inline] fn eq(&self, other: &KeyOriginInfo) -> bool {
20 todo!();
21 /*
22 return std::equal(std::begin(a.fingerprint), std::end(a.fingerprint), std::begin(b.fingerprint)) && a.path == b.path;
23 */
24 }
25}
26
27impl Eq for KeyOriginInfo {}
28
29lazy_static!{
30 /*
31 SERIALIZE_METHODS(KeyOriginInfo, obj) {
32 READWRITE(obj.fingerprint, obj.path);
33 }
34 */
35}
36
37impl KeyOriginInfo {
38
39 pub fn clear(&mut self) {
40
41 let ptr = self.fingerprint.as_mut_ptr() as *mut _ as *mut libc::c_void;
42
43 unsafe { libc::memset(ptr, 0, 4) };
44
45 self.path.clear();
46 }
47}