Skip to content

Commit

Permalink
Changes for BTCP support
Browse files Browse the repository at this point in the history
  • Loading branch information
sulmone committed Feb 24, 2018
1 parent dfff1e9 commit 4023339
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 102 deletions.
24 changes: 9 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
ZCL Electrum - Lightweight Zclassic Client
BTCP Electrum - Lightweight Bitcoin Private Client
==========================================

Current Release (1.0.1): https://github.com/BTCP-community/electrum-zcl/releases/tag/Z!1.0.1

**ATTENTION! Please Read**

- Viewing & Sending from Z addresses is not yet supported on this wallet.
- Please **do not** use '2FA' when setting up your wallet - please use Standard or MultiSig.

Current Release (P!0.1.0): https://github.com/BTCPrivate/electrum-btcp/releases/tag/P!0.1.0

Originally forked from **spesmilo/electrum**: https://github.com/spesmilo/electrum

Expand Down Expand Up @@ -56,8 +50,8 @@ Development version

Check out the code from Github::

git clone git://github.com/BTCP-community/electrum-zcl.git
cd electrum-zcl
git clone git://github.com/BTCPrivate/electrum-btcp.git
cd electrum-btcp

For Mac:
--------
Expand Down Expand Up @@ -154,7 +148,7 @@ To just create binaries, create the 'packages/' directory::
(This directory contains the Python dependencies used by Electrum.)


ZCL Hints and Debug
BTCP Hints and Debug
===================

There are several useful scripts in::
Expand All @@ -170,14 +164,14 @@ It should run, validating chunks without error.

Also be sure to check out::

~/.electrum-zcl/
~/.electrum-btcp/

~/.electrum-zcl/wallets/ has your wallet files - ** back up this folder **
~/.electrum-btcp/wallets/ has your wallet files - ** back up this folder **

~/.electrum-zcl/config has your Electrum connection object.
~/.electrum-btcp/config has your Electrum connection object.



---

The Zclassic Team
The Bitcoin Private Team
File renamed without changes.
12 changes: 6 additions & 6 deletions electrum.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# sudo desktop-file-install electrum.desktop

[Desktop Entry]
Comment=Lightweight Zclassic Client
Exec=electrum %u
GenericName[en_US]=Zclassic Wallet
GenericName=Zclassic Wallet
Comment=Lightweight Bitcoin Private Client
Exec=electrum-btcp %u
GenericName[en_US]=Bitcoin Private Wallet
GenericName=Bitcoin Private Wallet
Icon=electrum
Name[en_US]=Zclassic Electrum Wallet
Name=Zclassic Electrum Wallet
Name[en_US]=Bitcoin Private Electrum Wallet
Name=Bitcoin Private Electrum Wallet
Categories=Finance;Network;
StartupNotify=false
Terminal=false
Expand Down
4 changes: 2 additions & 2 deletions gui/kivy/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def on_history(self, d):
self._trigger_update_history()

def _get_bu(self):
return self.electrum_config.get('base_unit', 'ZCL')
return self.electrum_config.get('base_unit', 'BTCP')

def _set_bu(self, value):
assert value in base_units.keys()
Expand Down Expand Up @@ -241,7 +241,7 @@ def __init__(self, **kwargs):

App.__init__(self)#, **kwargs)

title = _('Zclassic Electrum')
title = _('Bitcoin Private Electrum')
self.electrum_config = config = kwargs.get('config', None)
self.language = config.get('language', 'en')
self.network = network = kwargs.get('network', None)
Expand Down
4 changes: 2 additions & 2 deletions gui/kivy/uix/dialogs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
SettingsItem:
bu: app.base_unit
title: _('Denomination') + ': ' + self.bu
description: _("Base unit for Zclassic amounts.")
description: _("Base unit for BTCP amounts.")
action: partial(root.unit_dialog, self)
CardSeparator
SettingsItem:
status: root.fee_status()
title: _('Fees') + ': ' + self.status
description: _("Fees paid to the Zclassic miners.")
description: _("Fees paid to the BTCP miners.")
action: partial(root.fee_dialog, self)
CardSeparator
SettingsItem:
Expand Down
8 changes: 4 additions & 4 deletions gui/kivy/uix/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def set_URI(self, text):
try:
uri = electrum.util.parse_URI(text, self.app.on_pr)
except:
self.app.show_info(_("Not a Zclassic URI"))
self.app.show_info(_("Not a BTCP URI"))
return
amount = uri.get('amount')
self.screen.address = uri.get('address', '')
Expand Down Expand Up @@ -250,10 +250,10 @@ def do_send(self):
else:
address = str(self.screen.address)
if not address:
self.app.show_error(_('Recipient not specified.') + ' ' + _('Please scan a Zclassic address or a payment request'))
self.app.show_error(_('Recipient not specified.') + ' ' + _('Please scan a BTCP address or a payment request'))
return
if not bitcoin.is_address(address):
self.app.show_error(_('Invalid Zclassic Address') + ':\n' + address)
self.app.show_error(_('Invalid BTCP Address') + ':\n' + address)
return
try:
amount = self.app.get_amount(self.screen.amount)
Expand Down Expand Up @@ -370,7 +370,7 @@ def update_qr(self):

