From b621c58b0644824915137b8d4c58e4a787636858 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Mon, 19 Aug 2024 15:38:04 +0200 Subject: [PATCH] fixup! fixup! fixup! fixup! fixup! fixup! wip --- packages/connect/test-e2e.js | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/packages/connect/test-e2e.js b/packages/connect/test-e2e.js index 97651fdb2f1a..93a622fe395d 100644 --- a/packages/connect/test-e2e.js +++ b/packages/connect/test-e2e.js @@ -18,6 +18,26 @@ const initDebugLink = async () => { } }; +const debugLinkState = async () => { + const enumerate = await debugTransport.enumerate().promise; + console.warn('DebugLinkGetState enumerate', enumerate); + if (!enumerate.success) { + return; + } + const acquire = await debugTransport.acquire({ input: enumerate.payload[0] }).promise; + + await debugTransport + .call({ name: 'DebugLinkGetState', data: {}, session: acquire.payload }) + .promise.then(res => { + console.warn('DebugLinkGetState result ', res); + + return res; + }); + + await debugTransport.release(enumerate.payload[0]).promise; + await debugTransport.enumerate().promise; +}; + const debugLinkDecision = async () => { const enumerate = await debugTransport.enumerate().promise; console.warn('debugLinkDecision enumerate', enumerate); @@ -129,16 +149,17 @@ const run = async () => { } if (event.type === 'ui-request_thp_pairing') { + const state = await debugLinkState(); // TODO: TrezorConnect.cancel(); // await new Promise(resolve => setTimeout(resolve, 2000)); // TrezorConnect.cancel(); - TrezorConnect.uiResponse({ - type: 'ui-receive_thp_pairing_tag', - payload: { - source: 'code-entry', - value: '000000', // get from debuglink - }, - }); + // TrezorConnect.uiResponse({ + // type: 'ui-receive_thp_pairing_tag', + // payload: { + // source: 'code-entry', + // value: '000000', // get from debuglink + // }, + // }); } if (event.type === 'ui-button') {