Add public_data to CommitMsg

This commit is contained in:
NicolasCantu 2025-03-03 23:19:32 +01:00
parent 131ee8c55b
commit dc77482cc6

View File

@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::BTreeMap;
use anyhow::Result;
use rand::{thread_rng, RngCore};
@ -75,7 +75,8 @@ impl AnkFlag {
pub struct CommitMessage {
pub process_id: OutPoint,
pub pcd_commitment: Value, // map of field <=> hash of the clear value
pub roles: HashMap<String, RoleDefinition>, // Can be hashed and compared with the value above
pub roles: BTreeMap<String, RoleDefinition>,
pub public_data: BTreeMap<String, String>,
pub validation_tokens: Vec<Proof>,
pub error: Option<AnkError>,
}
@ -86,12 +87,14 @@ impl CommitMessage {
pub fn new_update_commitment(
process_id: OutPoint,
pcd_commitment: Value,
roles: HashMap<String, RoleDefinition>,
roles: BTreeMap<String, RoleDefinition>,
public_data: BTreeMap<String, String>,
) -> Self {
Self {
process_id,
pcd_commitment,
roles,
public_data,
validation_tokens: vec![],
error: None,
}