Skip to content

Commit

Permalink
fixing range proofs bound check
Browse files Browse the repository at this point in the history
  • Loading branch information
maycon-mello committed Oct 9, 2023
1 parent c5f9d35 commit 7dca014
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/wasm/src/services/credential/bound-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ describe('Bound check', () => {
it('expect to create bound check for minimum date', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
dateEarned: '1999-01-01T00:00:00.000Z',
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.dateEarned'],
Expand Down Expand Up @@ -115,6 +120,11 @@ describe('Bound check', () => {
it('expect to create bound check for maximum date', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
dateEarned: '1999-01-01T00:00:00.000Z',
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.dateEarned'],
Expand Down Expand Up @@ -149,6 +159,9 @@ describe('Bound check', () => {
it('expect to create bound check for maximum date and minimum', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
expirationDate: '2023-06-01T00:00:00.000Z',
}],
proofRequest: createProofRequest([
{
path: ['$.expirationDate'],
Expand Down Expand Up @@ -184,6 +197,11 @@ describe('Bound check', () => {
it('expect to create bound check for maximum number', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
income: 20000,
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.income'],
Expand Down Expand Up @@ -216,6 +234,11 @@ describe('Bound check', () => {
it('expect to create bound check for minimum number', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
income: 20000,
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.income'],
Expand Down Expand Up @@ -248,6 +271,11 @@ describe('Bound check', () => {
it('expect to create bound check for minimum and maximum number', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
income: 20000,
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.income'],
Expand Down Expand Up @@ -281,6 +309,11 @@ describe('Bound check', () => {
it('expect to use proving key only on first enforce bounds call', () => {
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
dateEarned: '1999-01-01T00:00:00.000Z',
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.dateEarned'],
Expand Down Expand Up @@ -313,6 +346,11 @@ describe('Bound check', () => {
expect(() =>
applyEnforceBounds({
builder,
selectedCredentials: [{
credentialSubject: {
income: 20000,
},
}],
proofRequest: createProofRequest([
{
path: ['$.credentialSubject.income'],
Expand Down

0 comments on commit 7dca014

Please sign in to comment.