Skip to content

Commit

Permalink
chore(did-provider-pkh): apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis authored Feb 7, 2023
1 parent 6a08e73 commit 4dd14b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/did-provider-pkh/src/pkh-did-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { AbstractIdentifierProvider } from '@veramo/did-manager';
import Debug from 'debug'

const debug = Debug('veramo:data-store:migrate-presentation-issuance-date')
const debug = Debug('veramo:pkh-did-provider')

type IContext = IAgentContext<IKeyManager>;

Expand Down Expand Up @@ -103,7 +103,7 @@ export class PkhDIDProvider extends AbstractIdentifierProvider {
return identifier;
} else {
debug('Could not create identifier due to some errors');
throw new Error('Could not create identifier due to some errors');
throw new Error('unknown_error: could not create identifier due to errors creating or importing keys');
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/did-provider-pkh/src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import type {
ResolverRegistry,
} from 'did-resolver';
import { isValidNamespace, SECPK1_NAMESPACES } from './pkh-did-provider';
import Debug from 'debug'

const debug = Debug('veramo:pkh-did-resolver')
const DID_LD_JSON = 'application/did+ld+json';
const DID_JSON = 'application/did+json';

Expand Down Expand Up @@ -37,7 +39,7 @@ function toDidDoc(did: string, blockchainAccountId: string): any {
assertionMethod: [vmId],
};
if (!isValidNamespace(namespace)) {
console.error(
debug(
`Invalid namespace '${namespace}'. Valid namespaces are: ${SECPK1_NAMESPACES}`
);
throw new Error(
Expand Down

0 comments on commit 4dd14b9

Please sign in to comment.