Rm list_modified_states
This commit is contained in:
parent
0ecf627bf8
commit
614849db78
@ -73,31 +73,6 @@ impl ProcessState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn list_modified_fields(&self, previous_state: Option<&ProcessState>) -> Vec<String> {
|
|
||||||
let new_state = &self.pcd_commitment;
|
|
||||||
|
|
||||||
if let Some(prev_state) = previous_state {
|
|
||||||
// Previous state exists; compute differences
|
|
||||||
let previous_state_commitments = &prev_state.pcd_commitment;
|
|
||||||
|
|
||||||
// Compute modified fields by comparing with previous state
|
|
||||||
new_state
|
|
||||||
.iter()
|
|
||||||
.filter_map(|(key, value)| {
|
|
||||||
let previous_value = previous_state_commitments.get(key);
|
|
||||||
if previous_value.is_none() || value != previous_value.unwrap() {
|
|
||||||
Some(key.clone())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect()
|
|
||||||
} else {
|
|
||||||
// No previous state; all fields are considered modified
|
|
||||||
new_state.keys()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This is a simplified and streamlined validation for obliteration state
|
/// This is a simplified and streamlined validation for obliteration state
|
||||||
fn handle_obliteration(&self, members_list: &OutPointMemberMap) -> anyhow::Result<()> {
|
fn handle_obliteration(&self, members_list: &OutPointMemberMap) -> anyhow::Result<()> {
|
||||||
// We need an Apophis role
|
// We need an Apophis role
|
||||||
|
Loading…
x
Reference in New Issue
Block a user