@@ -13,8 +13,8 @@ const SPECULOS_BASE_URL: string = `http://127.0.0.1:${API_PORT}`;
13
13
14
14
// Before running the tests you need to install speculos and start the iota app with it.
15
15
// If the binary is not available, download it:
16
- // gh release download --repo https://github.com/iotaledger/ledger-app-iota -p nanos .tar.gz ledger-app-iota-v0.9.2
17
- // tar -xvf nanos .tar.gz
16
+ // gh release download --repo https://github.com/iotaledger/ledger-app-iota -p nanox .tar.gz ledger-app-iota-v0.9.2
17
+ // tar -xvf nanox .tar.gz
18
18
// sudo apt-get install qemu-user-static libxcb-xinerama0 // might be needed for speculos to work
19
19
// pip install speculos
20
20
// Finally to start the emulator:
@@ -38,7 +38,7 @@ describe.sequential('Test ledgerjs-hw-app-iota', () => {
38
38
) ;
39
39
} ) ;
40
40
41
- it ( 'Test address generation with display' , async ( ) => {
41
+ it ( 'Test address generation with display' , { timeout : 10000 } , async ( ) => {
42
42
const transport = await SpeculosHttpTransport . open ( { } ) ;
43
43
const ledgerClient = new Iota ( transport ) ;
44
44
@@ -55,18 +55,18 @@ describe.sequential('Test ledgerjs-hw-app-iota', () => {
55
55
. catch ( ( err ) => {
56
56
throw new Error ( err ) ;
57
57
} ) ;
58
- await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) ) ;
59
58
// Send requests to approve the shown address
60
- for ( let i = 0 ; i < 6 ; i ++ ) {
59
+ for ( let i = 0 ; i < 3 ; i ++ ) {
61
60
await Axios . post ( SPECULOS_BASE_URL + '/button/right' , { action : 'press-and-release' } ) ;
62
61
}
63
62
await Axios . post ( SPECULOS_BASE_URL + '/button/both' , { action : 'press-and-release' } ) ;
63
+ await new Promise ( ( r ) => setInterval ( r , 4000 ) ) ;
64
64
if ( ! addressReceived ) {
65
65
throw new Error ( `Didn't receive address in time` ) ;
66
66
}
67
67
} ) ;
68
68
69
- it ( 'Test signing' , { timeout : 10000 } , async ( ) => {
69
+ it ( 'Test signing' , { timeout : 20000 } , async ( ) => {
70
70
const transport = await SpeculosHttpTransport . open ( { } ) ;
71
71
const ledgerClient = new Iota ( transport ) ;
72
72
let signatureReceived = false ;
@@ -91,20 +91,19 @@ describe.sequential('Test ledgerjs-hw-app-iota', () => {
91
91
} ) ;
92
92
await new Promise ( ( resolve ) => setTimeout ( resolve , 500 ) ) ;
93
93
// Send requests to approve the tx
94
- for ( let i = 0 ; i < 14 ; i ++ ) {
94
+ for ( let i = 0 ; i < 7 ; i ++ ) {
95
95
await Axios . post ( SPECULOS_BASE_URL + '/button/right' , { action : 'press-and-release' } ) ;
96
96
}
97
97
await Axios . post ( SPECULOS_BASE_URL + '/button/both' , { action : 'press-and-release' } ) ;
98
- await new Promise ( ( resolve ) => setTimeout ( resolve , 2000 ) ) ;
98
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 6000 ) ) ;
99
99
if ( ! signatureReceived ) {
100
100
throw new Error ( `Didn't receive signature in time` ) ;
101
101
}
102
102
} ) ;
103
103
104
- it ( 'Test blind signing' , { timeout : 10000 } , async ( ) => {
104
+ it ( 'Test blind signing' , { timeout : 20000 } , async ( ) => {
105
105
// Enable blind signing
106
106
await Axios . post ( SPECULOS_BASE_URL + '/button/right' , { action : 'press-and-release' } ) ;
107
- await Axios . post ( SPECULOS_BASE_URL + '/button/right' , { action : 'press-and-release' } ) ;
108
107
await Axios . post ( SPECULOS_BASE_URL + '/button/both' , { action : 'press-and-release' } ) ;
109
108
await Axios . post ( SPECULOS_BASE_URL + '/button/both' , { action : 'press-and-release' } ) ;
110
109
await Axios . post ( SPECULOS_BASE_URL + '/button/right' , { action : 'press-and-release' } ) ;
@@ -134,11 +133,12 @@ describe.sequential('Test ledgerjs-hw-app-iota', () => {
134
133
} ) ;
135
134
await new Promise ( ( resolve ) => setTimeout ( resolve , 500 ) ) ;
136
135
// Send requests to approve the tx
137
- for ( let i = 0 ; i < 8 ; i ++ ) {
136
+ await Axios . post ( SPECULOS_BASE_URL + '/button/both' , { action : 'press-and-release' } ) ;
137
+ for ( let i = 0 ; i < 3 ; i ++ ) {
138
138
await Axios . post ( SPECULOS_BASE_URL + '/button/right' , { action : 'press-and-release' } ) ;
139
139
}
140
140
await Axios . post ( SPECULOS_BASE_URL + '/button/both' , { action : 'press-and-release' } ) ;
141
- await new Promise ( ( resolve ) => setTimeout ( resolve , 2000 ) ) ;
141
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 6000 ) ) ;
142
142
if ( ! signatureReceived ) {
143
143
throw new Error ( `Didn't receive signature in time` ) ;
144
144
}
0 commit comments