From a0f2b97c33f3201c20e76a5084451d31fb47378f Mon Sep 17 00:00:00 2001 From: kirahsapong <102400653+kirahsapong@users.noreply.github.com> Date: Tue, 23 Apr 2024 18:06:10 -0700 Subject: [PATCH] Updated ProtocolAuthorizationParentlessIncorrectProtocolPath error message to include reference to just `parent` (#724) --- src/core/protocol-authorization.ts | 2 +- tests/handlers/records-write.spec.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/protocol-authorization.ts b/src/core/protocol-authorization.ts index 4b5a629f6..bcc529f74 100644 --- a/src/core/protocol-authorization.ts +++ b/src/core/protocol-authorization.ts @@ -357,7 +357,7 @@ export class ProtocolAuthorization { if (declaredProtocolPath !== declaredTypeName) { throw new DwnError( DwnErrorCode.ProtocolAuthorizationParentlessIncorrectProtocolPath, - `Declared protocol path '${declaredProtocolPath}' is not valid for records with no parentId'.` + `Declared protocol path '${declaredProtocolPath}' is not valid for records with no parent'.` ); } diff --git a/tests/handlers/records-write.spec.ts b/tests/handlers/records-write.spec.ts index 860ad4f4d..c30b37af1 100644 --- a/tests/handlers/records-write.spec.ts +++ b/tests/handlers/records-write.spec.ts @@ -2479,6 +2479,7 @@ export function testRecordsWriteHandler(): void { const reply = await dwn.processMessage(alice.did, credentialApplication.message, { dataStream: credentialApplication.dataStream }); expect(reply.status.code).to.equal(400); expect(reply.status.detail).to.contain(DwnErrorCode.ProtocolAuthorizationParentlessIncorrectProtocolPath); + expect(reply.status.detail).to.contain('is not valid for records with no parent'); }); it('#690 - should only allow data format of a protocol-space record to be updated to any value allowed by the protocol configuration', async () => {