Skip to content

Commit

Permalink
fix formatting (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: Harold Carr <[email protected]>
  • Loading branch information
haroldcarr authored Jul 18, 2024
1 parent aafa76b commit 35eec28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 8 additions & 3 deletions src/presentation/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,18 @@ impl<'a> RangeBuilder<'a> {
return Err(Error::InvalidPresentationData);
}
{
let lower = match statement.lower { Some(lower) => lower, None=> isize::MIN};
let upper = match statement.upper { Some(upper) => upper, None=> isize::MAX};
let lower = match statement.lower {
Some(lower) => lower,
None => isize::MIN,
};
let upper = match statement.upper {
Some(upper) => upper,
None => isize::MAX,
};
if message < lower || message > upper {
return Err(Error::InvalidPresentationData);
}
}

transcript.append_message(b"", statement.id.as_bytes());
transcript.append_message(
b"used commitment",
Expand Down
8 changes: 3 additions & 5 deletions tests/out-of-range-panic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use blsful::inner_types::*;
use credx::claim::{
ClaimType, NumberClaim, RevocationClaim,
};
use credx::error;
use credx::claim::{ClaimType, NumberClaim, RevocationClaim};
use credx::credential::{ClaimSchema, CredentialSchema};
use credx::error;
use credx::prelude::Issuer;
use credx::presentation::{Presentation, PresentationSchema};
use credx::statement::{
Expand Down Expand Up @@ -85,7 +83,7 @@ fn test_out_of_range_panic() -> CredxResult<()> {
signature_id: sig_st.id.clone(),
claim: 1,
lower: Some(0),
upper: Some(3), // SIGNED VALUE OF 5 IS OUT OF THE REQUESTED RANGE
upper: Some(3), // SIGNED VALUE OF 5 IS OUT OF THE REQUESTED RANGE
};

let credentials = indexmap! { sig_st.id.clone() => credential.credential.into() };
Expand Down

0 comments on commit 35eec28

Please sign in to comment.