From 59f59bf10dfdde64645c6eb942658ed72fe2fb7e Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 25 Oct 2023 15:04:08 +0200 Subject: [PATCH] Review changes --- spec/unit/crypto.spec.ts | 2 +- spec/unit/rust-crypto/rust-crypto.spec.ts | 13 ++++++------- src/crypto-api.ts | 4 +--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/spec/unit/crypto.spec.ts b/spec/unit/crypto.spec.ts index e59da2d3950..bb21efd34b9 100644 --- a/spec/unit/crypto.spec.ts +++ b/spec/unit/crypto.spec.ts @@ -115,7 +115,7 @@ describe("Crypto", function () { expect(Crypto.getOlmVersion()[0]).toEqual(3); }); - it("should return the current version of the olm library", async () => { + it("getVersion() should return the current version of the olm library", async () => { const client = new TestClient("@alice:example.com", "deviceid").client; await client.initCrypto(); diff --git a/spec/unit/rust-crypto/rust-crypto.spec.ts b/spec/unit/rust-crypto/rust-crypto.spec.ts index 52376a03ff5..4d6973084f5 100644 --- a/spec/unit/rust-crypto/rust-crypto.spec.ts +++ b/spec/unit/rust-crypto/rust-crypto.spec.ts @@ -132,6 +132,12 @@ describe("initRustCrypto", () => { }); describe("RustCrypto", () => { + it("getVersion() should return the current version of the rust sdk and vodozemac", async () => { + const rustCrypto = await makeTestRustCrypto(); + const versions = RustSdkCryptoJs.getVersions(); + expect(rustCrypto.getVersion()).toBe(`Rust SDK ${versions.matrix_sdk_crypto}, Vodozemac ${versions.vodozemac}`); + }); + describe(".importRoomKeys and .exportRoomKeys", () => { let rustCrypto: RustCrypto; @@ -143,13 +149,6 @@ describe("RustCrypto", () => { 10000, ); - it("should return the current version of the rust sdk and vodozemac", async () => { - const versions = RustSdkCryptoJs.getVersions(); - expect(rustCrypto.getVersion()).toBe( - `Rust SDK ${versions.matrix_sdk_crypto}, Vodozemac ${versions.vodozemac}`, - ); - }); - it("should import and export keys", async () => { const someRoomKeys = testData.MEGOLM_SESSION_DATA_ARRAY; let importTotal = 0; diff --git a/src/crypto-api.ts b/src/crypto-api.ts index a0ca5a3bd04..daa6ad86cf2 100644 --- a/src/crypto-api.ts +++ b/src/crypto-api.ts @@ -41,9 +41,7 @@ export interface CryptoApi { /** * Return the current version of the crypto module. - * Rust crypto: the format is `Rust SDK ${versions.matrix_sdk_crypto}, Vodozemac ${versions.vodozemac}` - * Old Crypto: the format is `Olm x.x.x` - * XXXX: remove old crypto when we remove support for it + * For example: `Rust SDK ${versions.matrix_sdk_crypto}, Vodozemac ${versions.vodozemac}`. * @returns the formatted version */ getVersion(): string;