Beispiel #1
0
 def on_edit(self):
     from vialectrum.bitcoin import seed_type
     s = self.get_seed()
     b = self.is_seed(s)
     if not self.is_bip39:
         t = seed_type(s)
         label = _('Seed Type') + ': ' + t if t else ''
     else:
         from vialectrum.keystore import bip39_is_checksum_valid
         is_checksum, is_wordlist = bip39_is_checksum_valid(s)
         status = ('checksum: ' + ('ok' if is_checksum else 'failed')
                   ) if is_wordlist else 'unknown wordlist'
         label = 'BIP39' + ' (%s)' % status
     self.seed_type_label.setText(label)
     self.parent.next_button.setEnabled(b)
Beispiel #2
0
    def on_edit(self):
        s = self.get_seed()
        b = self.is_seed(s)
        if not self.is_bip39:
            t = seed_type(s)
            label = _('Seed Type') + ': ' + t if t else ''
        else:
            from vialectrum.keystore import bip39_is_checksum_valid
            is_checksum, is_wordlist = bip39_is_checksum_valid(s)
            status = ('checksum: ' + ('ok' if is_checksum else 'failed')
                      ) if is_wordlist else 'unknown wordlist'
            label = 'BIP39' + ' (%s)' % status
        self.seed_type_label.setText(label)
        self.parent.next_button.setEnabled(b)

        # to account for bip39 seeds
        for word in self.get_seed().split(" ")[:-1]:
            if word not in self.wordlist:
                self.seed_e.disable_suggestions()
                return
        self.seed_e.enable_suggestions()
Beispiel #3
0
 def test(self):
     mnemonic = u'gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog'
     is_checksum_valid, is_wordlist_valid = keystore.bip39_is_checksum_valid(
         mnemonic)
     self.assertTrue(is_wordlist_valid)
     self.assertTrue(is_checksum_valid)
Beispiel #4
0
 def test(self):
     mnemonic = u'gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog'
     is_checksum_valid, is_wordlist_valid = keystore.bip39_is_checksum_valid(mnemonic)
     self.assertTrue(is_wordlist_valid)
     self.assertTrue(is_checksum_valid)