From 8112e3e9d8d10da32eb16834d68a71d854a56bda Mon Sep 17 00:00:00 2001 From: Golda Velez Date: Mon, 23 Oct 2023 20:41:18 -0700 Subject: [PATCH] actually model is deserialized as a StreamID --- .../__tests__/anchor-request-params-parser.test.ts | 6 +++--- src/services/request-service.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ancillary/__tests__/anchor-request-params-parser.test.ts b/src/ancillary/__tests__/anchor-request-params-parser.test.ts index 16bb243d4..7bd308cdc 100644 --- a/src/ancillary/__tests__/anchor-request-params-parser.test.ts +++ b/src/ancillary/__tests__/anchor-request-params-parser.test.ts @@ -29,7 +29,7 @@ const TIMESTAMP_ISO = '2023-01-25T17:32:42.971Z' const FAKE_CACAO='test' // the p.domain of the cacao in our test blob -const FAKE_MODEL_CID='bagcqceraep7zornjx4ltk546kpldcxoyr2wdhlgt66k6xmpd6fr2mn37wazq' +const FAKE_MODEL='kjzl6hvfrbw6c5ws6n17gx7zgb6veprsbb0b2m1x7x026rorhhu0mtuqz4d5zjn' const LEGACY_REQUEST_EXAMPLE = mockRequest({ headers: { @@ -127,7 +127,7 @@ describe('AnchoRequestParamsParser', () => { const params: RequestAnchorParams = (validation as Right).right expect(params.cacaoDomain).toEqual(FAKE_CACAO) - expect((params as RequestAnchorParamsV2).genesisFields.model._cid.toString()).toEqual('') + expect((params as RequestAnchorParamsV2).genesisFields.model.toString()).toEqual('') }) @@ -136,7 +136,7 @@ describe('AnchoRequestParamsParser', () => { expect(isRight(validation)).toEqual(true) const params: RequestAnchorParams = (validation as Right).right - expect(params.cacaoDomain).toEqual(FAKE_CACAO) + expect((params as RequestAnchorParamsV2).genesisFields.model.toString()).toEqual(FAKE_MODEL) }) test('isleft indicates invalid car file', () => { diff --git a/src/services/request-service.ts b/src/services/request-service.ts index f871499de..7b8913aeb 100644 --- a/src/services/request-service.ts +++ b/src/services/request-service.ts @@ -109,10 +109,10 @@ export class RequestService { did, schema: genesisFields?.schema, family: genesisFields?.family, - model: genesisFields?.model?._cid?.toString() ?? '', + model: genesisFields?.model?.toString() ?? '', stream: request.streamId, origin: request.origin, - cacao: params?.cacaoDomain || '', + cacao: 'cacaoDomain' in params ? params.cacaoDomain : '', }; Metrics.count(METRIC_NAMES.WRITE_TOTAL_TSDB, 1, logData)