def _on_text_changed(self): """ The contents of the text area have changed. """ text = self.text_area.toPlainText().strip() new_text_matches = wallet_support.find_matching_text_import_types(text) if new_text_matches != self._text_matches: self._text_matches = new_text_matches self._label.setText(self._get_label_text())
def test_match_seed_word_types(self): for text in (SW_ESV_OLD, SW_ESV_NEW, SW_BIP39): matches = wallet_support.find_matching_text_import_types(text) self.assertEqual(matches, {wallet_support.TextImportTypes.PRIVATE_KEY_SEED})
def test_match_nothing(self): matches = wallet_support.find_matching_text_import_types(SW_NOTHING) self.assertEqual(matches, set([]))
def test_match_minikey(self): matches = wallet_support.find_matching_text_import_types(TI_MINIKEY) self.assertEqual(matches, {wallet_support.TextImportTypes.PRIVATE_KEY_MINIKEY})