Skip to content

Commit a69f718

Browse files
authored
Merge pull request #8 from qtumproject/cf/merge-upstream-2.3.1
merge upstream 2.3.1
2 parents b02e4e5 + 879be3d commit a69f718

File tree

255 files changed

+20218
-6910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+20218
-6910
lines changed

.cirrus.yml

Lines changed: 107 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1-
container:
2-
dockerfile: ci/cirrus.Dockerfile
3-
41
env:
52
EMAIL: cirrus@cirrus-ci.org
63

4+
python_version_matrix_template: &PYTHON_VERSION_MATRIX_TEMPLATE
5+
- container:
6+
dockerfile: ci/py37.Dockerfile
7+
env:
8+
PYTHON: 3.7
9+
- container:
10+
dockerfile: ci/cirrus.Dockerfile
11+
env:
12+
PYTHON: 3.8
13+
- container:
14+
dockerfile: ci/py39.Dockerfile
15+
env:
16+
PYTHON: 3.9
17+
- container:
18+
dockerfile: ci/py310.Dockerfile
19+
env:
20+
PYTHON: 3.10
21+
- container:
22+
dockerfile: ci/py311.Dockerfile
23+
env:
24+
PYTHON: 3.11
25+
726
device_matrix_template: &DEVICE_MATRIX_TEMPLATE
827
- env:
928
DEVICE: --trezor-1
@@ -54,8 +73,37 @@ device_matrix_template: &DEVICE_MATRIX_TEMPLATE
5473
- tar -xvf "mcu.tar.gz"
5574
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/bitcoind_builder/bitcoin/bitcoin.tar.gz"
5675
- tar -xvf "bitcoin.tar.gz"
76+
- env:
77+
DEVICE: --jade
78+
depends_on:
79+
- Jade Sim Builder
80+
- dist_builder
81+
- bitcoind_builder
82+
fetch_sim_script:
83+
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/Jade Sim Builder/sim/jade.tar.gz"
84+
- tar -xvf "jade.tar.gz"
85+
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/bitcoind_builder/bitcoin/bitcoin.tar.gz"
86+
- tar -xvf "bitcoin.tar.gz"
5787
- env:
5888
DEVICE: --ledger
89+
depends_on:
90+
- Ledger Sim Builder
91+
- Ledger App Builder
92+
- dist_builder
93+
- bitcoind_builder
94+
fetch_sim_script:
95+
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/Ledger Sim Builder/sim/speculos.tar.gz"
96+
- tar -xvf "speculos.tar.gz"
97+
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/bitcoind_builder/bitcoin/bitcoin.tar.gz"
98+
- tar -xvf "bitcoin.tar.gz"
99+
fetch_ledger_app_script:
100+
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/Ledger App Builder/built_ledger_app/app-bitcoin-new/bin/app.elf"
101+
- mv app.elf test/work/speculos/apps/btc-test.elf
102+
sim_install_script:
103+
- poetry run pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
104+
- pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
105+
- env:
106+
DEVICE: --ledger-legacy
59107
depends_on:
60108
- Ledger Sim Builder
61109
- dist_builder
@@ -66,8 +114,8 @@ device_matrix_template: &DEVICE_MATRIX_TEMPLATE
66114
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/bitcoind_builder/bitcoin/bitcoin.tar.gz"
67115
- tar -xvf "bitcoin.tar.gz"
68116
sim_install_script:
69-
- poetry run pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests
70-
- pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests
117+
- poetry run pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
118+
- pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
71119
- env:
72120
DEVICE: --keepkey
73121
depends_on:
@@ -80,12 +128,11 @@ device_matrix_template: &DEVICE_MATRIX_TEMPLATE
80128
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/bitcoind_builder/bitcoin/bitcoin.tar.gz"
81129
- tar -xvf "bitcoin.tar.gz"
82130

83-
lint_task:
84-
test_script:
85-
- flake8
86-
87131
task:
132+
container:
133+
image: python:latest
88134
install_script:
135+
- pip install poetry
89136
- poetry install
90137
matrix:
91138
- name: Type Check
@@ -102,6 +149,7 @@ task:
102149
hwilib/devices/bitbox02.py
103150
hwilib/devices/coldcard.py
104151
hwilib/devices/digitalbitbox.py
152+
hwilib/devices/jade.py
105153
hwilib/devices/__init__.py
106154
hwilib/devices/keepkey.py
107155
hwilib/devices/ledger.py
@@ -116,15 +164,19 @@ task:
116164
hwilib/udevinstaller.py
117165
- name: Non-Device Tests
118166
test_script: cd test; poetry run ./run_tests.py; cd ..
167+
- name: lint
168+
test_script: poetry run flake8
119169

120170
wine_builder_task:
121171
container:
122-
dockerfile: contrib/build.Dockerfile
172+
dockerfile: contrib/build-wine.Dockerfile
123173
build_script:
124174
- contrib/build_wine.sh
125175
- find dist -type f -exec sha256sum {} \;
126176

