server: snapshot

This commit is contained in:
nym21
2025-12-15 17:33:49 +01:00
parent 825a4a77c0
commit 692a1889ab
8 changed files with 242 additions and 183 deletions

View File

@@ -32,17 +32,20 @@ impl Query {
return Err(Error::InvalidAddress);
};
dbg!(&script);
let outputtype = OutputType::from(&script);
dbg!(outputtype);
let Ok(bytes) = AddressBytes::try_from((&script, outputtype)) else {
return Err(Error::Str("Failed to convert the address to bytes"));
};
let addresstype = outputtype;
let hash = AddressHash::from(&bytes);
dbg!(hash);
let Ok(Some(type_index)) = stores
.addresstype_to_addresshash_to_addressindex
.get(addresstype)
.unwrap()
.get_unwrap(addresstype)
.get(&hash)
.map(|opt| opt.map(|cow| cow.into_owned()))
else {