Add PcdCommitments::is_empty()

This commit is contained in:
NicolasCantu 2025-03-13 14:38:20 +01:00 committed by Nicolas Cantu
parent 875e328f36
commit 2cbbfa3eae

View File

@ -225,6 +225,10 @@ impl PcdCommitments {
Self(BTreeMap::new()) Self(BTreeMap::new())
} }
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
pub fn update_with_value(&mut self, outpoint: &OutPoint, field: &str, new_value: &Value) -> Result<()> { pub fn update_with_value(&mut self, outpoint: &OutPoint, field: &str, new_value: &Value) -> Result<()> {
let serialized_outpoint = serialize(outpoint); let serialized_outpoint = serialize(outpoint);
if let Some(old_hash) = self.get_mut(field) { if let Some(old_hash) = self.get_mut(field) {