Modify prd update to take the roles map as payload
This commit is contained in:
parent
6ec31edc55
commit
433326f3f6
14
src/prd.rs
14
src/prd.rs
@ -1,19 +1,17 @@
|
||||
use std::collections::HashSet;
|
||||
use std::str::FromStr;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use anyhow::{Error, Result};
|
||||
use anyhow::Result;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use serde_json::{Map, Value};
|
||||
use sp_client::bitcoin::hashes::{sha256t_hash_newtype, Hash, HashEngine};
|
||||
use sp_client::bitcoin::hex::FromHex;
|
||||
use sp_client::bitcoin::secp256k1::{PublicKey, SecretKey};
|
||||
use sp_client::bitcoin::{OutPoint, Psbt};
|
||||
use sp_client::bitcoin::OutPoint;
|
||||
use sp_client::silentpayments::utils::SilentPaymentAddress;
|
||||
use sp_client::spclient::SpWallet;
|
||||
use tsify::Tsify;
|
||||
|
||||
use crate::pcd::{AnkPcdHash, Member, Pcd};
|
||||
use crate::pcd::{Member, RoleDefinition};
|
||||
use crate::signature::{AnkHash, AnkMessageHash, Proof};
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize, Tsify)]
|
||||
@ -89,7 +87,7 @@ impl Prd {
|
||||
pub fn new_update(
|
||||
root_commitment: OutPoint,
|
||||
sender: String, // Should take Member as argument
|
||||
encrypted_values_merkle_root: String,
|
||||
roles: HashMap<String, RoleDefinition>,
|
||||
keys: Map<String, Value>,
|
||||
pcd_commitments: Value,
|
||||
) -> Self {
|
||||
@ -100,7 +98,7 @@ impl Prd {
|
||||
validation_tokens: vec![],
|
||||
keys,
|
||||
pcd_commitments,
|
||||
payload: encrypted_values_merkle_root,
|
||||
payload: serde_json::to_string(&roles).expect("We're confident it's serializable"),
|
||||
proof: None,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user