From 8d2c34b13b8cec5d6fd948424aa1c51015af7202 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Tue, 4 Mar 2025 14:47:50 +0100 Subject: [PATCH] Refactor handling of prd update --- src/api.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/api.rs b/src/api.rs index 686ad75..ecbd42e 100644 --- a/src/api.rs +++ b/src/api.rs @@ -878,26 +878,13 @@ fn handle_prd( let commited_in = relevant_process.get_process_tip()?; - // Extract the roles from the payload - let proposal_roles: BTreeMap = serde_json::from_str(&prd.payload)?; - - // TODO: check that the role in the prd has the right commitment - - // TODO: now that roles is not part of the pcd anymore, we need to think of a way to secure it - // Take the roles from the last validated state - let mut roles = if let Some(last_state) = relevant_process.get_latest_commited_state() { - last_state.roles.clone() - } else { - // We don't have commited state yet, let's take the current roles - proposal_roles - }; - let new_state = ProcessState { commited_in, pcd_commitment: prd.pcd_commitments, state_id: update_merkle_root.clone(), keys: prd.keys, - roles, + roles: prd.roles, + public_data: prd.public_data, ..Default::default() };