@@ -18,7 +18,6 @@ import { MockedObject } from "jest-mock";
18
18
19
19
import { MatrixEvent , MatrixEventEvent } from "../../../src/models/event" ;
20
20
import { emitPromise } from "../../test-utils/test-utils" ;
21
- import { Crypto , IEventDecryptionResult } from "../../../src/crypto" ;
22
21
import {
23
22
IAnnotatedPushRule ,
24
23
MatrixClient ,
@@ -28,7 +27,7 @@ import {
28
27
TweakName ,
29
28
} from "../../../src" ;
30
29
import { DecryptionFailureCode } from "../../../src/crypto-api" ;
31
- import { DecryptionError } from "../../../src/common-crypto/CryptoBackend" ;
30
+ import { CryptoBackend , DecryptionError , EventDecryptionResult } from "../../../src/common-crypto/CryptoBackend" ;
32
31
33
32
describe ( "MatrixEvent" , ( ) => {
34
33
it ( "should create copies of itself" , ( ) => {
@@ -369,7 +368,7 @@ describe("MatrixEvent", () => {
369
368
const testError = new Error ( "test error" ) ;
370
369
const crypto = {
371
370
decryptEvent : jest . fn ( ) . mockRejectedValue ( testError ) ,
372
- } as unknown as Crypto ;
371
+ } as unknown as CryptoBackend ;
373
372
374
373
await encryptedEvent . attemptDecryption ( crypto ) ;
375
374
expect ( encryptedEvent . isEncrypted ( ) ) . toBeTruthy ( ) ;
@@ -391,7 +390,7 @@ describe("MatrixEvent", () => {
391
390
const testError = new DecryptionError ( DecryptionFailureCode . MEGOLM_UNKNOWN_INBOUND_SESSION_ID , "uisi" ) ;
392
391
const crypto = {
393
392
decryptEvent : jest . fn ( ) . mockRejectedValue ( testError ) ,
394
- } as unknown as Crypto ;
393
+ } as unknown as CryptoBackend ;
395
394
396
395
await encryptedEvent . attemptDecryption ( crypto ) ;
397
396
expect ( encryptedEvent . isEncrypted ( ) ) . toBeTruthy ( ) ;
@@ -418,7 +417,7 @@ describe("MatrixEvent", () => {
418
417
"The sender has disabled encrypting to unverified devices." ,
419
418
) ,
420
419
) ,
421
- } as unknown as Crypto ;
420
+ } as unknown as CryptoBackend ;
422
421
423
422
await encryptedEvent . attemptDecryption ( crypto ) ;
424
423
expect ( encryptedEvent . isEncrypted ( ) ) . toBeTruthy ( ) ;
@@ -453,7 +452,7 @@ describe("MatrixEvent", () => {
453
452
} ,
454
453
} ) ;
455
454
} ) ,
456
- } as unknown as Crypto ;
455
+ } as unknown as CryptoBackend ;
457
456
458
457
await encryptedEvent . attemptDecryption ( crypto ) ;
459
458
@@ -478,7 +477,7 @@ describe("MatrixEvent", () => {
478
477
479
478
const crypto = {
480
479
decryptEvent : jest . fn ( ) . mockImplementationOnce ( ( ) => {
481
- return Promise . resolve < IEventDecryptionResult > ( {
480
+ return Promise . resolve < EventDecryptionResult > ( {
482
481
clearEvent : {
483
482
type : "m.room.message" ,
484
483
content : {
@@ -491,7 +490,7 @@ describe("MatrixEvent", () => {
491
490
} ,
492
491
} ) ;
493
492
} ) ,
494
- } as unknown as Crypto ;
493
+ } as unknown as CryptoBackend ;
495
494
496
495
await encryptedEvent . attemptDecryption ( crypto ) ;
497
496
expect ( encryptedEvent . getType ( ) ) . toEqual ( "m.room.message" ) ;
0 commit comments