Skip to content

Commit

Permalink
fix(claim): fix claim service issuance interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Harasz committed May 4, 2022
1 parent a648832 commit 4c32a26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Expand Up @@ -58,7 +58,7 @@ ___

### subjectAgreement

**subjectAgreement**: `string`
`Optional` **subjectAgreement**: `string`

Subject agreement signature

Expand Down
1 change: 1 addition & 0 deletions src/errors/error-messages.ts
Expand Up @@ -27,4 +27,5 @@ export enum ERROR_MESSAGES {
IS_ETH_SIGNER_NOT_SET = 'Can not determine if signer is conformant with eth_sign specification',
SIGN_TYPED_DATA_NOT_SUPPORTED = 'Sign typed data not supported',
CLAIM_TYPE_MISSING = 'Claim type is required for On-chain registration',
ONCHAIN_ROLE_SUBJECT_AGREEMENT_NOT_SPECIFIED = 'On-chain role subject agreement not specified',
}
5 changes: 5 additions & 0 deletions src/modules/claims/claims.service.ts
Expand Up @@ -364,6 +364,11 @@ export class ClaimsService {
expiry,
sub
);
if (!subjectAgreement) {
throw new Error(
ERROR_MESSAGES.ONCHAIN_ROLE_SUBJECT_AGREEMENT_NOT_SPECIFIED
);
}
message.onChainProof = onChainProof;
if (publishOnChain) {
await this.registerOnchain({
Expand Down
2 changes: 1 addition & 1 deletion src/modules/claims/claims.types.ts
Expand Up @@ -164,7 +164,7 @@ export interface IssueClaimRequestOptions {
id: string;

/** Subject agreement signature */
subjectAgreement: string;
subjectAgreement?: string;

/** Registration types */
registrationTypes: RegistrationTypes[];
Expand Down

0 comments on commit 4c32a26

Please sign in to comment.