All Prd constructors takes sender as a Member

This commit is contained in:
NicolasCantu 2025-01-02 13:50:44 +01:00 committed by Nicolas Cantu
parent 6365c2ccdd
commit 618b976339

View File

@ -87,7 +87,7 @@ impl Prd {
pub fn new_update(
root_commitment: OutPoint,
sender: String, // Should take Member as argument
sender: Member,
roles: HashMap<String, RoleDefinition>,
keys: Map<String, Value>,
pcd_commitments: Value,
@ -95,7 +95,7 @@ impl Prd {
Self {
prd_type: PrdType::Update,
root_commitment: root_commitment.to_string(),
sender,
sender: serde_json::to_string(&sender).unwrap(),
validation_tokens: vec![],
keys,
pcd_commitments,
@ -106,14 +106,14 @@ impl Prd {
pub fn new_response(
root_commitment: OutPoint,
sender: String,
sender: Member,
validation_tokens: Vec<Proof>,
pcd_commitments: Value,
) -> Self {
Self {
prd_type: PrdType::Response,
root_commitment: root_commitment.to_string(),
sender,
sender: serde_json::to_string(&sender).unwrap(),
validation_tokens: validation_tokens,
keys: Map::new(),
pcd_commitments,