Skip to content

Commit 2dc8d2d

Browse files
authored
Feature/sync_progress (#40)
It adding the sync-progress feature which is announcing its sync progress in the _sync-method in the key verificationprogress of the getblockchaininfo call. In order to not have circular dependencies which caused trouble installing with pip3 install -e ".[test]" , i removed all occurrences of specter-desktop. Because of that, the tests, which were broken anyway, needed to be skipped and/or not executed in other ways which needed specter-desktop stuff. The most essential things have been copy and pasted in the util_specter.py but i was not shy to exspcially skip the wallet_rescan test which never worked in the CI anyway and is now only there to inspire new tests. Instead i tried to introduce bdk and get the integration tests going which are using Nigiri. So now we have at least a working Nigiri integration test setup (see basic.py) which is ready to have more tests.
1 parent fa87be3 commit 2dc8d2d

21 files changed

+667
-300
lines changed

.github/workflows/nigiri-infra.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.9"]
15+
python-version: ["3.10"]
1616

1717
steps:
1818
- name: Check out repository code
@@ -26,13 +26,13 @@ jobs:
2626
python3 -m pip install --upgrade pip
2727
- name: Install dependencies
2828
run: |
29-
pip3 install -r requirements.txt && pip3 install -r test_requirements.txt
3029
pip3 install -e .
30+
pip3 install ".[test]"
3131
- name: Run Nigiri
3232
uses: vulpemventures/nigiri-github-action@v1
3333
with:
3434
use_liquid: false
3535
- name: Run integration tests
3636
run: |
37-
pytest tests/integration/wallet_import_rescan.py
37+
pytest tests/integration/basics.py
3838

.github/workflows/pytest.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
name: Run Python tests
22

3-
on: [push]
3+
on:
4+
push:
5+
pull_request:
6+
branches: [master]
47

58
jobs:
69
build:
710
name: Run tests
811
runs-on: ubuntu-latest
912
strategy:
1013
matrix:
11-
python-version: ["3.9"]
14+
python-version: ["3.10"]
1215

1316
steps:
17+
# This action provides the following functionality for GitHub Actions users:
18+
# * Installing a version of Python or PyPy and (by default) adding it to the PATH
19+
# * Optionally caching dependencies for pip, pipenv and poetry
20+
# * Registering problem matchers for error output
1421
- uses: actions/checkout@v3
1522
- name: Set up Python ${{ matrix.python-version }}
1623
uses: actions/setup-python@v3
1724
with:
1825
python-version: ${{ matrix.python-version }}
1926
- name: Install dependencies
2027
run: |
21-
pip3 install -r requirements.txt
22-
pip3 install -r test_requirements.txt
2328
pip3 install -e .
24-
pip3 install pytest pytest-md pytest-emoji
29+
pip3 install ".[test]"
2530
- name: pytest
2631
run: |
27-
pytest
32+
pytest

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,6 @@ dmypy.json
138138
.pyre/
139139

140140
# MacOS
141-
.DS_Store
141+
.DS_Store
142+
setup.py
143+
src/cryptoadvance/spectrum/_version.py

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 specter.solutions
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

dev_requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

pyproject.toml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
[build-system]
22
requires = [
3-
"cryptoadvance.specter==1.13.0"
3+
"setuptools>=45", "setuptools_scm[toml]>=6.2", "babel"
44
]
5-
build-backend = "setuptools.build_meta"
5+
build-backend = "setuptools.build_meta"
6+
7+
[project]
8+
name = "cryptoadvance.spectrum"
9+
10+
authors = [
11+
{ name="Stepan Snigirev"},
12+
{ name="k9ert"},
13+
]
14+
description = "Implements A Bitcoin Core API which querying an Electrum"
15+
16+
urls = { Homepage = "https://github.com/cryptoadvance/spectrum" }
17+
readme = "README.md"
18+
license = {file = "LICENSE"}
19+
20+
21+
requires-python = ">=3.10"
22+
23+
dependencies = [
24+
'embit==0.6.1',
25+
'Flask==2.1.1',
26+
'Flask-SQLAlchemy==2.5.1',
27+
'sqlalchemy==1.4.42',
28+
'psycopg2-binary',
29+
'requests==2.26.0'
30+
]
31+
32+
33+
classifiers =[
34+
'Programming Language :: Python :: 3',
35+
'License :: OSI Approved :: MIT License',
36+
'Operating System :: OS Independent',
37+
'Framework :: Flask',
38+
]
39+
dynamic=["version"]
40+
41+
[tool.setuptools_scm]
42+
write_to = "src/cryptoadvance/spectrum/_version.py"
43+
44+
[tool.pytest.ini_options]
45+
norecursedirs = "tests/bintegration"
46+
log_format = "[%(levelname)8s] %(message)s %(name)s (%(filename)s:%(lineno)s)"
47+
markers = [
48+
"slow: mark test as slow.",
49+
"elm: mark test as elementsd dependent",
50+
]
51+
52+
filterwarnings = [
53+
"ignore::DeprecationWarning:bitbox02[.*]"
54+
]
55+
56+
57+
[project.optional-dependencies]
58+
test = [
59+
"pytest >=7.1.3",
60+
"pytest-cov[all]",
61+
"mock",
62+
"black",
63+
"pre-commit",
64+
"bdkpython"
65+
]

pytest.ini

Lines changed: 0 additions & 10 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,10 @@
1313
]
1414

1515
setup(
16-
name="cryptoadvance.spectrum",
17-
version="0.3.0",
18-
license="MIT license",
19-
url="https://github.com/cryptoadvance/spectrum",
20-
description="Electrum adaptor for Specter-Desktop",
21-
long_description="Bitcoin Core like RPC wallet with Electrum server backend.",
22-
author="Stepan Snigirev",
23-
author_email="snigirev.stepan@gmail.com",
2416
packages=find_namespace_packages("src", include=["cryptoadvance.*"]),
2517
package_dir={"": "src"},
2618
package_data={},
2719
# take METADATA.in into account, include that stuff as well (static/templates)
2820
include_package_data=True,
2921
install_requires=requirements,
30-
classifiers=[
31-
"Programming Language :: Python :: 3",
32-
"License :: OSI Approved :: MIT License",
33-
"Operating System :: OS Independent",
34-
"Framework :: Flask",
35-
],
3622
)

src/cryptoadvance/spectrum/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import secrets
77
from pathlib import Path
88

9-
from cryptoadvance.specter.config import _get_bool_env_var
9+
from cryptoadvance.spectrum.util_specter import _get_bool_env_var
1010

1111
logger = logging.getLogger(__name__)
1212

src/cryptoadvance/spectrum/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import time
1313
from .util import sat_to_btc
1414
from sqlalchemy.ext.declarative import declared_attr
15-
from cryptoadvance.specter.util.common import snake_case2camelcase
15+
from cryptoadvance.spectrum.util_specter import snake_case2camelcase
1616
from sqlalchemy.orm import DeclarativeMeta, declarative_base
1717
from flask_sqlalchemy.model import BindMetaMixin, Model
1818

0 commit comments

Comments
 (0)