Skip to content

Commit 8e306a8

Browse files
committed
Remove Sled crypto store from examples & tests
1 parent 8c7c2ae commit 8e306a8

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

examples/bot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const dmTarget = creds?.['dmTarget'] ?? "@admin:localhost";
2727
const homeserverUrl = creds?.['homeserverUrl'] ?? "http://localhost:8008";
2828
const accessToken = creds?.['accessToken'] ?? 'YOUR_TOKEN';
2929
const storage = new SimpleFsStorageProvider("./examples/storage/bot.json");
30-
const crypto = new RustSdkCryptoStorageProvider("./examples/storage/bot_sled", StoreType.Sled);
30+
const crypto = new RustSdkCryptoStorageProvider("./examples/storage/bot_sqlite", StoreType.Sqlite);
3131

3232
const client = new MatrixClient(homeserverUrl, accessToken, storage, crypto);
3333
AutojoinRoomsMixin.setupOnClient(client);

examples/encryption_appservice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ try {
3131
const dmTarget = creds?.['dmTarget'] ?? "@admin:localhost";
3232
const homeserverUrl = creds?.['homeserverUrl'] ?? "http://localhost:8008";
3333
const storage = new SimpleFsStorageProvider("./examples/storage/encryption_appservice.json");
34-
const crypto = new RustSdkAppserviceCryptoStorageProvider("./examples/storage/encryption_appservice_sled", StoreType.Sled);
34+
const crypto = new RustSdkAppserviceCryptoStorageProvider("./examples/storage/encryption_appservice_sqlite", StoreType.Sqlite);
3535
const worksImage = fs.readFileSync("./examples/static/it-works.png");
3636

3737
const registration: IAppserviceRegistration = {

examples/encryption_bot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const dmTarget = creds?.['dmTarget'] ?? "@admin:localhost";
2929
const homeserverUrl = creds?.['homeserverUrl'] ?? "http://localhost:8008";
3030
const accessToken = creds?.['accessToken'] ?? 'YOUR_TOKEN';
3131
const storage = new SimpleFsStorageProvider("./examples/storage/encryption_bot.json");
32-
const crypto = new RustSdkCryptoStorageProvider("./examples/storage/encryption_bot_sled", StoreType.Sled);
32+
const crypto = new RustSdkCryptoStorageProvider("./examples/storage/encryption_bot_sqlite", StoreType.Sqlite);
3333
const worksImage = fs.readFileSync("./examples/static/it-works.png");
3434

3535
const client = new MatrixClient(homeserverUrl, accessToken, storage, crypto);

test/MatrixClientTest.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as tmp from "tmp";
22
import * as simple from "simple-mock";
3-
import { StoreType } from "@matrix-org/matrix-sdk-crypto-nodejs";
43

54
import {
65
EventKind,
@@ -48,13 +47,13 @@ describe('MatrixClient', () => {
4847
expect(client.accessToken).toEqual(accessToken);
4948
});
5049

51-
it('should create a crypto client when requested', () => {
50+
it('should create a crypto client when requested', () => testCryptoStores(async (cryptoStoreType) => {
5251
const homeserverUrl = "https://example.org";
5352
const accessToken = "example_token";
5453

55-
const client = new MatrixClient(homeserverUrl, accessToken, null, new RustSdkCryptoStorageProvider(tmp.dirSync().name, StoreType.Sled));
54+
const client = new MatrixClient(homeserverUrl, accessToken, null, new RustSdkCryptoStorageProvider(tmp.dirSync().name, cryptoStoreType));
5655
expect(client.crypto).toBeDefined();
57-
});
56+
}));
5857

5958
it('should NOT create a crypto client when requested', () => {
6059
const homeserverUrl = "https://example.org";

test/TestUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function createTestClient(
4747
return { http, hsUrl, accessToken, client };
4848
}
4949

50-
const CRYPTO_STORE_TYPES = [StoreType.Sled, StoreType.Sqlite];
50+
const CRYPTO_STORE_TYPES = [StoreType.Sqlite];
5151

5252
export async function testCryptoStores(fn: (StoreType) => Promise<void>): Promise<void> {
5353
for (const st of CRYPTO_STORE_TYPES) {

test/appservice/IntentTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ describe('Intent', () => {
11371137

11381138
beforeEach(() => {
11391139
storage = new MemoryStorageProvider();
1140-
cryptoStorage = new RustSdkAppserviceCryptoStorageProvider(tmp.dirSync().name, StoreType.Sled);
1140+
cryptoStorage = new RustSdkAppserviceCryptoStorageProvider(tmp.dirSync().name, StoreType.Sqlite);
11411141
options = {
11421142
homeserverUrl: hsUrl,
11431143
storage: storage,

0 commit comments

Comments
 (0)