diff --git a/packages/agent/src/store-data.ts b/packages/agent/src/store-data.ts index 78d86d0f1..59563d0a6 100644 --- a/packages/agent/src/store-data.ts +++ b/packages/agent/src/store-data.ts @@ -34,8 +34,6 @@ export type DataStoreDeleteParams = DataStoreTenantParams & { } export interface AgentDataStore { - initialize({ tenant, agent }: DataStoreTenantParams): Promise; - delete(params: DataStoreDeleteParams): Promise; get(params: DataStoreGetParams): Promise; diff --git a/packages/agent/tests/store-data.spec.ts b/packages/agent/tests/store-data.spec.ts index b8ca04d31..571f0a633 100644 --- a/packages/agent/tests/store-data.spec.ts +++ b/packages/agent/tests/store-data.spec.ts @@ -424,7 +424,7 @@ describe('AgentDataStore', () => { const didBytes = Convert.string(new Array(102400 + 1).join('0')).toUint8Array(); // since we are writing directly to the dwn we first initialize the storage protocol - await testStore.initialize({ agent: testHarness.agent }); + await (testStore as DwnDataStore)['initialize']({ agent: testHarness.agent }); // Store the DID in the DWN. const response = await testHarness.agent.dwn.processRequest({ @@ -581,8 +581,8 @@ describe('AgentDataStore', () => { // Skip this test for InMemoryTestStore, as it is only relevant for the DWN store. if (TestStore.name === 'InMemoryTestStore') this.skip(); - // have the protocol installed before dwn api stub - await testStore.initialize({ agent: testHarness.agent }); + // since we are writing directly to the dwn we first initialize the storage protocol + await (testStore as DwnDataStore)['initialize']({ agent: testHarness.agent }); // Stub the DWN API to return a failed response. const dwnApiStub = sinon.stub(testHarness.agent.dwn, 'processRequest').resolves({ diff --git a/packages/agent/tests/store-did.spec.ts b/packages/agent/tests/store-did.spec.ts index f224ca8e1..aa93c104a 100644 --- a/packages/agent/tests/store-did.spec.ts +++ b/packages/agent/tests/store-did.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { Convert } from '@web5/common'; import { DidJwk, PortableDid } from '@web5/dids'; -import type { AgentDataStore } from '../src/store-data.js'; +import type { AgentDataStore, DwnDataStore } from '../src/store-data.js'; import { AgentDidApi } from '../src/did-api.js'; import { TestAgent } from './utils/test-agent.js'; @@ -211,7 +211,7 @@ describe('DidStore', () => { const didBytes = Convert.string(new Array(102400 + 1).join('0')).toUint8Array(); // since we are writing directly to the dwn we first initialize the storage protocol - await didStore.initialize({ agent: testHarness.agent }); + await (didStore as DwnDataStore)['initialize']({ agent: testHarness.agent }); // Store the DID in the DWN. const response = await testHarness.agent.dwn.processRequest({ diff --git a/packages/agent/tests/store-identity.spec.ts b/packages/agent/tests/store-identity.spec.ts index 7305521bd..13ddd13ca 100644 --- a/packages/agent/tests/store-identity.spec.ts +++ b/packages/agent/tests/store-identity.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { DidJwk } from '@web5/dids'; import { Convert } from '@web5/common'; -import type { AgentDataStore } from '../src/store-data.js'; +import type { AgentDataStore, DwnDataStore } from '../src/store-data.js'; import type { IdentityMetadata } from '../src/types/identity.js'; import { TestAgent } from './utils/test-agent.js'; @@ -200,9 +200,8 @@ describe('IdentityStore', () => { // regardless of the size of the data. if (IdentityStore.name === 'InMemoryIdentityStore') this.skip(); - // since we are testing by issuing a RecordsWrite directly to the DWN without the `identityStore` abstraction, - // we need to ensure the AgentStore protocol is initialized. - await identityStore.initialize({ agent: testHarness.agent }); + // since we are writing directly to the dwn we first initialize the storage protocol + await (identityStore as DwnDataStore)['initialize']({ agent: testHarness.agent }); const identityBytes = Convert.string(new Array(102400 + 1).join('0')).toUint8Array(); diff --git a/packages/agent/tests/store-key.spec.ts b/packages/agent/tests/store-key.spec.ts index 366ab9e6a..5d166ca26 100644 --- a/packages/agent/tests/store-key.spec.ts +++ b/packages/agent/tests/store-key.spec.ts @@ -3,7 +3,7 @@ import type { Jwk } from '@web5/crypto'; import { expect } from 'chai'; import { Convert } from '@web5/common'; -import type { AgentDataStore } from '../src/store-data.js'; +import type { AgentDataStore, DwnDataStore } from '../src/store-data.js'; import { TestAgent } from './utils/test-agent.js'; import { DwnInterface } from '../src/types/dwn.js'; @@ -133,7 +133,7 @@ describe('KeyStore', () => { const keyBytes = Convert.string(new Array(102400 + 1).join('0')).toUint8Array(); // since we are writing directly to the dwn we first initialize the storage protocol - await keyStore.initialize({ agent: testHarness.agent }); + await (keyStore as DwnDataStore)['initialize']({ agent: testHarness.agent }); // Store the DID in the DWN. const response = await testHarness.agent.dwn.processRequest({