diff --git a/src/__tests__/ceramic_state_store.ts b/src/__tests__/ceramic_state_store.ts index eada465..d3c21bd 100644 --- a/src/__tests__/ceramic_state_store.ts +++ b/src/__tests__/ceramic_state_store.ts @@ -2,7 +2,7 @@ * @jest-environment ./build/index.js */ -import { StreamReaderWriter } from '@ceramicnetwork/common' +import { Ceramic } from '@ceramicnetwork/core' import { StreamID } from '@ceramicnetwork/streamid' import { TileDocument } from '@ceramicnetwork/stream-tile' import { delay, restartCeramic } from '../utils.js' @@ -10,10 +10,10 @@ import { config } from 'node-config-ts' import { jest } from '@jest/globals' declare global { - let ceramic: StreamReaderWriter + let ceramic: Ceramic } -const isPinned = async (ceramic: StreamReaderWriter, streamId: StreamID): Promise => { +const isPinned = async (ceramic: Ceramic, streamId: StreamID): Promise => { const pinnedStreamsIterator = await ceramic.admin.pin.ls(streamId) const pinnedStreamIds = [] for await (const id of pinnedStreamsIterator) { diff --git a/src/__tests__/indexing.ts b/src/__tests__/indexing.ts index 01074c5..c560108 100644 --- a/src/__tests__/indexing.ts +++ b/src/__tests__/indexing.ts @@ -2,7 +2,8 @@ * @jest-environment ./build/index.js */ import { jest } from '@jest/globals' -import { StreamReaderWriter, Page, StreamState, StreamUtils } from '@ceramicnetwork/common' +import { Page, StreamState, StreamUtils } from '@ceramicnetwork/common' +import { Ceramic } from '@ceramicnetwork/core' import { CommonTestUtils as TestUtils } from '@ceramicnetwork/common-test-utils' import { ModelInstanceDocument } from '@ceramicnetwork/stream-model-instance' import { StreamID } from '@ceramicnetwork/streamid' @@ -17,8 +18,8 @@ const DATA2 = { data: 444 } const DATA3 = { data: 555 } declare global { - const ceramic: StreamReaderWriter - const ceramicClient: StreamReaderWriter + const ceramic: Ceramic + const ceramicClient: Ceramic } const extractStreamStates = (page: Page): Array => { @@ -32,7 +33,7 @@ const extractStreamStates = (page: Page): Array } const extractDocuments = ( - ceramic: StreamReaderWriter, + ceramic: Ceramic, page: Page ): Array => { return extractStreamStates(page).map(state => @@ -41,7 +42,7 @@ const extractDocuments = ( } const waitForMidsToBeIndexed = async ( - ceramic: StreamReaderWriter, + ceramic: Ceramic, docs: ModelInstanceDocument[] ): Promise => { await firstValueFrom( @@ -108,7 +109,7 @@ describe('indexing', () => { if (singleNodeTestCases.length > 0) { test.each(singleNodeTestCases)( 'Can create and query on same node -- %s', - async (_, ceramicInstance: StreamReaderWriter) => { + async (_, ceramicInstance: Ceramic) => { console.info('running test: Can create and query on same node') const doc1 = await ModelInstanceDocument.create( @@ -176,7 +177,7 @@ describe('indexing', () => { test.each(singleNodeTestCases)( 'Can filter by DID -- %s', - async (_, ceramicInstance: StreamReaderWriter) => { + async (_, ceramicInstance: Ceramic) => { console.info('running test: Can filter by DID') const did1 = originalDid @@ -239,7 +240,7 @@ describe('indexing', () => { if (twoNodesTestCases.length > 0) { test.each(twoNodesTestCases)( 'Can create and query across nodes -- %s', - async (_, ceramic1: CeramicApi, ceramic2: StreamReaderWriter) => { + async (_, ceramic1: Ceramic, ceramic2: Ceramic) => { console.info('running test: Can create and query across nodes') const doc = await ModelInstanceDocument.create( @@ -268,7 +269,7 @@ describe('indexing', () => { expect(loadedDoc.content).toEqual(doc.content) // Indexed streams should always get pinned, regardless of the 'pin' flag - await expect(TestUtils.isPinned(ceramic2, doc.id)).toBeTruthy() + await expect(TestUtils.isPinned(ceramic2.admin, doc.id)).toBeTruthy() await expect( ceramic2.index.count({ model: TEST_MODEL.toString() })