def do_share(self):
uri = self.get_URI()
self.app.do_share(uri, _("Share Zclassic Request"))
self.app.do_share(uri, _("Share BTCP Request"))

def do_copy(self):
uri = self.get_URI()
Expand Down
2 changes: 1 addition & 1 deletion gui/kivy/uix/ui_screens/receive.kv
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ReceiveScreen:
pos_hint: {'center_y': .5}
BlueButton:
id: address_label
text: s.address if s.address else _('Zclassic Address')
text: s.address if s.address else _('BTCP Address')
shorten: True
disabled: True
CardSeparator:
Expand Down
8 changes: 4 additions & 4 deletions gui/qt/amountedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def __init__(self, decimal_point, is_int = False, parent=None):
def _base_unit(self):
p = self.decimal_point()
if p == 8:
return 'ZCL'
return 'BTCP'
if p == 5:
return 'mZCL'
return 'mBTCP'
if p == 2:
return 'bits'
raise Exception('Unknown base unit')
Expand All @@ -108,9 +108,9 @@ class FeerateEdit(BTCAmountEdit):
def _base_unit(self):
p = self.decimal_point()
if p == 2:
return 'mZCL/kB'
return 'mBTCP/kB'
if p == 0:
return 'zat/byte'
return 'sat/byte'
raise Exception('Unknown base unit')

def get_amount(self):
Expand Down
6 changes: 3 additions & 3 deletions gui/qt/installwizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GoBack(Exception):

MSG_GENERATING_WAIT = _("Generating your addresses, please wait...")
MSG_ENTER_ANYTHING = _("Please enter a seed phrase, a master key, a list of "
"Zclassic addresses, or a list of private keys")
"BTCP addresses, or a list of private keys")
MSG_ENTER_SEED_OR_MPK = _("Please enter a seed phrase or a master key (xpub or xprv):")
MSG_COSIGNER = _("Please enter the master public key of cosigner #%d:")
MSG_ENTER_PASSWORD = _("Choose a password to encrypt your wallet keys.") + '\n'\
Expand Down Expand Up @@ -102,7 +102,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
def __init__(self, config, app, plugins, storage):
BaseWizard.__init__(self, config, storage)
QDialog.__init__(self, None)
self.setWindowTitle('Zclassic Electrum - ' + _('Install Wizard'))
self.setWindowTitle('Bitcoin Private Electrum - ' + _('Install Wizard'))
self.app = app
self.config = config
# Set for base base class
Expand Down Expand Up @@ -174,7 +174,7 @@ def run_and_get_wallet(self):
hbox2.addWidget(self.pw_e)
hbox2.addStretch()
vbox.addLayout(hbox2)
self.set_layout(vbox, title=_('Zclassic Electrum Wallet'))
self.set_layout(vbox, title=_('Bitcoin Private Electrum Wallet'))

wallet_folder = os.path.dirname(self.storage.path)

Expand Down
46 changes: 23 additions & 23 deletions gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def init_geometry(self):
self.setGeometry(100, 100, 840, 400)

def watching_only_changed(self):
name = "[TESTNET] Zclassic Electrum" if NetworkConstants.TESTNET else "Zclassic Electrum"
name = "[TESTNET] Bitcoin Private Electrum" if NetworkConstants.TESTNET else "Bitcoin Private Electrum"
title = '%s %s - %s' % (name, self.wallet.electrum_version,
self.wallet.basename())
extra = [self.wallet.storage.get('wallet_type', '?')]
Expand All @@ -381,8 +381,8 @@ def warn_if_watching_only(self):
if self.wallet.is_watching_only():
msg = ' '.join([
_("This wallet is watching-only."),
_("This means you will not be able to spend Zclassic with it."),
_("Make sure you own the seed phrase or the private keys, before you request Zclassic to be sent to this wallet.")
_("This means you will not be able to spend BTCP with it."),
_("Make sure you own the seed phrase or the private keys, before you request BTCP to be sent to this wallet.")
])
self.show_warning(msg, title=_('Information'))

