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') {