diff --git a/src/commit.rs b/src/commit.rs index 69520fd..559a980 100644 --- a/src/commit.rs +++ b/src/commit.rs @@ -232,7 +232,14 @@ fn register_new_state(process: &mut Process, commit_msg: &CommitMessage) -> Resu // Process validation for a state with validation tokens fn process_validation(updated_process: &mut Process, commit_msg: &CommitMessage) -> Result { - let new_state_id = commit_msg.pcd_commitment.create_merkle_tree()?.root().ok_or(Error::msg("Invalid merkle tree"))?; + let new_state_id = if commit_msg.pcd_commitment.is_empty() { + // We're dealing with an obliteration attempt + [0u8; 32] + } + else { + commit_msg.pcd_commitment.create_merkle_tree()?.root().ok_or(Error::msg("Invalid merkle tree"))? + }; + { let state_to_update = updated_process .get_state_for_id_mut(&new_state_id)?;