Expand Down Expand Up @@ -536,7 +536,7 @@ def donate_to_server(self):
def show_about(self):
QMessageBox.about(self, "Electrum",
_("Version")+" %s" % (self.wallet.electrum_version) + "\n\n" +
_("Electrum's focus is speed, with low resource usage and simplifying Zclassic. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Zclassic system." + "\n\n" +
_("Electrum's focus is speed, with low resource usage and simplifying Bitcoin Private. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Bitcoin Private system." + "\n\n" +
_("Uses icons from the Icons8 icon pack (icons8.com).")))

def show_report_bug(self):
Expand All @@ -546,7 +546,7 @@ def show_report_bug(self):
_("Before reporting a bug, upgrade to the most recent version of Electrum (latest release or git HEAD), and include the version number in your report."),
_("Try to explain not only what the bug is, but how it occurs.")
])
self.show_message(msg, title="Electrum - " + _("Reporting Bugs"))
self.show_message(msg, title="Electrum BTCP - " + _("Reporting Bugs"))

def notify_transactions(self):
if not self.network or not self.network.is_connected():
Expand Down Expand Up @@ -576,9 +576,9 @@ def notify(self, message):
if self.tray:
try:
# this requires Qt 5.9
self.tray.showMessage("Electrum", message, QIcon(":icons/electrum_dark_icon"), 20000)
self.tray.showMessage("Electrum BTCP", message, QIcon(":icons/electrum_dark_icon"), 20000)
except TypeError:
self.tray.showMessage("Electrum", message, QSystemTrayIcon.Information, 20000)
self.tray.showMessage("Electrum BTCP", message, QSystemTrayIcon.Information, 20000)



Expand Down Expand Up @@ -626,7 +626,7 @@ def format_amount_and_units(self, amount):

def format_fee_rate(self, fee_rate):
if self.fee_unit == 0:
return format_satoshis(fee_rate/1000, False, self.num_zeros, 0, False) + ' zat/byte'
return format_satoshis(fee_rate/1000, False, self.num_zeros, 0, False) + ' sat/byte'
else:
return self.format_amount(fee_rate) + ' ' + self.base_unit() + '/kB'

Expand All @@ -638,9 +638,9 @@ def base_unit(self):
if self.decimal_point == 2:
return 'bits'
if self.decimal_point == 5:
return 'mZCL'
return 'mBTCP'
if self.decimal_point == 8:
return 'ZCL'
return 'BTCP'
raise Exception('Unknown base unit')

def connect_fields(self, window, btc_e, fiat_e, fee_e):
Expand Down Expand Up @@ -764,7 +764,7 @@ def create_receive_tab(self):
self.receive_address_e = ButtonsLineEdit()
self.receive_address_e.addCopyButton(self.app)
self.receive_address_e.setReadOnly(True)
msg = _('Zclassic address where the payment should be received. Note that each payment request uses a different Zclassic address.')
msg = _('BTCP address where the payment should be received. Note that each payment request uses a different BTCP address.')
self.receive_address_label = HelpLabel(_('Receiving address'), msg)
self.receive_address_e.textChanged.connect(self.update_receive_qr)
self.receive_address_e.setFocusPolicy(Qt.NoFocus)
Expand Down Expand Up @@ -794,7 +794,7 @@ def create_receive_tab(self):
msg = ' '.join([
_('Expiration date of your request.'),
_('This information is seen by the recipient if you send them a signed payment request.'),
_('Expired requests have to be deleted manually from your list, in order to free the corresponding Zclassic addresses.'),
_('Expired requests have to be deleted manually from your list, in order to free the corresponding BTCP addresses.'),
_('The bitcoin address never expires and will always be part of this electrum wallet.'),
])
grid.addWidget(HelpLabel(_('Request expires'), msg), 3, 0)
Expand Down Expand Up @@ -1010,7 +1010,7 @@ def create_send_tab(self):
self.amount_e = BTCAmountEdit(self.get_decimal_point)
self.payto_e = PayToEdit(self)
msg = _('Recipient of the funds.') + '\n\n'\
+ _('You may enter a Zclassic address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a Zclassic address)')
+ _('You may enter a BTCP address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a BTCP address)')
payto_label = HelpLabel(_('Pay to'), msg)
grid.addWidget(payto_label, 1, 0)
grid.addWidget(self.payto_e, 1, 1, 1, -1)
Expand Down Expand Up @@ -1057,7 +1057,7 @@ def create_send_tab(self):
hbox.addStretch(1)
grid.addLayout(hbox, 4, 4)

