Skip to content

Commit

Permalink
Added method to retrieve predicates from sub_proof
Browse files Browse the repository at this point in the history
Signed-off-by: artem.ivanov <artem.ivanov@dsr-corporation.com>
  • Loading branch information
Artemkaaas authored and swcurran committed Jan 15, 2024
1 parent b66dde9 commit cad502f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,9 +1185,9 @@ impl SubProofRequestBuilder {
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Predicate {
pub(crate) attr_name: String,
pub(crate) p_type: PredicateType,
pub(crate) value: i32,
pub attr_name: String,
pub p_type: PredicateType,
pub value: i32,
}

impl Predicate {
Expand Down Expand Up @@ -1253,6 +1253,14 @@ impl SubProof {
}
Ok(res)
}

pub fn predicates(&self) -> Vec<Predicate> {
self.primary_proof
.ne_proofs
.iter()
.map(|proof| proof.predicate.clone())
.collect()
}
}

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
Expand Down

0 comments on commit cad502f

Please sign in to comment.