Skip to content

Commit

Permalink
fix: change precondition of A6 VC value true to require total followe…
Browse files Browse the repository at this point in the history
…rs to be greater than 0 (#2810)

Co-authored-by: higherordertech <higherordertech>
Co-authored-by: Kai <[email protected]>
  • Loading branch information
higherordertech and Kailai-Wang authored Jun 15, 2024
1 parent be5aa82 commit 2b30554
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tee-worker/litentry/core/assertion-build/src/a6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub fn build(
match Credential::new(&req.who, &req.shard, &runtime_version) {
Ok(mut credential_unsigned) => {
credential_unsigned.add_subject_info(VC_A6_SUBJECT_DESCRIPTION, VC_A6_SUBJECT_TYPE);
credential_unsigned.add_assertion_a6(min, max);
credential_unsigned.add_assertion_a6(sum > 0, min, max);

Ok(credential_unsigned)
},
Expand Down
4 changes: 2 additions & 2 deletions tee-worker/litentry/core/credentials/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ impl Credential {
self.credential_subject.values.push(value);
}

pub fn add_assertion_a6(&mut self, min: u32, max: u32) {
pub fn add_assertion_a6(&mut self, value: bool, min: u32, max: u32) {
let min = format!("{}", min);
let max = format!("{}", max);

Expand All @@ -441,7 +441,7 @@ impl Credential {

let assertion = AssertionLogic::new_and().add_item(follower_min).add_item(follower_max);
self.credential_subject.assertions.push(assertion);
self.credential_subject.values.push(true);
self.credential_subject.values.push(value);
}

pub fn add_assertion_a8(&mut self, networks: Vec<Web3Network>, min: u64, max: u64) {
Expand Down

0 comments on commit 2b30554

Please sign in to comment.