Skip to content

Commit

Permalink
actually model is deserialized as a StreamID
Browse files Browse the repository at this point in the history
  • Loading branch information
gvelez17 committed Oct 24, 2023
1 parent 33189b6 commit 8112e3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ancillary/__tests__/anchor-request-params-parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('AnchoRequestParamsParser', () => {

const params: RequestAnchorParams = (validation as Right<RequestAnchorParams>).right
expect(params.cacaoDomain).toEqual(FAKE_CACAO)
expect((params as RequestAnchorParamsV2).genesisFields.model._cid.toString()).toEqual('')
expect((params as RequestAnchorParamsV2).genesisFields.model.toString()).toEqual('')
})


Expand All @@ -136,7 +136,7 @@ describe('AnchoRequestParamsParser', () => {
expect(isRight(validation)).toEqual(true)

const params: RequestAnchorParams = (validation as Right<RequestAnchorParams>).right
expect(params.cacaoDomain).toEqual(FAKE_CACAO)
expect((params as RequestAnchorParamsV2).genesisFields.model.toString()).toEqual(FAKE_MODEL)
})

test('isleft indicates invalid car file', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/services/request-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8112e3e

Please sign in to comment.