[descriptors] Transform a descriptor into its "public" version

This commit is contained in:
Alekos Filini committed 2020-05-10 17:46:54 +02:00
1 parent 0e432f3b26
commit c1b01e4d8c
6 files changed
+267 -106

No files matched your search

+11
View File
@@ -496,6 +496,17 @@ where
}
}
pub fn public_descriptor(
&self,
script_type: ScriptType,
) -> Result<Option<ExtendedDescriptor>, Error> {
match (script_type, self.change_descriptor.as_ref()) {
(ScriptType::External, _) => Ok(Some(self.descriptor.as_public_version()?)),
(ScriptType::Internal, None) => Ok(None),
(ScriptType::Internal, Some(desc)) => Ok(Some(desc.as_public_version()?)),
}
}
// Internals
#[cfg(not(target_arch = "wasm32"))]