Skip to content

Commit

Permalink
Fixing the win dependency issue
Browse files Browse the repository at this point in the history
  • Loading branch information
a-bezrukov committed Oct 5, 2021
1 parent 0f87352 commit c6089a2
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 535 deletions.
3 changes: 1 addition & 2 deletions contrib/build-linux/appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ APPIMAGE="$DISTDIR/Firo-Electrum-$VERSION-x86_64.AppImage"
. "$CONTRIB"/build_tools_util.sh

rm -rf "$CACHEDIR"
ln -s /var/build/appimage/electrum-dash.AppDir/ "$APPDIR"
mkdir -p "$APPDIR" "$CACHEDIR" "$DISTDIR"
mkdir -p "$APPDIR" "$CACHEDIR" "$PIP_CACHE_DIR" "$DISTDIR"

Expand All @@ -49,8 +50,6 @@ git clone "https://github.com/squashfskit/squashfskit.git" "$BUILDDIR/squashfski
)
MKSQUASHFS="$BUILDDIR/squashfskit/squashfs-tools/mksquashfs"

cp -r --preserve=links /var/build/appimage/electrum-dash.AppDir/* $APPDIR/

appdir_python() {
env \
PYTHONNOUSERSITE=1 \
Expand Down
4 changes: 2 additions & 2 deletions contrib/build-wine/deterministic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ excludes += [
'PyQt5.QtWinExtras',
]

a = Analysis(['run-electrum-firo'],
a = Analysis(['electrum-firo'],
hiddenimports=hiddenimports,
datas=datas,
binaries=binaries,
excludes=excludes,
runtime_hooks=['pyi_runtimehook.py'])
print("ANALYSIS PASSED")

# http://stackoverflow.com/questions/19055089/
for d in a.datas:
if 'pyconfig' in d[0]:
Expand Down
1 change: 0 additions & 1 deletion contrib/dash/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash


SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
REPO_DIR="$(realpath $SCRIPT_DIR/../../)"
ACTIONS_DIR="$SCRIPT_DIR/actions"
Expand Down
2 changes: 1 addition & 1 deletion contrib/deterministic-build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ zipp==3.4.1 \
colorama==0.4.4 \
--hash=sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b \
--hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2
python-bls==0.1.8 \
python-bls==0.1.9 \
--hash=sha256:9c89eb9d8a5d667ef9f3422a5ba64cacb52bff47cc3acdb21780152b1cc2c8c8 \
--hash=sha256:10d2d1148f594366858aebcc07c987dbbcf5b89a0b0b23bd59e6af0d4134601e \
--hash=sha256:beecbe0c6f42a5e065c7a563c655e17cbc44624ecbd5302a5e733098748a6cf1 \
Expand Down
2 changes: 1 addition & 1 deletion contrib/osx/osx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else:

TRAVIS_TAG = os.environ.get('TRAVIS_TAG')
DASH_ELECTRUM_VERSION = os.environ.get('DASH_ELECTRUM_VERSION')
ICONS_FILE = 'electrum_firo/gui/icons/electrum-dash.icns'
ICONS_FILE = 'electrum_firo/gui/icons/electrum-firo.icns'

hiddenimports = []
hiddenimports += collect_submodules('pkg_resources') # workaround for https://github.com/pypa/setuptools/issues/1963
Expand Down
2 changes: 1 addition & 1 deletion contrib/osx/osx_actions.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else:

GITHUB_REF = os.environ.get('GITHUB_REF')
DASH_ELECTRUM_VERSION = os.environ.get('DASH_ELECTRUM_VERSION')
ICONS_FILE = 'electrum_firo/gui/icons/electrum-dash.icns'
ICONS_FILE = 'electrum_firo/gui/icons/electrum-firo.icns'

hiddenimports = []
hiddenimports += collect_submodules('pkg_resources') # workaround for https://github.com/pypa/setuptools/issues/1963
Expand Down
2 changes: 1 addition & 1 deletion contrib/requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Pygments>=2.1

# Note that we also need the dnspython[DNSSEC] extra which pulls in cryptography,
# but as that is not pure-python it cannot be listed in this file!
dnspython>=2.0,<=2.1
dnspython>=2.0,<2.1
33 changes: 22 additions & 11 deletions electrum-firo
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def check_imports():
import aiorpcx
except ImportError as e:
sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'")
if not ((0, 18, 7) <= aiorpcx._version < (0, 19)):
raise RuntimeError(f'aiorpcX version {aiorpcx._version} does not match required: 0.18.7<=ver<0.19')
# the following imports are for pyinstaller
from google.protobuf import descriptor
from google.protobuf import message
Expand All @@ -76,7 +78,9 @@ if not is_android:
check_imports()


from electrum_firo.logging import get_logger, configure_logging
sys._ELECTRUM_RUNNING_VIA_RUNELECTRUM = True # used by logging.py

from electrum_firo.logging import get_logger, configure_logging # import logging submodule first
from electrum_firo import util
from electrum_firo import constants
from electrum_firo import SimpleConfig
Expand All @@ -90,6 +94,7 @@ from electrum_firo.commands import get_parser, known_commands, Commands, config_
from electrum_firo import daemon
from electrum_firo import keystore
from electrum_firo.util import create_and_start_event_loop
from electrum_firo.i18n import set_language

if TYPE_CHECKING:
import threading
Expand Down Expand Up @@ -137,10 +142,6 @@ def init_cmdline(config_options, wallet_path, server, *, config: 'SimpleConfig')
cmdname = config.get('cmd')
cmd = known_commands[cmdname]

if cmdname == 'signtransaction' and config.get('privkey'):
cmd.requires_wallet = False
cmd.requires_password = False

if cmdname in ['payto', 'paytomany'] and config.get('unsigned'):
cmd.requires_password = False

Expand Down Expand Up @@ -184,8 +185,6 @@ def init_cmdline(config_options, wallet_path, server, *, config: 'SimpleConfig')
sys_exit(1)
else:
password = None
if getattr(storage, 'backup_message', None):
print(f'{storage.backup_message}\n')

config_options['password'] = config_options.get('password') or password

Expand Down Expand Up @@ -246,6 +245,11 @@ async def run_offline_command(config, config_options, plugins: 'Plugins'):
config_options['password'] = password
storage.decrypt(password)
db = WalletDB(storage.read(), manual_upgrades=False)
if db.upgrade_done:
storage.backup_old_version()
if db.check_unfinished_multisig():
print_msg("Error: Can not open unfinished multisig wallet.")
sys.exit(1)
wallet = Wallet(db, storage, config=config)
config_options['wallet'] = wallet
else:
Expand Down Expand Up @@ -273,6 +277,8 @@ async def run_offline_command(config, config_options, plugins: 'Plugins'):
result = await func(*args, **kwargs)
# save wallet
if wallet:
if getattr(storage, 'backup_message', None):
print_stderr(f'{storage.backup_message}\n')
wallet.save_db()
return result

Expand Down Expand Up @@ -345,6 +351,7 @@ def main():
'verbosity': '*' if build_config.DEBUG else '',
'cmd': 'gui',
'gui': 'kivy',
'single_password':True,
'testnet': args.testnet,
}
else:
Expand Down Expand Up @@ -375,17 +382,21 @@ def main():
print_stderr('unknown command:', uri)
sys.exit(1)

# singleton
config = SimpleConfig(config_options)

print("TESTNET {}".format(config.get('testnet')))
# set language as early as possible
# Note: we are already too late for strings that are declared in the global scope
# of an already imported module. However, the GUI and the plugins at least have
# not been imported yet.
# Note: it is ok to call set_language() again later. E.g. the Qt GUI has additional
# tools to figure out the default language so it will get called again there.
set_language(config.get('language'))

if not config.get('force_mainnet'):
if config.get('testnet'):
constants.set_testnet()
elif config.get('regtest'):
constants.set_regtest()
else:
print("FORCED MAINNET")

if constants.net == constants.BitcoinMainnet:
if config_options.get('run_stacktraces'):
Expand Down
1 change: 0 additions & 1 deletion electrum_dash/electrum-dash.bak

This file was deleted.

2 changes: 1 addition & 1 deletion electrum_dash/electrum-firo
File renamed without changes.
Loading

0 comments on commit c6089a2

Please sign in to comment.