From 2cbbfa3eae65c6e3c719ec85b1a4698caaae0603 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Thu, 13 Mar 2025 14:38:20 +0100 Subject: [PATCH] Add PcdCommitments::is_empty() --- src/pcd.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pcd.rs b/src/pcd.rs index 18eb3ec..df4bd53 100644 --- a/src/pcd.rs +++ b/src/pcd.rs @@ -225,6 +225,10 @@ impl PcdCommitments { 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<()> { let serialized_outpoint = serialize(outpoint); if let Some(old_hash) = self.get_mut(field) {