SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
3 changed files with
7 additions and
8 deletions
-
electrum/bitcoin.py
-
electrum/ecc.py
-
electrum/gui/qt/installwizard.py
|
|
@ -24,7 +24,7 @@ |
|
|
|
# SOFTWARE. |
|
|
|
|
|
|
|
import hashlib |
|
|
|
from typing import List |
|
|
|
from typing import List, Tuple |
|
|
|
|
|
|
|
from .util import bfh, bh2u, BitcoinException, print_error, assert_bytes, to_bytes, inv_dict |
|
|
|
from . import version |
|
|
@ -433,7 +433,7 @@ def serialize_privkey(secret: bytes, compressed: bool, txin_type: str, |
|
|
|
return '{}:{}'.format(txin_type, base58_wif) |
|
|
|
|
|
|
|
|
|
|
|
def deserialize_privkey(key: str) -> (str, bytes, bool): |
|
|
|
def deserialize_privkey(key: str) -> Tuple[str, bytes, bool]: |
|
|
|
if is_minikey(key): |
|
|
|
return 'p2pkh', minikey_to_private_key(key), False |
|
|
|
|
|
|
|
|
|
@ -24,10 +24,8 @@ |
|
|
|
# SOFTWARE. |
|
|
|
|
|
|
|
import base64 |
|
|
|
import hmac |
|
|
|
import hashlib |
|
|
|
from typing import Union |
|
|
|
|
|
|
|
from typing import Union, Tuple |
|
|
|
|
|
|
|
import ecdsa |
|
|
|
from ecdsa.ecdsa import curve_secp256k1, generator_secp256k1 |
|
|
@ -110,7 +108,7 @@ def get_y_coord_from_x(x: int, odd: bool=True) -> int: |
|
|
|
raise InvalidECPointException() |
|
|
|
|
|
|
|
|
|
|
|
def ser_to_point(ser: bytes) -> (int, int): |
|
|
|
def ser_to_point(ser: bytes) -> Tuple[int, int]: |
|
|
|
if ser[0] not in (0x02, 0x03, 0x04): |
|
|
|
raise ValueError('Unexpected first byte: {}'.format(ser[0])) |
|
|
|
if ser[0] == 0x04: |
|
|
@ -227,7 +225,7 @@ class ECPubkey(object): |
|
|
|
def get_public_key_hex(self, compressed=True): |
|
|
|
return bh2u(self.get_public_key_bytes(compressed)) |
|
|
|
|
|
|
|
def point(self) -> (int, int): |
|
|
|
def point(self) -> Tuple[int, int]: |
|
|
|
return self._pubkey.point.x(), self._pubkey.point.y() |
|
|
|
|
|
|
|
def __mul__(self, other: int): |
|
|
|
|
|
@ -3,6 +3,7 @@ import os |
|
|
|
import sys |
|
|
|
import threading |
|
|
|
import traceback |
|
|
|
from typing import Tuple |
|
|
|
|
|
|
|
from PyQt5.QtCore import * |
|
|
|
from PyQt5.QtGui import * |
|
|
@ -506,7 +507,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): |
|
|
|
|
|
|
|
@wizard_dialog |
|
|
|
def choice_and_line_dialog(self, title, message1, choices, message2, |
|
|
|
test_text, run_next) -> (str, str): |
|
|
|
test_text, run_next) -> Tuple[str, str]: |
|
|
|
vbox = QVBoxLayout() |
|
|
|
|
|
|
|
c_values = [x[0] for x in choices] |
|
|
|