You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Fix yet more underscored accesses
This commit is contained in:
@@ -408,7 +408,7 @@ describe("MegolmDecryption", function() {
|
|||||||
"@bob:example.com", BOB_DEVICES,
|
"@bob:example.com", BOB_DEVICES,
|
||||||
);
|
);
|
||||||
aliceClient.crypto.deviceList.downloadKeys = async function(userIds) {
|
aliceClient.crypto.deviceList.downloadKeys = async function(userIds) {
|
||||||
return this._getDevicesFromStore(userIds);
|
return this.getDevicesFromStore(userIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
let run = false;
|
let run = false;
|
||||||
@@ -512,7 +512,7 @@ describe("MegolmDecryption", function() {
|
|||||||
"@bob:example.com", BOB_DEVICES,
|
"@bob:example.com", BOB_DEVICES,
|
||||||
);
|
);
|
||||||
aliceClient.crypto.deviceList.downloadKeys = async function(userIds) {
|
aliceClient.crypto.deviceList.downloadKeys = async function(userIds) {
|
||||||
return this._getDevicesFromStore(userIds);
|
return this.getDevicesFromStore(userIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
aliceClient.claimOneTimeKeys = async () => {
|
aliceClient.claimOneTimeKeys = async () => {
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ describe("Cross Signing", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const deviceInfo = alice.crypto.deviceList._devices["@alice:example.com"]
|
const deviceInfo = alice.crypto.deviceList.devices["@alice:example.com"]
|
||||||
.Osborne2;
|
.Osborne2;
|
||||||
const aliceDevice = {
|
const aliceDevice = {
|
||||||
user_id: "@alice:example.com",
|
user_id: "@alice:example.com",
|
||||||
@@ -444,7 +444,7 @@ describe("Cross Signing", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const deviceInfo = alice.crypto.deviceList._devices["@alice:example.com"]
|
const deviceInfo = alice.crypto.deviceList.devices["@alice:example.com"]
|
||||||
.Osborne2;
|
.Osborne2;
|
||||||
const aliceDevice = {
|
const aliceDevice = {
|
||||||
user_id: "@alice:example.com",
|
user_id: "@alice:example.com",
|
||||||
|
|||||||
@@ -48,18 +48,18 @@ describe("self-verifications", () => {
|
|||||||
storeCrossSigningKeyCache: jest.fn(),
|
storeCrossSigningKeyCache: jest.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const _crossSigningInfo = new CrossSigningInfo(
|
const crossSigningInfo = new CrossSigningInfo(
|
||||||
userId,
|
userId,
|
||||||
{},
|
{},
|
||||||
cacheCallbacks,
|
cacheCallbacks,
|
||||||
);
|
);
|
||||||
_crossSigningInfo.keys = {
|
crossSigningInfo.keys = {
|
||||||
master: { keys: { X: testKeyPub } },
|
master: { keys: { X: testKeyPub } },
|
||||||
self_signing: { keys: { X: testKeyPub } },
|
self_signing: { keys: { X: testKeyPub } },
|
||||||
user_signing: { keys: { X: testKeyPub } },
|
user_signing: { keys: { X: testKeyPub } },
|
||||||
};
|
};
|
||||||
|
|
||||||
const _secretStorage = {
|
const secretStorage = {
|
||||||
request: jest.fn().mockReturnValue({
|
request: jest.fn().mockReturnValue({
|
||||||
promise: Promise.resolve(encodeBase64(testKey)),
|
promise: Promise.resolve(encodeBase64(testKey)),
|
||||||
}),
|
}),
|
||||||
@@ -70,12 +70,12 @@ describe("self-verifications", () => {
|
|||||||
|
|
||||||
const client = {
|
const client = {
|
||||||
crypto: {
|
crypto: {
|
||||||
_crossSigningInfo,
|
crossSigningInfo,
|
||||||
_secretStorage,
|
secretStorage,
|
||||||
storeSessionBackupPrivateKey,
|
storeSessionBackupPrivateKey,
|
||||||
getSessionBackupPrivateKey: () => null,
|
getSessionBackupPrivateKey: () => null,
|
||||||
},
|
},
|
||||||
requestSecret: _secretStorage.request.bind(_secretStorage),
|
requestSecret: secretStorage.request.bind(secretStorage),
|
||||||
getUserId: () => userId,
|
getUserId: () => userId,
|
||||||
getKeyBackupVersion: () => Promise.resolve({}),
|
getKeyBackupVersion: () => Promise.resolve({}),
|
||||||
restoreKeyBackupWithCache,
|
restoreKeyBackupWithCache,
|
||||||
@@ -99,7 +99,7 @@ describe("self-verifications", () => {
|
|||||||
|
|
||||||
/* We should request, and store, 3 cross signing keys and the key backup key */
|
/* We should request, and store, 3 cross signing keys and the key backup key */
|
||||||
expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls.length).toBe(3);
|
expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls.length).toBe(3);
|
||||||
expect(_secretStorage.request.mock.calls.length).toBe(4);
|
expect(secretStorage.request.mock.calls.length).toBe(4);
|
||||||
|
|
||||||
expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls[0][1])
|
expect(cacheCallbacks.storeCrossSigningKeyCache.mock.calls[0][1])
|
||||||
.toEqual(testKey);
|
.toEqual(testKey);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import { chunkPromises, defer, IDeferred, sleep } from '../utils';
|
|||||||
import { MatrixClient, CryptoStore } from "../client";
|
import { MatrixClient, CryptoStore } from "../client";
|
||||||
import { OlmDevice } from "./OlmDevice";
|
import { OlmDevice } from "./OlmDevice";
|
||||||
|
|
||||||
/* State transition diagram for DeviceList._deviceTrackingStatus
|
/* State transition diagram for DeviceList.deviceTrackingStatus
|
||||||
*
|
*
|
||||||
* |
|
* |
|
||||||
* stopTrackingDeviceList V
|
* stopTrackingDeviceList V
|
||||||
@@ -51,7 +51,7 @@ import { OlmDevice } from "./OlmDevice";
|
|||||||
* +----------------------- UP_TO_DATE ------------------------+
|
* +----------------------- UP_TO_DATE ------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// constants for DeviceList._deviceTrackingStatus
|
// constants for DeviceList.deviceTrackingStatus
|
||||||
enum TrackingStatus {
|
enum TrackingStatus {
|
||||||
NotTracked,
|
NotTracked,
|
||||||
PendingDownload,
|
PendingDownload,
|
||||||
|
|||||||
Reference in New Issue
Block a user