127177
bitcoind_builder_task:
178+
container:
179+
dockerfile: ci/cirrus.Dockerfile
128180
bitcoind_cache:
129181
folder: test/work/bitcoin
130182
ccache_cache:
@@ -138,6 +190,8 @@ bitcoind_builder_task:
138190
path: "bitcoin.tar.gz"
139191

140192
task:
193+
container:
194+
dockerfile: ci/cirrus.Dockerfile
141195
env:
142196
DEVICE: --trezor-1
143197
name: Trezor 1 Sim Builder
@@ -150,6 +204,8 @@ task:
150204
path: "trezor-firmware.tar.gz"
151205

152206
task:
207+
container:
208+
dockerfile: ci/cirrus.Dockerfile
153209
env:
154210
DEVICE: --trezor-t
155211
name: Trezor T Sim Builder
@@ -162,6 +218,8 @@ task:
162218
path: "trezor-firmware.tar.gz"
163219

164220
task:
221+
container:
222+
dockerfile: ci/cirrus.Dockerfile
165223
env:
166224
DEVICE: --coldcard
167225
name: Coldcard Sim Builder
@@ -174,6 +232,8 @@ task:
174232
path: "coldcard-mpy.tar.gz"
175233

176234
task:
235+
container:
236+
dockerfile: ci/cirrus.Dockerfile
177237
env:
178238
DEVICE: --bitbox01
179239
name: Bitbox01 Sim Builder
@@ -186,6 +246,22 @@ task:
186246
path: "mcu.tar.gz"
187247

188248
task:
249+
container:
250+
dockerfile: ci/cirrus.Dockerfile
251+
env:
252+
DEVICE: --jade
253+
name: Jade Sim Builder
254+
sim_work_cache:
255+
folder: test/work/jade
256+
build_script:
257+
- cd test; ./setup_environment.sh $DEVICE; cd ..
258+
- tar -czf jade.tar.gz test/work/jade/simulator
259+
sim_artifacts:
260+
path: "jade.tar.gz"
261+
262+
task:
263+
container:
264+
dockerfile: ci/cirrus.Dockerfile
189265
env:
190266
DEVICE: --ledger
191267
name: Ledger Sim Builder
@@ -198,6 +274,8 @@ task:
198274
path: "speculos.tar.gz"
199275

200276
task:
277+
container:
278+
dockerfile: ci/cirrus.Dockerfile
201279
env:
202280
DEVICE: --keepkey
203281
name: Keepkey Sim Builder
@@ -220,20 +298,33 @@ dist_builder_task:
220298
built_dist_artifacts:
221299
path: "dist/*"
222300