msg = _('Zclassic transactions are in general not free. A transaction fee is paid by the sender of the funds.') + '\n\n'\
msg = _('BTCP transactions are in general not free. A transaction fee is paid by the sender of the funds.') + '\n\n'\
+ _('The amount of fee can be decided freely by the sender. However, transactions with low fees take more time to be processed.') + '\n\n'\
+ _('A suggested fee is automatically added to this field. You may override it. The suggested fee increases with the size of the transaction.')
self.fee_e_label = HelpLabel(_('Fee'), msg)
Expand Down Expand Up @@ -1389,10 +1389,10 @@ def read_send_tab(self):

for _type, addr, amount in outputs:
if addr is None:
self.show_error(_('No Zclassic Address'))
self.show_error(_('No BTCP Address'))
return
if _type == TYPE_ADDRESS and not bitcoin.is_address(addr):
self.show_error(_('Invalid Zclassic Address'))
self.show_error(_('Invalid BTCP Address'))
return
if amount is None:
self.show_error(_('Invalid Amount'))
Expand Down Expand Up @@ -2028,7 +2028,7 @@ def do_sign(self, address, message, signature, password):
address = address.text().strip()
message = message.toPlainText().strip()
if not bitcoin.is_address(address):
self.show_message(_('Invalid Zclassic address.'))
self.show_message(_('Invalid BTCP address.'))
return
if not self.wallet.is_mine(address):
self.show_message(_('Address not in wallet.'))
Expand All @@ -2048,7 +2048,7 @@ def do_verify(self, address, message, signature):
address = address.text().strip()
message = message.toPlainText().strip().encode('utf-8')
if not bitcoin.is_address(address):
self.show_message(_('Invalid Zclassic address.'))
self.show_message(_('Invalid BTCP address.'))
return
try:
# This can throw on invalid base64
Expand Down Expand Up @@ -2599,7 +2599,7 @@ def on_use_rbf(x):
self.fee_unit = self.config.get('fee_unit', 0)
fee_unit_label = HelpLabel(_('Fee Unit') + ':', '')
fee_unit_combo = QComboBox()
fee_unit_combo.addItems([_('zat/byte'), _('mZCL/kB')])
fee_unit_combo.addItems([_('sat/byte'), _('mBTCP/kB')])
fee_unit_combo.setCurrentIndex(self.fee_unit)
def on_fee_unit(x):
self.fee_unit = x
Expand Down Expand Up @@ -2658,9 +2658,9 @@ def on_alias_edit():
SSL_id_e.setReadOnly(True)
id_widgets.append((SSL_id_label, SSL_id_e))

units = ['ZCL', 'mZCL', 'bits']
units = ['BTCP', 'mBTCP', 'bits']
msg = _('Base unit of your wallet.')\
+ '\n1ZCL=1000mZCL.\n' \
+ '\n1BTCP=1000mBTCP.\n' \
+ _(' These settings affects the fields in the Send tab')+' '
unit_label = HelpLabel(_('Base unit') + ':', msg)
unit_combo = QComboBox()
Expand All @@ -2672,9 +2672,9 @@ def on_unit(x):
return
edits = self.amount_e, self.fee_e, self.receive_amount_e
amounts = [edit.get_amount() for edit in edits]
if unit_result == 'ZCL':
if unit_result == 'BTCP':
self.decimal_point = 8
elif unit_result == 'mZCL':
elif unit_result == 'mBTCP':
self.decimal_point = 5
elif unit_result == 'bits':
self.decimal_point = 2
Expand Down
2 changes: 1 addition & 1 deletion gui/stdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def main(self):

def do_send(self):
if not is_address(self.str_recipient):
print(_('Invalid Zclassic address'))
print(_('Invalid BTCP address'))
return
try:
amount = int(Decimal(self.str_amount) * COIN)
Expand Down
2 changes: 1 addition & 1 deletion gui/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def do_clear(self):

def do_send(self):
if not is_address(self.str_recipient):
self.show_message(_('Invalid Zclassic address'))
self.show_message(_('Invalid BTCP address'))
return
try:
amount = int(Decimal(self.str_amount) * COIN)
Expand Down
Loading

0 comments on commit 4023339

Please sign in to comment.