From 8483acc9d5535bf59b8ab701c2af560fb158dc0d Mon Sep 17 00:00:00 2001 From: zebra-lucky Date: Sun, 11 Mar 2018 12:15:20 +0200 Subject: [PATCH] add Zcash code to plugins exclud. ledger/treror --- plugins/audio_modem/__init__.py | 2 +- plugins/audio_modem/qt.py | 8 +- plugins/cosigner_pool/__init__.py | 2 +- plugins/cosigner_pool/qt.py | 16 ++-- plugins/digitalbitbox/__init__.py | 2 +- plugins/digitalbitbox/cmdline.py | 2 +- plugins/digitalbitbox/digitalbitbox.py | 20 ++--- plugins/digitalbitbox/qt.py | 6 +- plugins/email_requests/__init__.py | 2 +- plugins/email_requests/qt.py | 18 ++-- plugins/greenaddress_instant/__init__.py | 5 -- plugins/greenaddress_instant/qt.py | 102 ----------------------- plugins/hw_wallet/cmdline.py | 2 +- plugins/hw_wallet/plugin.py | 4 +- plugins/hw_wallet/qt.py | 14 ++-- plugins/keepkey/__init__.py | 2 +- plugins/keepkey/clientbase.py | 10 +-- plugins/keepkey/cmdline.py | 2 +- plugins/keepkey/plugin.py | 14 ++-- plugins/keepkey/qt_generic.py | 30 +++---- plugins/labels/__init__.py | 2 +- plugins/labels/kivy.py | 2 +- plugins/labels/labels.py | 10 +-- plugins/labels/qt.py | 10 +-- plugins/virtualkeyboard/__init__.py | 2 +- plugins/virtualkeyboard/qt.py | 4 +- 26 files changed, 93 insertions(+), 200 deletions(-) delete mode 100644 plugins/greenaddress_instant/__init__.py delete mode 100644 plugins/greenaddress_instant/qt.py diff --git a/plugins/audio_modem/__init__.py b/plugins/audio_modem/__init__.py index 46c2d209..96f71e21 100644 --- a/plugins/audio_modem/__init__.py +++ b/plugins/audio_modem/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = _('Audio MODEM') description = _('Provides support for air-gapped transaction signing.') diff --git a/plugins/audio_modem/qt.py b/plugins/audio_modem/qt.py index 254988b9..b2d951db 100644 --- a/plugins/audio_modem/qt.py +++ b/plugins/audio_modem/qt.py @@ -5,10 +5,10 @@ from io import BytesIO import sys import platform -from electrum.plugins import BasePlugin, hook -from electrum_gui.qt.util import WaitingDialog, EnterButton, WindowModalDialog -from electrum.util import print_msg, print_error -from electrum.i18n import _ +from electrum_zcash.plugins import BasePlugin, hook +from electrum_zcash_gui.qt.util import WaitingDialog, EnterButton, WindowModalDialog +from electrum_zcash.util import print_msg, print_error +from electrum_zcash.i18n import _ from PyQt5.QtGui import * from PyQt5.QtCore import * diff --git a/plugins/cosigner_pool/__init__.py b/plugins/cosigner_pool/__init__.py index 085b5095..8180654b 100644 --- a/plugins/cosigner_pool/__init__.py +++ b/plugins/cosigner_pool/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = _('Cosigner Pool') description = ' '.join([ _("This plugin facilitates the use of multi-signatures wallets."), diff --git a/plugins/cosigner_pool/qt.py b/plugins/cosigner_pool/qt.py index e9ee8ad6..58957382 100644 --- a/plugins/cosigner_pool/qt.py +++ b/plugins/cosigner_pool/qt.py @@ -30,14 +30,14 @@ from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import QPushButton -from electrum import bitcoin, util -from electrum import transaction -from electrum.plugins import BasePlugin, hook -from electrum.i18n import _ -from electrum.wallet import Multisig_Wallet -from electrum.util import bh2u, bfh +from electrum_zcash import bitcoin, util +from electrum_zcash import transaction +from electrum_zcash.plugins import BasePlugin, hook +from electrum_zcash.i18n import _ +from electrum_zcash.wallet import Multisig_Wallet +from electrum_zcash.util import bh2u, bfh -from electrum_gui.qt.transaction_dialog import show_transaction +from electrum_zcash_gui.qt.transaction_dialog import show_transaction import sys import traceback @@ -162,7 +162,7 @@ class Plugin(BasePlugin): d.cosigner_send_button.hide() def cosigner_can_sign(self, tx, cosigner_xpub): - from electrum.keystore import is_xpubkey, parse_xpubkey + from electrum_zcash.keystore import is_xpubkey, parse_xpubkey xpub_set = set([]) for txin in tx.inputs(): for x_pubkey in txin['x_pubkeys']: diff --git a/plugins/digitalbitbox/__init__.py b/plugins/digitalbitbox/__init__.py index 5653d616..6bf59b38 100644 --- a/plugins/digitalbitbox/__init__.py +++ b/plugins/digitalbitbox/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = 'Digital Bitbox' description = _('Provides support for Digital Bitbox hardware wallet') diff --git a/plugins/digitalbitbox/cmdline.py b/plugins/digitalbitbox/cmdline.py index 7902c98a..21e7ed94 100644 --- a/plugins/digitalbitbox/cmdline.py +++ b/plugins/digitalbitbox/cmdline.py @@ -1,4 +1,4 @@ -from electrum.plugins import hook +from electrum_zcash.plugins import hook from .digitalbitbox import DigitalBitboxPlugin from ..hw_wallet import CmdLineHandler diff --git a/plugins/digitalbitbox/digitalbitbox.py b/plugins/digitalbitbox/digitalbitbox.py index f283750e..8aafd24e 100644 --- a/plugins/digitalbitbox/digitalbitbox.py +++ b/plugins/digitalbitbox/digitalbitbox.py @@ -4,14 +4,14 @@ # try: - import electrum - from electrum.bitcoin import TYPE_ADDRESS, push_script, var_int, msg_magic, Hash, verify_message, pubkey_from_signature, point_to_ser, public_key_to_p2pkh, EncodeAES, DecodeAES, MyVerifyingKey - from electrum.bitcoin import serialize_xpub, deserialize_xpub - from electrum.transaction import Transaction - from electrum.i18n import _ - from electrum.keystore import Hardware_KeyStore + import electrum_zcash + from electrum_zcash.bitcoin import TYPE_ADDRESS, push_script, var_int, msg_magic, Hash, verify_message, pubkey_from_signature, point_to_ser, public_key_to_p2pkh, EncodeAES, DecodeAES, MyVerifyingKey + from electrum_zcash.bitcoin import serialize_xpub, deserialize_xpub + from electrum_zcash.transaction import Transaction + from electrum_zcash.i18n import _ + from electrum_zcash.keystore import Hardware_KeyStore from ..hw_wallet import HW_PluginBase - from electrum.util import print_error, to_string, UserCancelled + from electrum_zcash.util import print_error, to_string, UserCancelled import time import hid @@ -270,8 +270,8 @@ class DigitalBitbox_Client(): def dbb_generate_wallet(self): key = self.stretch_key(self.password) - filename = ("Electrum-" + time.strftime("%Y-%m-%d-%H-%M-%S") + ".pdf").encode('utf8') - msg = b'{"seed":{"source": "create", "key": "%s", "filename": "%s", "entropy": "%s"}}' % (key, filename, b'Digital Bitbox Electrum Plugin') + filename = ("Electrum-Zcash-" + time.strftime("%Y-%m-%d-%H-%M-%S") + ".pdf").encode('utf8') + msg = b'{"seed":{"source": "create", "key": "%s", "filename": "%s", "entropy": "%s"}}' % (key, filename, b'Digital Bitbox Electrum-Zcash Plugin') reply = self.hid_send_encrypt(msg) if 'error' in reply: raise Exception(reply['error']['message']) @@ -675,7 +675,7 @@ class DigitalBitboxPlugin(HW_PluginBase): client = devmgr.client_by_id(device_id) client.handler = self.create_handler(wizard) client.setupRunning = True - client.get_xpub("m/44'/0'", 'standard') + client.get_xpub("m/44'/133'", 'standard') def is_mobile_paired(self): diff --git a/plugins/digitalbitbox/qt.py b/plugins/digitalbitbox/qt.py index 389dcdb5..109eb180 100644 --- a/plugins/digitalbitbox/qt.py +++ b/plugins/digitalbitbox/qt.py @@ -1,9 +1,9 @@ from ..hw_wallet.qt import QtHandlerBase, QtPluginBase from .digitalbitbox import DigitalBitboxPlugin -from electrum.i18n import _ -from electrum.plugins import hook -from electrum.wallet import Standard_Wallet +from electrum_zcash.i18n import _ +from electrum_zcash.plugins import hook +from electrum_zcash.wallet import Standard_Wallet class Plugin(DigitalBitboxPlugin, QtPluginBase): diff --git a/plugins/email_requests/__init__.py b/plugins/email_requests/__init__.py index 8c9e8247..f55b337c 100644 --- a/plugins/email_requests/__init__.py +++ b/plugins/email_requests/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = _('Email') description = _("Send and receive payment request with an email account") diff --git a/plugins/email_requests/qt.py b/plugins/email_requests/qt.py index 64061841..1c1719fe 100644 --- a/plugins/email_requests/qt.py +++ b/plugins/email_requests/qt.py @@ -40,11 +40,11 @@ from PyQt5.QtCore import * import PyQt5.QtGui as QtGui from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QLineEdit) -from electrum.plugins import BasePlugin, hook -from electrum.paymentrequest import PaymentRequest -from electrum.i18n import _ -from electrum_gui.qt.util import EnterButton, Buttons, CloseButton -from electrum_gui.qt.util import OkButton, WindowModalDialog +from electrum_zcash.plugins import BasePlugin, hook +from electrum_zcash.paymentrequest import PaymentRequest +from electrum_zcash.i18n import _ +from electrum_zcash_gui.qt.util import EnterButton, Buttons, CloseButton +from electrum_zcash_gui.qt.util import OkButton, WindowModalDialog class Processor(threading.Thread): @@ -72,7 +72,7 @@ class Processor(threading.Thread): p = [p] continue for item in p: - if item.get_content_type() == "application/bitcoin-paymentrequest": + if item.get_content_type() == "application/zcash-paymentrequest": pr_str = item.get_payload() pr_str = base64.b64decode(pr_str) self.on_receive(pr_str) @@ -91,10 +91,10 @@ class Processor(threading.Thread): msg['Subject'] = message msg['To'] = recipient msg['From'] = self.username - part = MIMEBase('application', "bitcoin-paymentrequest") + part = MIMEBase('application', "zcash-paymentrequest") part.set_payload(payment_request) encode_base64(part) - part.add_header('Content-Disposition', 'attachment; filename="payreq.btc"') + part.add_header('Content-Disposition', 'attachment; filename="payreq.zec"') msg.attach(part) s = smtplib.SMTP_SSL(self.imap_server, timeout=2) s.login(self.username, self.password) @@ -143,7 +143,7 @@ class Plugin(BasePlugin): menu.addAction(_("Send via e-mail"), lambda: self.send(window, addr)) def send(self, window, addr): - from electrum import paymentrequest + from electrum_zcash import paymentrequest r = window.wallet.receive_requests.get(addr) message = r.get('memo', '') if r.get('signature'): diff --git a/plugins/greenaddress_instant/__init__.py b/plugins/greenaddress_instant/__init__.py deleted file mode 100644 index d2b31785..00000000 --- a/plugins/greenaddress_instant/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from electrum.i18n import _ - -fullname = 'GreenAddress instant' -description = _("Allows validating if your transactions have instant confirmations by GreenAddress") -available_for = ['qt'] diff --git a/plugins/greenaddress_instant/qt.py b/plugins/greenaddress_instant/qt.py deleted file mode 100644 index 5a01091e..00000000 --- a/plugins/greenaddress_instant/qt.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env python -# -# Electrum - lightweight Bitcoin client -# Copyright (C) 2014 Thomas Voegtlin -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -import base64 -import urllib.parse -import sys -import requests - -from PyQt5.QtWidgets import QApplication, QPushButton - -from electrum.plugins import BasePlugin, hook -from electrum.i18n import _ - - - -class Plugin(BasePlugin): - - button_label = _("Verify GA instant") - - @hook - def transaction_dialog(self, d): - d.verify_button = QPushButton(self.button_label) - d.verify_button.clicked.connect(lambda: self.do_verify(d)) - d.buttons.insert(0, d.verify_button) - self.transaction_dialog_update(d) - - def get_my_addr(self, d): - """Returns the address for given tx which can be used to request - instant confirmation verification from GreenAddress""" - for addr, _ in d.tx.get_outputs(): - if d.wallet.is_mine(addr): - return addr - return None - - @hook - def transaction_dialog_update(self, d): - if d.tx.is_complete() and self.get_my_addr(d): - d.verify_button.show() - else: - d.verify_button.hide() - - def do_verify(self, d): - tx = d.tx - wallet = d.wallet - window = d.main_window - # 1. get the password and sign the verification request - password = None - if wallet.has_password(): - msg = _('GreenAddress requires your signature \n' - 'to verify that transaction is instant.\n' - 'Please enter your password to sign a\n' - 'verification request.') - password = window.password_dialog(msg, parent=d) - if not password: - return - try: - d.verify_button.setText(_('Verifying...')) - QApplication.processEvents() # update the button label - - addr = self.get_my_addr(d) - message = "Please verify if %s is GreenAddress instant confirmed" % tx.txid() - sig = wallet.sign_message(addr, message, password) - sig = base64.b64encode(sig).decode('ascii') - - # 2. send the request - response = requests.request("GET", ("https://greenaddress.it/verify/?signature=%s&txhash=%s" % (urllib.parse.quote(sig), tx.txid())), - headers = {'User-Agent': 'Electrum'}) - response = response.json() - - # 3. display the result - if response.get('verified'): - d.show_message(_('%s is covered by GreenAddress instant confirmation') % (tx.txid()), title=_('Verification successful!')) - else: - d.show_critical(_('%s is not covered by GreenAddress instant confirmation') % (tx.txid()), title=_('Verification failed!')) - except BaseException as e: - import traceback - traceback.print_exc(file=sys.stdout) - d.show_error(str(e)) - finally: - d.verify_button.setText(self.button_label) diff --git a/plugins/hw_wallet/cmdline.py b/plugins/hw_wallet/cmdline.py index 999f8299..1a642669 100644 --- a/plugins/hw_wallet/cmdline.py +++ b/plugins/hw_wallet/cmdline.py @@ -1,4 +1,4 @@ -from electrum.util import print_msg, print_error, raw_input +from electrum_zcash.util import print_msg, print_error, raw_input class CmdLineHandler: diff --git a/plugins/hw_wallet/plugin.py b/plugins/hw_wallet/plugin.py index 6ed8635f..77531c83 100644 --- a/plugins/hw_wallet/plugin.py +++ b/plugins/hw_wallet/plugin.py @@ -24,8 +24,8 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from electrum.plugins import BasePlugin, hook -from electrum.i18n import _ +from electrum_zcash.plugins import BasePlugin, hook +from electrum_zcash.i18n import _ class HW_PluginBase(BasePlugin): diff --git a/plugins/hw_wallet/qt.py b/plugins/hw_wallet/qt.py index bd7cc223..88a44dfc 100644 --- a/plugins/hw_wallet/qt.py +++ b/plugins/hw_wallet/qt.py @@ -27,11 +27,11 @@ import threading from PyQt5.Qt import QVBoxLayout, QLabel -from electrum_gui.qt.password_dialog import PasswordDialog, PW_PASSPHRASE -from electrum_gui.qt.util import * +from electrum_zcash_gui.qt.password_dialog import PasswordDialog, PW_PASSPHRASE +from electrum_zcash_gui.qt.util import * -from electrum.i18n import _ -from electrum.util import PrintError +from electrum_zcash.i18n import _ +from electrum_zcash.util import PrintError # The trickiest thing about this handler was getting windows properly # parented on MacOSX. @@ -171,9 +171,9 @@ class QtHandlerBase(QObject, PrintError): -from electrum.plugins import hook -from electrum.util import UserCancelled -from electrum_gui.qt.main_window import StatusBarButton +from electrum_zcash.plugins import hook +from electrum_zcash.util import UserCancelled +from electrum_zcash_gui.qt.main_window import StatusBarButton class QtPluginBase(object): diff --git a/plugins/keepkey/__init__.py b/plugins/keepkey/__init__.py index 0b54bc4a..c807c28e 100644 --- a/plugins/keepkey/__init__.py +++ b/plugins/keepkey/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = 'KeepKey' description = _('Provides support for KeepKey hardware wallet') diff --git a/plugins/keepkey/clientbase.py b/plugins/keepkey/clientbase.py index de7d47c1..38611f25 100644 --- a/plugins/keepkey/clientbase.py +++ b/plugins/keepkey/clientbase.py @@ -1,10 +1,10 @@ import time from struct import pack -from electrum.i18n import _ -from electrum.util import PrintError, UserCancelled -from electrum.keystore import bip39_normalize_passphrase -from electrum.bitcoin import serialize_xpub +from electrum_zcash.i18n import _ +from electrum_zcash.util import PrintError, UserCancelled +from electrum_zcash.keystore import bip39_normalize_passphrase +from electrum_zcash.bitcoin import serialize_xpub class GuiMixin(object): @@ -59,7 +59,7 @@ class GuiMixin(object): msg = _("Enter a passphrase to generate this wallet. Each time " "you use this wallet your %s will prompt you for the " "passphrase. If you forget the passphrase you cannot " - "access the bitcoins in the wallet.") % self.device + "access the Zcash coins in the wallet.") % self.device else: msg = _("Enter the passphrase to unlock this wallet:") passphrase = self.handler.get_passphrase(msg, self.creating_wallet) diff --git a/plugins/keepkey/cmdline.py b/plugins/keepkey/cmdline.py index cd30bc0c..9c1b7fd1 100644 --- a/plugins/keepkey/cmdline.py +++ b/plugins/keepkey/cmdline.py @@ -1,4 +1,4 @@ -from electrum.plugins import hook +from electrum_zcash.plugins import hook from .keepkey import KeepKeyPlugin from ..hw_wallet import CmdLineHandler diff --git a/plugins/keepkey/plugin.py b/plugins/keepkey/plugin.py index f0d747fd..5d5dc2a7 100644 --- a/plugins/keepkey/plugin.py +++ b/plugins/keepkey/plugin.py @@ -2,13 +2,13 @@ import threading from binascii import hexlify, unhexlify -from electrum.util import bfh, bh2u -from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, +from electrum_zcash.util import bfh, bh2u +from electrum_zcash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants) -from electrum.i18n import _ -from electrum.plugins import BasePlugin -from electrum.transaction import deserialize -from electrum.keystore import Hardware_KeyStore, is_xpubkey, parse_xpubkey +from electrum_zcash.i18n import _ +from electrum_zcash.plugins import BasePlugin +from electrum_zcash.transaction import deserialize +from electrum_zcash.keystore import Hardware_KeyStore, is_xpubkey, parse_xpubkey from ..hw_wallet import HW_PluginBase @@ -134,7 +134,7 @@ class KeepKeyCompatiblePlugin(HW_PluginBase): return client def get_coin_name(self): - return "Testnet" if NetworkConstants.TESTNET else "Bitcoin" + return "Zcash Testnet" if NetworkConstants.TESTNET else "Zcash" def initialize_device(self, device_id, wizard, handler): # Initialization method diff --git a/plugins/keepkey/qt_generic.py b/plugins/keepkey/qt_generic.py index d564be6d..571d94a0 100644 --- a/plugins/keepkey/qt_generic.py +++ b/plugins/keepkey/qt_generic.py @@ -4,29 +4,29 @@ import threading from PyQt5.Qt import Qt from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton from PyQt5.Qt import QVBoxLayout, QLabel -from electrum_gui.qt.util import * +from electrum_zcash_gui.qt.util import * from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC from ..hw_wallet.qt import QtHandlerBase, QtPluginBase -from electrum.i18n import _ -from electrum.plugins import hook, DeviceMgr -from electrum.util import PrintError, UserCancelled, bh2u -from electrum.wallet import Wallet, Standard_Wallet +from electrum_zcash.i18n import _ +from electrum_zcash.plugins import hook, DeviceMgr +from electrum_zcash.util import PrintError, UserCancelled, bh2u +from electrum_zcash.wallet import Wallet, Standard_Wallet PASSPHRASE_HELP_SHORT =_( "Passphrases allow you to access new wallets, each " "hidden behind a particular case-sensitive passphrase.") PASSPHRASE_HELP = PASSPHRASE_HELP_SHORT + " " + _( - "You need to create a separate Electrum wallet for each passphrase " + "You need to create a separate Electrum-Zcash wallet for each passphrase " "you use as they each generate different addresses. Changing " "your passphrase does not lose other wallets, each is still " "accessible behind its own passphrase.") RECOMMEND_PIN = _( "You should enable PIN protection. Your PIN is the only protection " - "for your bitcoins if your device is lost or stolen.") + "for your Zcash coins if your device is lost or stolen.") PASSPHRASE_NOT_PIN = _( "If you forget a passphrase you will be unable to access any " - "bitcoins in the wallet behind it. A passphrase is not a PIN. " + "Zcash coins in the wallet behind it. A passphrase is not a PIN. " "Only change this if you are sure you understand it.") CHARACTER_RECOVERY = ( "Use the recovery cipher shown on your device to input your seed words. " @@ -242,7 +242,7 @@ class QtPlugin(QtPluginBase): else: msg = _("Enter the master private key beginning with xprv:") def set_enabled(): - from electrum.keystore import is_xprv + from electrum_zcash.keystore import is_xprv wizard.next_button.setEnabled(is_xprv(clean_text(text))) text.textChanged.connect(set_enabled) next_enabled = False @@ -359,13 +359,13 @@ class SettingsDialog(WindowModalDialog): currently_enabled = self.features.passphrase_protection if currently_enabled: msg = _("After disabling passphrases, you can only pair this " - "Electrum wallet if it had an empty passphrase. " + "Electrum-Zcash wallet if it had an empty passphrase. " "If its passphrase was not empty, you will need to " "create a new wallet with the install wizard. You " "can use this wallet again at any time by re-enabling " "passphrases and entering its passphrase.") else: - msg = _("Your current Electrum wallet can only be used with " + msg = _("Your current Electrum-Zcash wallet can only be used with " "an empty passphrase. You must create a separate " "wallet with the install wizard for other passphrases " "as each one generates a new set of addresses.") @@ -406,7 +406,7 @@ class SettingsDialog(WindowModalDialog): if wallet and sum(wallet.get_balance()): title = _("Confirm Device Wipe") msg = _("Are you SURE you want to wipe the device?\n" - "Your wallet still has bitcoins in it!") + "Your wallet still has Zcash coins in it!") if not self.question(msg, title=title, icon=QMessageBox.Critical): return @@ -481,7 +481,7 @@ class SettingsDialog(WindowModalDialog): settings_glayout.addWidget(pin_button, 2, 1) pin_msg = QLabel(_("PIN protection is strongly recommended. " "A PIN is your only protection against someone " - "stealing your bitcoins if they obtain physical " + "stealing your Zcash coins if they obtain physical " "access to your %s.") % plugin.device) pin_msg.setWordWrap(True) pin_msg.setStyleSheet("color: red") @@ -541,7 +541,7 @@ class SettingsDialog(WindowModalDialog): clear_pin_button.clicked.connect(clear_pin) clear_pin_warning = QLabel( _("If you disable your PIN, anyone with physical access to your " - "%s device can spend your bitcoins.") % plugin.device) + "%s device can spend your Zcash coins.") % plugin.device) clear_pin_warning.setWordWrap(True) clear_pin_warning.setStyleSheet("color: red") advanced_glayout.addWidget(clear_pin_button, 0, 2) @@ -566,7 +566,7 @@ class SettingsDialog(WindowModalDialog): wipe_device_msg.setWordWrap(True) wipe_device_warning = QLabel( _("Only wipe a device if you have the recovery seed written down " - "and the device wallet(s) are empty, otherwise the bitcoins " + "and the device wallet(s) are empty, otherwise the Zcash coins " "will be lost forever.")) wipe_device_warning.setWordWrap(True) wipe_device_warning.setStyleSheet("color: red") diff --git a/plugins/labels/__init__.py b/plugins/labels/__init__.py index 75963735..d441e707 100644 --- a/plugins/labels/__init__.py +++ b/plugins/labels/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = _('LabelSync') description = ' '.join([ diff --git a/plugins/labels/kivy.py b/plugins/labels/kivy.py index 508a049a..4ac7779c 100644 --- a/plugins/labels/kivy.py +++ b/plugins/labels/kivy.py @@ -1,5 +1,5 @@ from .labels import LabelsPlugin -from electrum.plugins import hook +from electrum_zcash.plugins import hook class Plugin(LabelsPlugin): diff --git a/plugins/labels/labels.py b/plugins/labels/labels.py index 3e778d54..aae92673 100644 --- a/plugins/labels/labels.py +++ b/plugins/labels/labels.py @@ -7,9 +7,9 @@ import traceback import base64 -import electrum -from electrum.plugins import BasePlugin, hook -from electrum.i18n import _ +import electrum_zcash +from electrum_zcash.plugins import BasePlugin, hook +from electrum_zcash.i18n import _ class LabelsPlugin(BasePlugin): @@ -21,14 +21,14 @@ class LabelsPlugin(BasePlugin): def encode(self, wallet, msg): password, iv, wallet_id = self.wallets[wallet] - encrypted = electrum.bitcoin.aes_encrypt_with_iv(password, iv, + encrypted = electrum_zcash.bitcoin.aes_encrypt_with_iv(password, iv, msg.encode('utf8')) return base64.b64encode(encrypted).decode() def decode(self, wallet, message): password, iv, wallet_id = self.wallets[wallet] decoded = base64.b64decode(message) - decrypted = electrum.bitcoin.aes_decrypt_with_iv(password, iv, decoded) + decrypted = electrum_zcash.bitcoin.aes_decrypt_with_iv(password, iv, decoded) return decrypted.decode('utf8') def get_nonce(self, wallet): diff --git a/plugins/labels/qt.py b/plugins/labels/qt.py index 5fa9ee3a..4e7eda57 100644 --- a/plugins/labels/qt.py +++ b/plugins/labels/qt.py @@ -4,11 +4,11 @@ from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout) -from electrum.plugins import hook -from electrum.i18n import _ -from electrum_gui.qt import EnterButton -from electrum_gui.qt.util import ThreadedButton, Buttons -from electrum_gui.qt.util import WindowModalDialog, OkButton +from electrum_zcash.plugins import hook +from electrum_zcash.i18n import _ +from electrum_zcash_gui.qt import EnterButton +from electrum_zcash_gui.qt.util import ThreadedButton, Buttons +from electrum_zcash_gui.qt.util import WindowModalDialog, OkButton from .labels import LabelsPlugin diff --git a/plugins/virtualkeyboard/__init__.py b/plugins/virtualkeyboard/__init__.py index c24f19b1..ce302211 100644 --- a/plugins/virtualkeyboard/__init__.py +++ b/plugins/virtualkeyboard/__init__.py @@ -1,4 +1,4 @@ -from electrum.i18n import _ +from electrum_zcash.i18n import _ fullname = 'Virtual Keyboard' description = '%s\n%s' % (_("Add an optional virtual keyboard to the password dialog."), _("Warning: do not use this if it makes you pick a weaker password.")) diff --git a/plugins/virtualkeyboard/qt.py b/plugins/virtualkeyboard/qt.py index 6918aa6e..a73f2c6f 100644 --- a/plugins/virtualkeyboard/qt.py +++ b/plugins/virtualkeyboard/qt.py @@ -1,7 +1,7 @@ from PyQt5.QtGui import * from PyQt5.QtWidgets import (QVBoxLayout, QGridLayout, QPushButton) -from electrum.plugins import BasePlugin, hook -from electrum.i18n import _ +from electrum_zcash.plugins import BasePlugin, hook +from electrum_zcash.i18n import _ import random