Beispiel #1
0
 def get_xpub(self, device_id, derivation, xtype, wizard):
     if xtype not in self.SUPPORTED_XTYPES:
         raise ScriptTypeNotSupported(_('This type of script is not supported with {}.').format(self.device))
     if is_all_public_derivation(derivation):
         raise Exception(f"The {self.device} does not reveal xpubs corresponding to non-hardened paths. (path: {derivation})")
     devmgr = self.device_manager()
     client = devmgr.client_by_id(device_id)
     client.handler = self.create_handler(wizard)
     client.check_device_dialog()
     xpub = client.get_xpub(derivation, xtype)
     return xpub
Beispiel #2
0
 def test_is_all_public_derivation(self):
     self.assertFalse(is_all_public_derivation("m/0/1'/1'"))
     self.assertFalse(is_all_public_derivation("m/0/2/1'"))
     self.assertFalse(is_all_public_derivation("m/0/1'/1'/5"))
     self.assertTrue(is_all_public_derivation("m"))
     self.assertTrue(is_all_public_derivation("m/0"))
     self.assertTrue(is_all_public_derivation("m/75/22/3"))