Ejemplo n.º 1
0
 def ask_for_word(type):
     nonlocal mnem
     msg = "Enter one word of mnemonic: "
     word = ask_for_word_callback(msg, mnem.wordlist)
     if not word:
         raise exceptions.Cancelled
     return word
Ejemplo n.º 2
0
    def callback_WordRequest(self, msg):
        if msg.type in (trezor_proto.WordRequestType.Matrix9,
                        trezor_proto.WordRequestType.Matrix6):
            return self.callback_RecoveryMatrix(msg)

        msg = "Enter one word of mnemonic: "
        word = ask_for_word_callback(msg, self.__mnemonic.wordlist)
        if not word:
            raise HardwareWalletCancelException('Cancelled')
        return trezor_proto.WordAck(word=word)
Ejemplo n.º 3
0
 def ask_for_word(_type):
     nonlocal mnem
     if _type == 0:
         msg = "Enter one word of mnemonic: "
         word = ask_for_word_callback(msg, mnem.wordlist, parent_window)
         if not word:
             raise exceptions.Cancelled
         return word
     elif _type in (1, 2):
         # _type
         # 1: matrix has three columns
         # 2: matrix has two columns
         element = hw_common.ask_for_martix_element_callback(
             "<span>Select the matrix element that corresponds<br>"
             "to the part of the word displayed on<br>"
             "the device screen</span>",
             columns=3 if _type == 1 else 2,
             parent_window=parent_window)
         if element:
             return element
         else:
             raise exceptions.Cancelled
     else:
         raise exceptions.Cancelled
Ejemplo n.º 4
0
 def callback_WordRequest(self, msg):
     msg = "Enter one word of mnemonic: "
     word = ask_for_word_callback(msg, self.__mnemonic.wordlist)
     if not word:
         raise HardwareWalletCancelException('Cancelled')
     return keepkey_proto.WordAck(word=word)