Skip to content

Commit

Permalink
Add legal country for set and not-set membership proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Sep 12, 2024
1 parent 48ecde2 commit a4b33c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixed

- Add `legalCountry` as allowed attribute for set/not-set memebership proofs.

## 8.0.1

### Breaking changes
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/src/id/idProofs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ function verifySetStatement(statement: MembershipStatement | NonMembershipStatem
throw new Error('idDocType values must be one from IdDocType enum');
}
break;
case AttributeKeyString.legalCountry:
if (!statement.set.every(isISO3166_1Alpha2)) {
throw new Error(statement.attributeTag + ' values must be ISO3166-1 Alpha 2 codes in upper case');
}
break;
default:
throw new Error(statement.attributeTag + ' is not allowed to be used in ' + typeName + ' statements');
}
Expand Down

0 comments on commit a4b33c6

Please sign in to comment.