301+
ledger_app_builder_task:
302+
name: Ledger App Builder
303+
container:
304+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
305+
build_script:
306+
- git clone https://github.com/LedgerHQ/app-bitcoin-new.git
307+
- cd app-bitcoin-new
308+
- make DEBUG=1
309+
built_ledger_app_artifacts:
310+
path: app-bitcoin-new/bin/app.elf
311+
223312
task:
313+
matrix:
314+
<< : *PYTHON_VERSION_MATRIX_TEMPLATE
224315
matrix:
225316
<< : *DEVICE_MATRIX_TEMPLATE
226317
fetch_dist_script:
227318
- wget -nv "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/dist_builder/built_dist.zip"
228319
- unzip built_dist.zip
229320
matrix:
230-
- name: $DEVICE Wheel
321+
- name: Python $PYTHON $DEVICE Wheel
231322
install_script: pip install dist/*.whl
232323
test_script: cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
233-
- name: $DEVICE Sdist
234-
install_script: pip install $(find dist -name "*.tar.gz" -a -not -name "*amd64*")
324+
- name: Python $PYTHON $DEVICE Sdist
325+
install_script: pip install $(find dist -name "*.tar.gz" -a -not -name "*linux*")
235326
test_script: cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
236-
- name: $DEVICE Bindist
327+
- name: Python $PYTHON $DEVICE Bindist
237328
install_script: poetry install
238329
untar_bindist_script: cd dist; tar -xvf hwi*linux*.tar.gz; cd ..
239330
test_script: cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd ..
@@ -242,26 +333,8 @@ task:
242333

243334
task:
244335
matrix:
245-
- container:
246-
dockerfile: ci/cirrus.Dockerfile
247-
env:
248-
PYTHON: 3.6
249-
- container:
250-
dockerfile: ci/py37.Dockerfile
251-
env:
252-
PYTHON: 3.7
253-
- container:
254-
dockerfile: ci/py38.Dockerfile
255-
env:
256-
PYTHON: 3.8
257-
- container:
258-
dockerfile: ci/py39.Dockerfile
259-
env:
260-
PYTHON: 3.9
261-
- container:
262-
dockerfile: ci/py310.Dockerfile
263-
env:
264-
PYTHON: 3.10
336+
<< : *PYTHON_VERSION_MATRIX_TEMPLATE
337+
install_script: poetry install
265338
matrix:
266339
<< : *DEVICE_MATRIX_TEMPLATE
267340
matrix:
@@ -272,7 +345,6 @@ task:
272345
- env:
273346
INTERFACE: stdin
274347
name: Python $PYTHON $DEVICE $INTERFACE
275-
install_script: poetry install
276348
test_script: cd test; poetry run ./run_tests.py $DEVICE --interface=$INTERFACE --device-only; cd ..
277349
on_failure:
278350
failed_script: tail -v -n +1 test/*.std*

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
exclude = *.pyc,__pycache__,hwilib/devices/btchip/,hwilib/devices/ckcc/,hwilib/devices/trezorlib/,test/work/,hwilib/ui
2+
exclude = *.pyc,__pycache__,hwilib/devices/ledger_bitcoin/,hwilib/devices/btchip,hwilib/devices/ckcc/,hwilib/devices/jadepy/,hwilib/devices/trezorlib/,test/work/,hwilib/ui,hwilib/devices/bitbox02_lib
33
ignore = E261,E302,E305,E501,E722,W5
44
per-file-ignores = setup.py:E122

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.12
1+
3.9

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ python3 setup.py install
5757

5858
## Dependencies
5959

60-
See `pyproject.toml` for all dependencies. Dependencies under `[tool.poetry.dependecies]` are user dependencies, and `[tool.poetry.dev-dependencies]` for development based dependencies. These dependencies will be installed with any of the three above installation methods.
60+
See `pyproject.toml` for all dependencies. Dependencies under `[tool.poetry.dependencies]` are user dependencies, and `[tool.poetry.dev-dependencies]` for development based dependencies. These dependencies will be installed with any of the three above installation methods.
6161

6262
## Usage
6363

ci/cirrus.Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM python:3.6
1+
# Cache break (modify this line to break cirrus' dockerfile build cache) 1
2+
3+
FROM python:3.8
24

35
ENV DEBIAN_FRONTEND=noninteractive
46
RUN apt-get update
@@ -24,21 +26,28 @@ RUN apt-get install -y \
2426
libdb-dev \
2527
libdb++-dev \
2628
libevent-dev \
29+
libgcrypt20-dev \
2730
libnewlib-arm-none-eabi \
31+
libpcsclite-dev \
2832
libsdl2-dev \
2933
libsdl2-image-dev \
3034
libssl-dev \
35+
libslirp-dev \
3136
libtool \
3237
libudev-dev \
3338
libusb-1.0-0-dev \
39+
ninja-build \
3440
pkg-config \
35-
protobuf-compiler \
36-
qemu-user-static
41+
qemu-user-static \
42+
swig
3743

3844
RUN pip install poetry flake8
3945
RUN wget https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
4046
RUN chmod +x rustup-init && ./rustup-init -y
4147
ENV PATH="/root/.cargo/bin:$PATH"
48+
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip
49+
RUN unzip protoc-22.0-linux-x86_64.zip -d /usr/local
50+
RUN protoc --version
4251

4352
####################
4453
# Local build/test steps
@@ -48,7 +57,7 @@ ENV PATH="/root/.cargo/bin:$PATH"
4857
# as needed.
4958
# e.g.,
5059
# docker build -f ci/cirrus.Dockerfile -t hwi_test .
51-
# docker run -it --entrypoint /bin/bash hwi_tst
60+
# docker run -it --entrypoint /bin/bash hwi_test
5261
# cd test; poetry run ./run_tests.py --ledger --coldcard --interface=cli --device-only
5362
####################
5463

@@ -68,6 +77,7 @@ ENV PATH="/root/.cargo/bin:$PATH"
6877
#RUN cd test; ./setup_environment.sh --bitbox01
6978
#RUN cd test; ./setup_environment.sh --ledger
7079
#RUN cd test; ./setup_environment.sh --keepkey
80+
#RUN cd test; ./setup_environment.sh --jade
7181
#RUN cd test; ./setup_environment.sh --bitcoind
7282
#
7383
## Once everything has been built, put rest of files in place

ci/py310.Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
# Cache break (modify this line to break cirrus' dockerfile build cache) 1
2+
13
FROM python:3.10
24

35
ENV DEBIAN_FRONTEND=noninteractive
46
RUN apt-get update
57
RUN apt-get install -y \
68
cython3 \
79
git \
10+
libpcsclite-dev \
811
libsdl2-dev \
912
libsdl2-image-dev \
13+
libslirp-dev \
1014
libudev-dev \
1115
libusb-1.0-0-dev \
12-
qemu-user-static
16+
qemu-user-static \
17+
swig
1318

1419
RUN pip install poetry flake8
1520

ci/py38.Dockerfile renamed to ci/py311.Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
FROM python:3.8
1+
# Cache break (modify this line to break cirrus' dockerfile build cache)
2+
3+
FROM python:3.11
24

35
ENV DEBIAN_FRONTEND=noninteractive
46
RUN apt-get update
57
RUN apt-get install -y \
68
cython3 \
79
git \
10+
libpcsclite-dev \
811
libsdl2-dev \
912
libsdl2-image-dev \
13+
libslirp-dev \
1014
libudev-dev \
1115
libusb-1.0-0-dev \
12-
qemu-user-static
16+
qemu-user-static \
17+
swig
1318

1419
RUN pip install poetry flake8
1520

0 commit comments

Comments
 (0)