Various minor fixes
This commit is contained in:
parent
029bd6be32
commit
401cc35fe7
@ -5,12 +5,11 @@ use std::{
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Map, Value};
|
||||
use sp_client::bitcoin::{hex::DisplayHex, OutPoint};
|
||||
use sp_client::bitcoin::{hex::{DisplayHex, FromHex}, OutPoint};
|
||||
use tsify::Tsify;
|
||||
|
||||
use crate::{
|
||||
pcd::{Member, Pcd, RoleDefinition},
|
||||
prd::{Prd, PrdType},
|
||||
signature::{AnkHash, AnkValidationNoHash, AnkValidationYesHash, Proof},
|
||||
MutexExt,
|
||||
};
|
||||
@ -160,7 +159,6 @@ impl ProcessState {
|
||||
|
||||
let mut fields2plains = Map::new();
|
||||
let fields2commit = self.pcd_commitment.as_object().ok_or(anyhow::Error::msg("pcd_commitment is not an object"))?;
|
||||
let merkle_root = Value::Object(fields2commit.clone()).create_merkle_tree()?.root().unwrap();
|
||||
self.encrypted_pcd
|
||||
.decrypt_all(self.commited_in, &fields2commit, &self.keys, &mut fields2plains)?;
|
||||
|
||||
@ -188,6 +186,9 @@ impl ProcessState {
|
||||
return false; // No rules apply to this field, consider it invalid
|
||||
}
|
||||
|
||||
let mut merkle_root = [0u8; 32];
|
||||
merkle_root.copy_from_slice(&Vec::from_hex(&self.merkle_root).unwrap());
|
||||
|
||||
applicable_roles.into_iter().any(|role_def| {
|
||||
role_def.validation_rules.iter().any(|rule| {
|
||||
rule.is_satisfied(
|
||||
|
Loading…
x
Reference in New Issue
Block a user