@@ -34,11 +34,9 @@ def test_seedpicker_basic(self):
34
34
self .child .sendline ("generate_seed" )
35
35
self .child .expect ("Enter the first 23 words of your BIP39 seed phrase" )
36
36
self .child .sendline ("bacon " * 23 )
37
- # HACK
38
- # self.child.expect() doesn't work as expected because the prompts take place in the middle of a line
39
37
self .child .readline ()
40
- res = str (self .child .read (42 ))
41
- self .assertIn ("Use Mainnet? [y/N] " , res )
38
+ res = str (self .child .read (20 ))
39
+ self .assertIn ("Use Mainnet?" , res )
42
40
self .child .sendline (is_mainnet )
43
41
self .child .expect ("Last word: bacon" )
44
42
for _ in range (5 ):
@@ -53,18 +51,16 @@ def test_receive_addr(self):
53
51
self .child .sendline ("receive" )
54
52
for _ in range (6 ):
55
53
self .child .readline ()
56
- res = str (self .child .read (70 ))
54
+ res = str (self .child .read (50 ))
57
55
self .assertIn ("Paste in your account map (AKA output record)" , res )
58
56
self .child .sendline (account_map )
59
57
self .child .readline ()
60
- res = str (self .child .read (60 ))
58
+ res = str (self .child .read (40 ))
61
59
self .assertIn ("Limit of addresses to display" , res )
62
60
self .child .sendline ("1" )
63
- res = str (self .child .read (60 ))
61
+ self .child .readline ()
62
+ res = str (self .child .read (40 ))
64
63
self .assertIn ("Offset of addresses to display" , res )
65
- if False :
66
- # FIXME: verify this
67
- self .child .sendline ("N" )
68
64
self .child .sendline ("0" )
69
65
self .child .expect ("1-of-2 Multisig Receive Addresses" )
70
66
self .child .expect (receive_addr )
@@ -76,17 +72,22 @@ def test_change_addr(self):
76
72
self .child .sendline ("advanced_mode" )
77
73
self .child .expect ("ADVANCED mode set" )
78
74
self .child .sendline ("receive" )
79
- res = str (self .child .read (115 ))
75
+ self .child .readline ()
76
+ self .child .readline ()
77
+ res = str (self .child .read (50 ))
80
78
self .assertIn ("Paste in your account map (AKA output record)" , res )
81
79
self .child .sendline (account_map )
82
80
self .child .readline ()
83
- res = str (self .child .read (60 ))
81
+ res = str (self .child .read (40 ))
84
82
self .assertIn ("Limit of addresses to display" , res )
85
83
self .child .sendline ("1" )
86
- res = str (self .child .read (60 ))
84
+ self .child .readline ()
85
+ res = str (self .child .read (40 ))
87
86
self .assertIn ("Offset of addresses to display" , res )
88
87
self .child .sendline ("0" )
89
- # FIXME: verify this
88
+ self .child .readline ()
89
+ res = str (self .child .read (80 ))
90
+ self .assertIn ("Display receive addresses?" , res )
90
91
self .child .sendline ("N" )
91
92
self .child .expect ("1-of-2 Multisig Change Addresses" )
92
93
self .child .expect (change_addr )
@@ -98,17 +99,19 @@ def test_sign_tx(self):
98
99
signed_psbt_b64 = "cHNidP8BAFICAAAAASqJ31Trzpdt/MCBc1rpqmJyTcrhHNgqYqmsoDzHoklrAQAAAAD+////AYcmAAAAAAAAFgAUVH5mMP/WhqzXEzUORHbh1WJ7TS4AAAAAAAEBKxAnAAAAAAAAIgAgW8ODIeZA3ep/uESxtEZmQlxl4Q0QWWbe4I7x3aHuEvAiAgI0eOoa6SLJeaxzFWRXvzgWElJmJgyZMSfbSZ7plUxF9kgwRQIhAKTtWurRx19SWBS0G50IkvEDqbdZG2Q0KuTPB3BRWUCoAiBBWAtAQdmL+uV7aMwcJIacsFtYzrGagkhf6ZfEySXPXgEBBYtRIQI0eOoa6SLJeaxzFWRXvzgWElJmJgyZMSfbSZ7plUxF9iECYYmlbj1NXorYlB1Ed7jOwa4nt+xwhePNaxnQW53o6lQhApaCK4Vcv04C6td57v3zGuHGrrVjXQEMKwKbbS8GHrkKIQLEV1INwWxsAYHEj/ElyUDHWQOxdbsfQzP2LT4IRZmWY1SuIgYCNHjqGukiyXmscxVkV784FhJSZiYMmTEn20me6ZVMRfYc99BAkDAAAIABAACAAAAAgAIAAIAAAAAABgAAACIGAmGJpW49TV6K2JQdRHe4zsGuJ7fscIXjzWsZ0Fud6OpUHDpStc0wAACAAQAAgAAAAIACAACAAAAAAAYAAAAiBgKWgiuFXL9OAurXee798xrhxq61Y10BDCsCm20vBh65ChwSmA7tMAAAgAEAAIAAAACAAgAAgAAAAAAGAAAAIgYCxFdSDcFsbAGBxI/xJclAx1kDsXW7H0Mz9i0+CEWZlmMcx9BkijAAAIABAACAAAAAgAIAAIAAAAAABgAAAAAA"
99
100
100
101
self .child .sendline ("send" )
101
- res = str (self .child .read (220 ))
102
+ for _ in range (6 ):
103
+ self .child .readline ()
104
+ res = str (self .child .read (50 ))
102
105
self .assertIn ("Paste in your account map (AKA output record)" , res )
103
106
self .child .sendline (account_map )
104
107
self .child .readline ()
105
- res = str (self .child .read (90 ))
108
+ res = str (self .child .read (70 ))
106
109
self .assertIn (
107
110
"Paste partially signed bitcoin transaction (PSBT) in base64 form" , res
108
111
)
109
112
self .child .sendline (unsigned_psbt_b64 )
110
113
self .child .readline ()
111
- res = str (self .child .read (100 ))
114
+ res = str (self .child .read (75 ))
112
115
self .assertIn (
113
116
"Transaction appears to be a testnet transaction. Display as testnet?" , res
114
117
)
@@ -128,18 +131,21 @@ def test_sign_tx(self):
128
131
)
129
132
for _ in range (19 ):
130
133
self .child .readline ()
131
- res = str (self .child .read (45 ))
132
- self .assertIn ("Sign this transaction? [Y/n] " , res )
134
+ res = str (self .child .read (30 ))
135
+ self .assertIn ("Sign this transaction?" , res )
133
136
self .child .sendline ("Y" )
134
- res = str (self .child .read (62 ))
137
+ self .child .readline ()
138
+ res = str (self .child .read (40 ))
135
139
self .assertIn ("Enter your full BIP39 seed phrase" , res )
136
140
self .child .sendline (seed_phrase )
137
141
self .child .readline ()
138
- res = str (self .child .read (70 ))
139
- self .assertIn ("Use a passphrase (advanced users only)? [y/N] " , res )
142
+ res = str (self .child .read (50 ))
143
+ self .assertIn ("Use a passphrase (advanced users only)?" , res )
140
144
self .child .sendline ("N" )
141
145
self .child .expect ("Signed PSBT to broadcast" )
142
- res = str (self .child .read (890 ))
146
+ self .child .readline ()
147
+ self .child .readline ()
148
+ res = str (self .child .readline ())
143
149
self .assertIn (signed_psbt_b64 , res )
144
150
145
151
def test_fail (self ):
0 commit comments