@onekeyfe/hd-core 1.2.0-alpha.18 → 1.2.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/__tests__/device-features-state.test.ts +78 -0
  2. package/__tests__/device-identity.test.ts +30 -0
  3. package/__tests__/device-pool-state.test.ts +113 -0
  4. package/__tests__/device-settings.test.ts +108 -0
  5. package/__tests__/device-state-contract.test.ts +27 -0
  6. package/__tests__/device-state-events.test.ts +163 -0
  7. package/__tests__/device-state-mapper.test.ts +222 -0
  8. package/__tests__/device-state-projector.test.ts +94 -0
  9. package/__tests__/device-state-store.test.ts +115 -0
  10. package/__tests__/device-wallet-session-store.test.ts +46 -0
  11. package/__tests__/deviceFeaturesUtils.test.ts +13 -1
  12. package/__tests__/deviceSettings.test.ts +54 -0
  13. package/__tests__/get-device-state.test.ts +367 -0
  14. package/__tests__/logBlockEvent.test.ts +13 -0
  15. package/__tests__/protocol-v2.test.ts +358 -413
  16. package/__tests__/public-device-state-api.test.ts +153 -0
  17. package/__tests__/refresh-device-state.test.ts +101 -0
  18. package/__tests__/request-context-logging.test.ts +16 -0
  19. package/__tests__/search-devices.test.ts +93 -0
  20. package/dist/api/ClearSessionCache.d.ts.map +1 -1
  21. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  22. package/dist/api/GetDeviceState.d.ts +7 -0
  23. package/dist/api/GetDeviceState.d.ts.map +1 -0
  24. package/dist/api/GetFeatures.d.ts +1 -1
  25. package/dist/api/GetFeatures.d.ts.map +1 -1
  26. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  27. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  28. package/dist/api/SearchDevices.d.ts.map +1 -1
  29. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  30. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  31. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  32. package/dist/api/index.d.ts +1 -4
  33. package/dist/api/index.d.ts.map +1 -1
  34. package/dist/api/internal.d.ts +4 -0
  35. package/dist/api/internal.d.ts.map +1 -0
  36. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +0 -1
  37. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -1
  38. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
  39. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +1 -1
  40. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +1 -1
  41. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -1
  42. package/dist/api/utils.d.ts +2 -1
  43. package/dist/api/utils.d.ts.map +1 -1
  44. package/dist/constants/index.d.ts +1 -1
  45. package/dist/constants/index.d.ts.map +1 -1
  46. package/dist/core/index.d.ts.map +1 -1
  47. package/dist/device/Device.d.ts +22 -3
  48. package/dist/device/Device.d.ts.map +1 -1
  49. package/dist/device/DeviceFeaturesState.d.ts +4 -0
  50. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  51. package/dist/device/DevicePool.d.ts +1 -0
  52. package/dist/device/DevicePool.d.ts.map +1 -1
  53. package/dist/device/DeviceStateMapper.d.ts +13 -0
  54. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  55. package/dist/device/DeviceStateProjector.d.ts +8 -0
  56. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  57. package/dist/device/DeviceStateStore.d.ts +23 -0
  58. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  59. package/dist/device/deviceIdentity.d.ts +5 -0
  60. package/dist/device/deviceIdentity.d.ts.map +1 -0
  61. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  62. package/dist/deviceProfile/index.d.ts +0 -1
  63. package/dist/deviceProfile/index.d.ts.map +1 -1
  64. package/dist/events/device.d.ts +7 -2
  65. package/dist/events/device.d.ts.map +1 -1
  66. package/dist/index.d.ts +688 -639
  67. package/dist/index.js +1274 -942
  68. package/dist/inject.d.ts.map +1 -1
  69. package/dist/protocols/protocol-v2/features.d.ts +1 -0
  70. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  71. package/dist/protocols/protocol-v2/index.d.ts +1 -1
  72. package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
  73. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -1
  74. package/dist/types/api/deviceSettings.d.ts +8 -0
  75. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  76. package/dist/types/api/getDeviceState.d.ts +12 -0
  77. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  78. package/dist/types/api/index.d.ts +4 -7
  79. package/dist/types/api/index.d.ts.map +1 -1
  80. package/dist/types/api/protocolV2.d.ts +1 -6
  81. package/dist/types/api/protocolV2.d.ts.map +1 -1
  82. package/dist/types/device.d.ts +121 -1
  83. package/dist/types/device.d.ts.map +1 -1
  84. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  85. package/dist/utils/deviceSettings.d.ts.map +1 -1
  86. package/dist/utils/patch.d.ts +1 -1
  87. package/dist/utils/tracing.d.ts.map +1 -1
  88. package/package.json +4 -4
  89. package/src/api/ClearSessionCache.ts +4 -0
  90. package/src/api/FirmwareUpdateV4.ts +15 -7
  91. package/src/api/GetDeviceState.ts +55 -0
  92. package/src/api/GetFeatures.ts +8 -3
  93. package/src/api/GetOnekeyFeatures.ts +3 -72
  94. package/src/api/GetPassphraseState.ts +3 -1
  95. package/src/api/SearchDevices.ts +25 -4
  96. package/src/api/device/DeviceRebootToBoardloader.ts +1 -0
  97. package/src/api/device/DeviceRebootToBootloader.ts +1 -0
  98. package/src/api/device/DeviceSettings.ts +28 -0
  99. package/src/api/index.ts +1 -4
  100. package/src/api/internal.ts +9 -0
  101. package/src/api/protocol-v2/DeviceInfoGet.ts +3 -5
  102. package/src/api/protocol-v2/DeviceReboot.ts +3 -1
  103. package/src/api/protocol-v2/DeviceSettingsGet.ts +3 -1
  104. package/src/api/protocol-v2/DeviceSettingsSet.ts +2 -0
  105. package/src/api/protocol-v2/DeviceStatusGet.ts +1 -0
  106. package/src/api/utils.ts +9 -3
  107. package/src/constants/index.ts +1 -4
  108. package/src/core/index.ts +7 -1
  109. package/src/data/messages/messages-protocol-v2.json +22 -13
  110. package/src/device/Device.ts +256 -78
  111. package/src/device/DeviceFeaturesState.ts +34 -0
  112. package/src/device/DevicePool.ts +35 -9
  113. package/src/device/DeviceStateMapper.ts +364 -0
  114. package/src/device/DeviceStateProjector.ts +92 -0
  115. package/src/device/DeviceStateStore.ts +242 -0
  116. package/src/device/deviceIdentity.ts +18 -0
  117. package/src/deviceProfile/buildDeviceFeatures.ts +166 -109
  118. package/src/deviceProfile/index.ts +0 -1
  119. package/src/events/device.ts +13 -1
  120. package/src/events/logBlockEvent.ts +1 -1
  121. package/src/inject.ts +4 -5
  122. package/src/protocols/protocol-v2/features.ts +18 -9
  123. package/src/protocols/protocol-v2/index.ts +1 -0
  124. package/src/protocols/protocol-v2/walletSession.ts +5 -7
  125. package/src/types/api/deviceSettings.ts +8 -0
  126. package/src/types/api/getDeviceState.ts +19 -0
  127. package/src/types/api/index.ts +3 -20
  128. package/src/types/api/protocolV2.ts +0 -24
  129. package/src/types/device.ts +148 -1
  130. package/src/utils/deviceFeaturesUtils.ts +5 -1
  131. package/src/utils/deviceSettings.ts +41 -0
  132. package/src/utils/tracing.ts +3 -1
  133. package/dist/api/GetDeviceInfo.d.ts +0 -9
  134. package/dist/api/GetDeviceInfo.d.ts.map +0 -1
  135. package/dist/deviceProfile/buildDeviceProfile.d.ts +0 -22
  136. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +0 -1
  137. package/dist/types/api/getDeviceInfo.d.ts +0 -88
  138. package/dist/types/api/getDeviceInfo.d.ts.map +0 -1
  139. package/src/api/GetDeviceInfo.ts +0 -152
  140. package/src/deviceProfile/buildDeviceProfile.ts +0 -370
  141. package/src/types/api/getDeviceInfo.ts +0 -106
