Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
remove references to VerificationBase (#10996)
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh authored Jun 9, 2023
1 parent 53b42e3 commit 47ab99f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/components/views/dialogs/IncomingSasDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ limitations under the License.
*/

import React, { ReactNode } from "react";
import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base";
import { GeneratedSas, ShowSasCallbacks, VerifierEvent } from "matrix-js-sdk/src/crypto-api/verification";
import { GeneratedSas, ShowSasCallbacks, Verifier, VerifierEvent } from "matrix-js-sdk/src/crypto-api/verification";
import { logger } from "matrix-js-sdk/src/logger";

import { MatrixClientPeg } from "../../../MatrixClientPeg";
Expand All @@ -37,7 +36,7 @@ const PHASE_VERIFIED = 3;
const PHASE_CANCELLED = 4;

interface IProps {
verifier: VerificationBase<VerifierEvent, any>;
verifier: Verifier;
onFinished(verified?: boolean): void;
}

Expand Down
8 changes: 4 additions & 4 deletions test/components/views/dialogs/IncomingSasDialog-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
import { act, render } from "@testing-library/react";
import React from "react";
import { Mocked } from "jest-mock";
import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base";
import {
EmojiMapping,
ShowSasCallbacks,
Verifier,
VerifierEvent,
VerifierEventHandlerMap,
} from "matrix-js-sdk/src/crypto-api/verification";
Expand Down Expand Up @@ -58,16 +58,16 @@ describe("IncomingSasDialog", () => {
});
});

function renderComponent(verifier: VerificationBase, onFinished = () => true) {
function renderComponent(verifier: Verifier, onFinished = () => true) {
return render(<IncomingSasDialog verifier={verifier} onFinished={onFinished} />);
}

function makeMockVerifier(): Mocked<VerificationBase> {
function makeMockVerifier(): Mocked<Verifier> {
const verifier = new TypedEventEmitter<VerifierEvent, VerifierEventHandlerMap>();
Object.assign(verifier, {
cancel: jest.fn(),
});
return verifier as unknown as Mocked<VerificationBase>;
return verifier as unknown as Mocked<Verifier>;
}

function makeMockSasCallbacks(): ShowSasCallbacks {
Expand Down
10 changes: 5 additions & 5 deletions test/components/views/right_panel/VerificationPanel-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import {
import { TypedEventEmitter } from "matrix-js-sdk/src/models/typed-event-emitter";
import { User } from "matrix-js-sdk/src/models/user";
import { Mocked } from "jest-mock";
import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base";
import {
EmojiMapping,
ShowSasCallbacks,
Verifier,
VerifierEvent,
VerifierEventHandlerMap,
} from "matrix-js-sdk/src/crypto-api/verification";
Expand Down Expand Up @@ -94,13 +94,13 @@ describe("<VerificationPanel />", () => {
});

describe("'Verify by emoji' flow", () => {
let mockVerifier: Mocked<VerificationBase>;
let mockVerifier: Mocked<Verifier>;
let mockRequest: Mocked<VerificationRequest>;

beforeEach(() => {
mockVerifier = makeMockVerifier();
mockRequest = makeMockVerificationRequest({
verifier: mockVerifier,
verifier: mockVerifier as unknown as VerificationRequest["verifier"],
chosenMethod: "m.sas.v1",
});
});
Expand Down Expand Up @@ -158,15 +158,15 @@ function makeMockVerificationRequest(props: Partial<VerificationRequest> = {}):
return request as unknown as Mocked<VerificationRequest>;
}

function makeMockVerifier(): Mocked<VerificationBase> {
function makeMockVerifier(): Mocked<Verifier> {
const verifier = new TypedEventEmitter<VerifierEvent, VerifierEventHandlerMap>();
Object.assign(verifier, {
cancel: jest.fn(),
verify: jest.fn(),
getShowSasCallbacks: jest.fn(),
getReciprocateQrCodeCallbacks: jest.fn(),
});
return verifier as unknown as Mocked<VerificationBase>;
return verifier as unknown as Mocked<Verifier>;
}

function makeMockSasCallbacks(): ShowSasCallbacks {
Expand Down

0 comments on commit 47ab99f

Please sign in to comment.