File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -293,4 +293,19 @@ impl HWIClient {
293293 status. into ( )
294294 } )
295295 }
296+
297+ /// Toggle whether the device is using a BIP 39 passphrase.
298+ pub fn toggle_passphrase ( & self ) -> Result < ( ) , Error > {
299+ Python :: with_gil ( |py| {
300+ let func_args = ( & self . hw_client , ) ;
301+ let output = self
302+ . hwilib
303+ . commands
304+ . getattr ( py, "toggle_passphrase" ) ?
305+ . call1 ( py, func_args) ?;
306+ let output = self . hwilib . json_dumps . call1 ( py, ( output, ) ) ?;
307+ let status: HWIStatus = deserialize_obj ! ( & output. to_string( ) ) ?;
308+ status. into ( )
309+ } )
310+ }
296311}
Original file line number Diff line number Diff line change @@ -218,4 +218,10 @@ mod tests {
218218 HWIClient :: install_udev_rules ( None , None ) . unwrap ( )
219219 }
220220 }
221+
222+ #[ test]
223+ #[ serial]
224+ fn test_toggle_passphrase ( ) {
225+ get_first_device ( ) . toggle_passphrase ( ) . unwrap ( )
226+ }
221227}
You can’t perform that action at this time.
0 commit comments