Add roles to UserDiff

This commit is contained in:
NicolasCantu 2025-03-04 14:47:17 +01:00
parent d9d2bcd9d0
commit bac3e68400

View File

@ -94,6 +94,7 @@ pub struct UserDiff {
pub state_id: String, // TODO add a merkle proof that the new_value belongs to that state
pub value_commitment: String,
pub field: String,
pub roles: BTreeMap<String, RoleDefinition>,
pub description: Option<String>,
pub notify_user: bool,
pub need_validation: bool,
@ -782,6 +783,7 @@ fn create_diffs(process: &Process, new_state: &ProcessState) -> AnyhowResult<Vec
notify_user: false,
need_validation,
validation_status: DiffStatus::None,
roles: new_state.roles.clone(),
});
}
@ -1019,7 +1021,8 @@ fn handle_prd(
let mut full_prd = Prd::new_update(
outpoint,
sender,
state.roles.clone().into_iter().collect(),
state.roles.clone(),
state.public_data.clone(),
state.keys.clone(),
state.pcd_commitment.clone(),
);
@ -1514,7 +1517,8 @@ pub fn create_update_message(
let full_prd = Prd::new_update(
process_id,
sender,
update_state.roles.clone().into_iter().collect(),
update_state.roles.clone(),
update_state.public_data.clone(),
update_state.keys.clone(),
update_state.pcd_commitment.clone(),
);