Skip to content

Commit

Permalink
Fix addMinimumAge
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjort committed Sep 1, 2023
1 parent 9e0a0c8 commit bf77395
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Fixed

- Aligned credential schema types with the tested types in the browser wallet.
- `addMinimumAge` now creates the precise age statement instead of one day off.

## 9.1.1

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/idProofs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export class IdStatementBuilder implements StatementBuilder {
* @returns the updated builder
*/
addMinimumAge(age: number): IdStatementBuilder {
return this.addRange(AttributesKeys.dob, MIN_DATE, getPastDate(age));
return this.addRange(AttributesKeys.dob, MIN_DATE, getPastDate(age, 1));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/web3Proofs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export class AccountStatementBuild extends AtomicStatementBuilder {
return this.addRange(
AttributeKeyString.dob,
MIN_DATE,
getPastDate(age)
getPastDate(age, 1)
);
}

Expand Down

0 comments on commit bf77395

Please sign in to comment.