From 1cd8bed7052a15c23d19a6e498eda559b0ddf29c Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Tue, 31 Oct 2023 10:15:14 +0100 Subject: [PATCH] Element-R: Add the git sha of the binding crate to `CryptoApi#getVersion` (#3838) * Update `@matrix-org/matrix-sdk-crypto-wasm` to `v2.2.0` * Add the git sha of the binding crate to `CryptoApi#getVersions` --- package.json | 2 +- spec/unit/rust-crypto/rust-crypto.spec.ts | 4 +++- src/crypto-api.ts | 2 +- src/rust-crypto/rust-crypto.ts | 2 +- yarn.lock | 8 ++++---- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 45a56a36a1d..6e846d26fad 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ ], "dependencies": { "@babel/runtime": "^7.12.5", - "@matrix-org/matrix-sdk-crypto-wasm": "^2.1.1", + "@matrix-org/matrix-sdk-crypto-wasm": "^2.2.0", "another-json": "^0.2.0", "bs58": "^5.0.0", "content-type": "^1.0.4", diff --git a/spec/unit/rust-crypto/rust-crypto.spec.ts b/spec/unit/rust-crypto/rust-crypto.spec.ts index 4d6973084f5..c450331187e 100644 --- a/spec/unit/rust-crypto/rust-crypto.spec.ts +++ b/spec/unit/rust-crypto/rust-crypto.spec.ts @@ -135,7 +135,9 @@ 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}`); + expect(rustCrypto.getVersion()).toBe( + `Rust SDK ${versions.matrix_sdk_crypto} (${versions.git_sha}), Vodozemac ${versions.vodozemac}`, + ); }); describe(".importRoomKeys and .exportRoomKeys", () => { diff --git a/src/crypto-api.ts b/src/crypto-api.ts index daa6ad86cf2..3520ee0cbe9 100644 --- a/src/crypto-api.ts +++ b/src/crypto-api.ts @@ -41,7 +41,7 @@ export interface CryptoApi { /** * Return the current version of the crypto module. - * For example: `Rust SDK ${versions.matrix_sdk_crypto}, Vodozemac ${versions.vodozemac}`. + * For example: `Rust SDK ${versions.matrix_sdk_crypto} (${versions.git_sha}), Vodozemac ${versions.vodozemac}`. * @returns the formatted version */ getVersion(): string; diff --git a/src/rust-crypto/rust-crypto.ts b/src/rust-crypto/rust-crypto.ts index 7a9383906de..4d986480e35 100644 --- a/src/rust-crypto/rust-crypto.ts +++ b/src/rust-crypto/rust-crypto.ts @@ -369,7 +369,7 @@ export class RustCrypto extends TypedEventEmitter