Skip to content

Commit 1ffa618

Browse files
committed
feat(rust-crypto!): remove deprecated optional parameters
1 parent 33afeba commit 1ffa618

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/rust-crypto/rust-crypto.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
10301030
* @returns the VerificationRequest that is in progress, if any
10311031
*
10321032
*/
1033-
public findVerificationRequestDMInProgress(roomId: string, userId?: string): VerificationRequest | undefined {
1034-
if (!userId) throw new Error("missing userId");
1035-
1033+
public findVerificationRequestDMInProgress(roomId: string, userId: string): VerificationRequest | undefined {
10361034
const requests: RustSdkCryptoJs.VerificationRequest[] = this.olmMachine.getVerificationRequests(
10371035
new RustSdkCryptoJs.UserId(userId),
10381036
);
@@ -1223,13 +1221,8 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
12231221
* @param key - the backup decryption key
12241222
* @param version - the backup version for this key.
12251223
*/
1226-
public async storeSessionBackupPrivateKey(key: Uint8Array, version?: string): Promise<void> {
1224+
public async storeSessionBackupPrivateKey(key: Uint8Array, version: string): Promise<void> {
12271225
const base64Key = encodeBase64(key);
1228-
1229-
if (!version) {
1230-
throw new Error("storeSessionBackupPrivateKey: version is required");
1231-
}
1232-
12331226
await this.backupManager.saveBackupDecryptionKey(
12341227
RustSdkCryptoJs.BackupDecryptionKey.fromBase64(base64Key),
12351228
version,

0 commit comments

Comments
 (0)