@@ -0,0 +1,367 @@
1
+ import { HardwareErrorCode } from '@onekeyfe/hd-shared';
2
+
3
+ import { Device } from '../src/device/Device';
4
+
5
+ jest.mock('../src/data/config', () => ({
6
+ getSDKVersion: jest.fn(() => '1.0.0'),
7
+ DEFAULT_DOMAIN: 'https://jssdk.onekey.so/1.0.0/',
8
+ }));
9
+
10
+ const createV2Device = (typedCall: jest.Mock) => {
11
+ const device = Device.fromDescriptor({
12
+ id: 'pro2',
13
+ path: 'pro2',
14
+ protocolType: 'V2',
15
+ } as never);
16
+ (device as any).commands = { typedCall };
17
+ return device;
18
+ };
19
+
20
+ const createV1Device = (typedCall: jest.Mock) => {
21
+ const device = Device.fromDescriptor({
22
+ id: 'pro',
23
+ path: 'pro',
24
+ protocolType: 'V1',
25
+ } as never);
26
+ (device as any).commands = { typedCall };
27
+ return device;
28
+ };
29
+
30
+ describe('getDeviceState', () => {
31
+ test('does not expose the internal wallet session', async () => {
32
+ const device = createV2Device(jest.fn());
33
+ device.updateState(
34
+ {
35
+ protocol: 'V2',
36
+ session: { sessionId: 'private-session', passphraseState: 'private-state' },
37
+ },
38
+ 'initialize'
39
+ );
40
+
41
+ const state = await device.getDeviceState();
42
+
43
+ expect(state).not.toHaveProperty('session');
44
+ });
45
+
46
+ test('hydrates Protocol V2 without status target or DeviceStatusGet by default', async () => {
47
+ const typedCall = jest.fn().mockResolvedValue({
48
+ message: {
49
+ protocol_version: 2,
50
+ hw: { serial_no: 'SERIAL-1' },
51
+ fw: { application: { version: '5.0.0' } },
52
+ },
53
+ });
54
+ const device = createV2Device(typedCall);
55
+
56
+ const state = await device.getDeviceState();
57
+
58
+ expect(state.identity.serialNo).toBe('SERIAL-1');
59
+ expect(typedCall).toHaveBeenCalledTimes(1);
60
+ expect(typedCall.mock.calls[0][0]).toBe('DeviceInfoGet');
61
+ expect(typedCall.mock.calls[0][2]?.targets?.status).not.toBe(true);
62
+ expect(typedCall).not.toHaveBeenCalledWith(
63
+ 'DeviceStatusGet',
64
+ expect.anything(),
65
+ expect.anything()
66
+ );
67
+ });
68
+
69
+ test('uses a single full DeviceInfoGet when firmware refresh initializes the state', async () => {
70
+ const typedCall = jest.fn().mockResolvedValue({
71
+ message: {
72
+ protocol_version: 2,
73
+ hw: { serial_no: 'SERIAL-1' },
74
+ fw: { application: { version: '5.0.0', hash: 'HASH-1' } },
75
+ },
76
+ });
77
+ const device = createV2Device(typedCall);
78
+
79
+ await device.getDeviceState({
80
+ refreshSections: ['identity', 'versions', 'verification'],
81
+ });
82
+
83
+ expect(typedCall).toHaveBeenCalledTimes(1);
84
+ expect(typedCall).toHaveBeenCalledWith(
85
+ 'DeviceInfoGet',
86
+ 'DeviceInfo',
87
+ expect.objectContaining({
88
+ types: expect.objectContaining({ hash: true, build_id: true }),
89
+ }),
90
+ expect.anything()
91
+ );
92
+ });
93
+
94
+ test('does not overwrite confirmed notInitialized mode during a versions refresh', async () => {
95
+ const typedCall = jest.fn().mockResolvedValue({
96
+ message: {
97
+ protocol_version: 2,
98
+ hw: { serial_no: 'SERIAL-1' },
99
+ fw: { application: { version: '5.0.0' } },
100
+ se1: { application: { version: '1.0.0' } },
101
+ },
102
+ });
103
+ const device = createV2Device(typedCall);
104
+ device.updateState(
105
+ {
106
+ protocol: 'V2',
107
+ status: { mode: 'notInitialized', initialized: false },
108
+ },
109
+ 'device-status'
110
+ );
111
+
112
+ const state = await device.getDeviceState({ refreshSections: ['versions'] });
113
+
114
+ expect(state.status.mode).toBe('notInitialized');
115
+ expect(state.status.initialized).toBe(false);
116
+ expect(state.versions.se01).toBe('1.0.0');
117
+ });
118
+
119
+ test.each(['bootloader', 'romloader'] as const)(
120
+ 'does not call DeviceStatusGet in %s mode',
121
+ async mode => {
122
+ const typedCall = jest.fn();
123
+ const device = createV2Device(typedCall);
124
+ device.updateState({ protocol: 'V2', status: { mode } }, 'initialize');
125
+
126
+ const state = await device.getDeviceState({ refreshSections: ['status'] });
127
+
128
+ expect(state.status.mode).toBe(mode);
129
+ expect(typedCall).not.toHaveBeenCalled();
130
+ }
131
+ );
132
+
133
+ test('refreshes Protocol V2 status only when explicitly requested in normal mode', async () => {
134
+ const typedCall = jest.fn().mockResolvedValue({
135
+ message: { init_states: true, unlocked: true, device_id: 'device-1' },
136
+ });
137
+ const device = createV2Device(typedCall);
138
+ device.updateState({ protocol: 'V2', status: { mode: 'normal' } }, 'initialize');
139
+
140
+ const state = await device.getDeviceState({ refreshSections: ['status'] });
141
+
142
+ expect(typedCall).toHaveBeenCalledWith('DeviceStatusGet', 'DeviceStatus', {});
143
+ expect(state.status.unlocked).toBe(true);
144
+ expect(state.identity.deviceId).toBe('device-1');
145
+ });
146
+
147
+ test('refreshes Protocol V2 settings without requesting status', async () => {
148
+ const typedCall = jest.fn().mockResolvedValue({
149
+ message: {
150
+ label: 'Renamed Pro 2',
151
+ language: 'ja-JP',
152
+ brightness: 70,
153
+ },
154
+ });
155
+ const device = createV2Device(typedCall);
156
+ device.updateState({ protocol: 'V2', status: { mode: 'normal' } }, 'initialize');
157
+
158
+ const state = await device.getDeviceState({ refreshSections: ['settings'] });
159
+
160
+ expect(typedCall).toHaveBeenCalledWith('DeviceSettingsGet', 'DeviceSettings', {});
161
+ expect(typedCall).not.toHaveBeenCalledWith(
162
+ 'DeviceStatusGet',
163
+ expect.anything(),
164
+ expect.anything()
165
+ );
166
+ expect(state.identity.label).toBe('Renamed Pro 2');
167
+ expect(state.settings.language).toBe('ja-JP');
168
+ expect(state.settings.brightness).toBe(70);
169
+ });
170
+
171
+ test('refreshes Protocol V2 status before settings in a combined read', async () => {
172
+ const typedCall = jest.fn().mockImplementation((requestType: string) => {
173
+ if (requestType === 'DeviceStatusGet') {
174
+ return {
175
+ message: { init_states: true, unlocked: false, device_id: 'device-1' },
176
+ };
177
+ }
178
+ if (requestType === 'DeviceSettingsGet') {
179
+ return { message: { label: 'Renamed Pro 2' } };
180
+ }
181
+ throw new Error(`Unexpected request: ${requestType}`);
182
+ });
183
+ const device = createV2Device(typedCall);
184
+ device.updateState({ protocol: 'V2', status: { mode: 'normal' } }, 'initialize');
185
+
186
+ const state = await device.getDeviceState({ refreshSections: ['status', 'settings'] });
187
+
188
+ expect(typedCall.mock.calls.map(call => call[0])).toEqual([
189
+ 'DeviceStatusGet',
190
+ 'DeviceSettingsGet',
191
+ ]);
192
+ expect(state.status.unlocked).toBe(false);
193
+ expect(state.identity.label).toBe('Renamed Pro 2');
194
+ });
195
+
196
+ test('keeps the refreshed status when a following settings read fails', async () => {
197
+ const typedCall = jest.fn().mockImplementation((requestType: string) => {
198
+ if (requestType === 'DeviceStatusGet') {
199
+ return {
200
+ message: { init_states: true, unlocked: false, device_id: 'device-1' },
201
+ };
202
+ }
203
+ throw Object.assign(new Error('Device locked'), {
204
+ errorCode: HardwareErrorCode.DeviceLocked,
205
+ });
206
+ });
207
+ const device = createV2Device(typedCall);
208
+ device.updateState(
209
+ { protocol: 'V2', status: { mode: 'normal', unlocked: true } },
210
+ 'initialize'
211
+ );
212
+
213
+ await expect(
214
+ device.getDeviceState({ refreshSections: ['status', 'settings'] })
215
+ ).rejects.toMatchObject({ errorCode: HardwareErrorCode.DeviceLocked });
216
+
217
+ const state = await device.getDeviceState();
218
+ expect(state.status.unlocked).toBe(false);
219
+ expect(state.identity.deviceId).toBe('device-1');
220
+ });
221
+
222
+ test('rejects an explicit settings refresh without mutating cached state', async () => {
223
+ const typedCall = jest.fn().mockRejectedValue(
224
+ Object.assign(new Error('Device locked'), {
225
+ errorCode: HardwareErrorCode.DeviceLocked,
226
+ })
227
+ );
228
+ const device = createV2Device(typedCall);
229
+ device.updateState(
230
+ {
231
+ protocol: 'V2',
232
+ identity: { label: 'Persisted label' },
233
+ status: { mode: 'normal', unlocked: false },
234
+ settings: { language: 'en-US' },
235
+ },
236
+ 'initialize'
237
+ );
238
+
239
+ await expect(device.getDeviceState({ refreshSections: ['settings'] })).rejects.toMatchObject({
240
+ errorCode: HardwareErrorCode.DeviceLocked,
241
+ });
242
+ const state = await device.getDeviceState();
243
+
244
+ expect(state.identity.label).toBe('Persisted label');
245
+ expect(state.settings.language).toBe('en-US');
246
+ });
247
+
248
+ test('aggregates OnekeyGetFeatures into a Protocol V1 firmware refresh', async () => {
249
+ const typedCall = jest.fn().mockImplementation((requestType: string) => {
250
+ if (requestType === 'GetFeatures') {
251
+ return {
252
+ message: {
253
+ onekey_device_type: 'PRO',
254
+ label: 'Pro Wallet',
255
+ initialized: true,
256
+ onekey_firmware_version: '4.10.0',
257
+ onekey_firmware_build_id: 'firmware-build',
258
+ },
259
+ };
260
+ }
261
+ if (requestType === 'OnekeyGetFeatures') {
262
+ return {
263
+ message: {
264
+ onekey_firmware_version: '4.10.1',
265
+ onekey_board_build_id: 'board-build',
266
+ onekey_se01_boot_version: '1.0.0',
267
+ onekey_se01_boot_build_id: 'se-boot-build',
268
+ onekey_se01_boot_hash: 'abcd',
269
+ },
270
+ };
271
+ }
272
+ throw new Error(`Unexpected request: ${requestType}`);
273
+ });
274
+ const device = createV1Device(typedCall);
275
+
276
+ const state = await device.getDeviceState({
277
+ refreshSections: ['identity', 'versions', 'verification'],
278
+ includeRaw: true,
279
+ });
280
+
281
+ expect(typedCall.mock.calls.map(call => call[0])).toEqual(['GetFeatures', 'OnekeyGetFeatures']);
282
+ expect(state.versions.firmware).toBe('4.10.1');
283
+ expect(state.versions.se01Boot).toBe('1.0.0');
284
+ expect(state.verification).toMatchObject({
285
+ firmwareBuildId: 'firmware-build',
286
+ boardBuildId: 'board-build',
287
+ se01BootBuildId: 'se-boot-build',
288
+ se01BootHash: 'abcd',
289
+ });
290
+ expect(state.raw?.protocolV1OneKeyFeatures).toMatchObject({
291
+ onekey_board_build_id: 'board-build',
292
+ });
293
+ });
294
+
295
+ test('does not clear Protocol V1 firmware details during a later runtime refresh', async () => {
296
+ let getFeaturesCount = 0;
297
+ const typedCall = jest.fn().mockImplementation((requestType: string) => {
298
+ if (requestType === 'GetFeatures') {
299
+ getFeaturesCount += 1;
300
+ return {
301
+ message: {
302
+ onekey_device_type: 'PRO',
303
+ initialized: true,
304
+ unlocked: getFeaturesCount === 1,
305
+ major_version: 4,
306
+ minor_version: 10,
307
+ patch_version: 1,
308
+ },
309
+ };
310
+ }
311
+ if (requestType === 'OnekeyGetFeatures') {
312
+ return {
313
+ message: {
314
+ onekey_se01_boot_version: '1.0.0',
315
+ onekey_se01_boot_build_id: 'se-boot-build',
316
+ onekey_se01_boot_hash: 'abcd',
317
+ },
318
+ };
319
+ }
320
+ throw new Error(`Unexpected request: ${requestType}`);
321
+ });
322
+ const device = createV1Device(typedCall);
323
+
324
+ await device.getDeviceState({
325
+ refreshSections: ['identity', 'versions', 'verification'],
326
+ });
327
+ const state = await device.getDeviceState({ refreshSections: ['status'] });
328
+
329
+ expect(state.status.unlocked).toBe(false);
330
+ expect(state.versions.se01Boot).toBe('1.0.0');
331
+ expect(state.verification).toMatchObject({
332
+ se01BootBuildId: 'se-boot-build',
333
+ se01BootHash: 'abcd',
334
+ });
335
+ });
336
+
337
+ test('reloads Protocol V2 DeviceInfo after a physical reconnect', async () => {
338
+ const typedCall = jest.fn().mockResolvedValue({
339
+ message: {
340
+ protocol_version: 1,
341
+ hw: { serial_no: 'SERIAL-1' },
342
+ fw: { bootloader: { version: '1.0.0' } },
343
+ },
344
+ });
345
+ const device = createV2Device(typedCall);
346
+ device.updateState(
347
+ {
348
+ protocol: 'V2',
349
+ identity: { deviceId: 'wallet-1', serialNo: 'SERIAL-1' },
350
+ status: { mode: 'normal', initialized: true, unlocked: true },
351
+ },
352
+ 'initialize'
353
+ );
354
+
355
+ device.markTransportDisconnected();
356
+ await device.initialize();
357
+
358
+ expect(typedCall).toHaveBeenCalledWith(
359
+ 'DeviceInfoGet',
360
+ 'DeviceInfo',
361
+ expect.anything(),
362
+ expect.anything()
363
+ );
364
+ expect(device.state?.status.mode).toBe('bootloader');
365
+ expect(device.state?.identity.deviceId).toBeNull();
366
+ });
367
+ });
@@ -31,6 +31,19 @@ describe('getLogBlockLabel', () => {
31
31
  ).toBe('evmSignTypedData');
32
32
  });
33
33
 
34
+ it('blocks deviceSessionOpen params before logging a host passphrase', () => {
35
+ expect(
36
+ getLogBlockLabel({
37
+ method: 'deviceSessionOpen',
38
+ select: {
39
+ host_passphrase: {
40
+ passphrase: 'do-not-log-this',
41
+ },
42
+ },
43
+ })
44
+ ).toBe('deviceSessionOpen');
45
+ });
46
+
34
47
  it('keeps existing sensitive UI response blocking', () => {
35
48
  expect(getLogBlockLabel({ type: UI_RESPONSE.RECEIVE_PIN })).toBe(UI_RESPONSE.RECEIVE_PIN);
36
49
  });