Skip to content

Commit

Permalink
Merge #724: Fix builds, update build containers, update dependencies,…
Browse files Browse the repository at this point in the history
… and fix ci.

ed0b4e0 test, ledger: Update automation for new message display (Ava Chow)
4eca419 ci: Set test timeout of 45 minutes (Ava Chow)
e4f51bc test, trezor: Install rustfmt component (Ava Chow)
4e4a4e7 ci: Bump action versions to avoid deprecation warnings (Ava Chow)
21f7e11 ci: Ignore flake8 E231 (Ava Chow)
cb570be trezor: Fix lint error (Ava Chow)
2d64407 ledger: Add missing type annotation (Ava Chow)
c2366db scripted-diff: Use assertEqual instead of assertEquals (Ava Chow)
9a38436 keepky: Update TrezorModel to include internal_name (Ava Chow)
0b50184 deps: Update dependencies (Ava Chow)
9d43b37 build: Update build containers to debian bookworm (Ava Chow)
a71a820 build: Fix arch check for hwi-qt moving (Ava Chow)

Pull request description:

  Couple of minor things that weren't fully working while doing the 2.4.0 build.

  Also periodic update to dependencies.

Top commit has no ACKs.

Tree-SHA512: 397f7d2284a1f4cbb45f6fff3008161a1f5a5e1fd10c0572c02e4811a42dc1a9f6acbd55259ca9b8f0672da1e21cb9f8f0fc3187b093d50f0e6cc8611a54ff06
  • Loading branch information
achow101 committed Mar 29, 2024
2 parents 8d4fa19 + ed0b4e0 commit cfaf26c
Show file tree
Hide file tree
Showing 17 changed files with 519 additions and 502 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
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
ignore = E261,E302,E305,E501,E722,W5
ignore = E261,E302,E305,E501,E722,W5,E231
per-file-ignores = setup.py:E122
6 changes: 3 additions & 3 deletions .github/actions/build-bitcoind/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
sudo apt-get install -y ccache
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
- uses: actions/cache/restore@v3
- uses: actions/cache/restore@v4
id: ccache-cache
with:
path: ${{ env.CCACHE_DIR }}
Expand All @@ -25,13 +25,13 @@ runs:
ccache --show-stats --verbose
tar -czf bitcoind.tar.gz test/work/bitcoin/src/bitcoind
- uses: actions/cache/save@v3
- uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bitcoind
path: bitcoind.tar.gz
4 changes: 2 additions & 2 deletions .github/actions/install-sim/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.device == 'ledger-legacy' && 'ledger' || inputs.device }}-sim

Expand Down Expand Up @@ -55,7 +55,7 @@ runs:
pip install construct flask-restful jsonschema mnemonic pyelftools pillow requests pytesseract
- if: inputs.device == 'ledger'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ledger_app

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
find dist -type f -exec sha256sum {} \;
"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
cd test; ./setup_environment.sh --${{ matrix.device.name }}; cd ..
tar -czf ${{ matrix.device.archive }}.tar.gz ${{ matrix.device.paths }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.device.name }}-sim
path: ${{ matrix.device.archive }}.tar.gz
Expand All @@ -188,7 +188,7 @@ jobs:
cd app-bitcoin-new
make DEBUG=1
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ledger_app
path: app-bitcoin-new/bin/app.elf
Expand Down Expand Up @@ -240,15 +240,15 @@ jobs:
- run: |
pip install poetry
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- run: |
${{ matrix.script.install }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: bitcoind

Expand All @@ -272,6 +272,7 @@ jobs:
name: Python ${{ matrix.python-version }} ${{ matrix.device }} ${{ matrix.interface }}
runs-on: ubuntu-latest
needs: [ sim-builder, ledger-app-builder, bitcoind-builder ]
timeout-minutes: 45

strategy:
fail-fast: false
Expand All @@ -297,7 +298,7 @@ jobs:
pip install poetry
poetry install
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: bitcoind

Expand Down
4 changes: 2 additions & 2 deletions contrib/build-wine.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:oldoldstable-slim
FROM debian:bookworm-slim

SHELL ["/bin/bash", "-c"]

Expand All @@ -15,7 +15,7 @@ RUN apt-get install -y \
RUN dpkg --add-architecture i386
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN echo "deb https://dl.winehq.org/wine-builds/debian/ stretch main" >> /etc/apt/sources.list
RUN echo "deb https://dl.winehq.org/wine-builds/debian/ bookworm main" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install --install-recommends -y \
wine-stable-amd64 \
Expand Down
5 changes: 3 additions & 2 deletions contrib/build.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:oldoldstable-slim
FROM debian:bookworm-slim

SHELL ["/bin/bash", "-c"]

Expand Down Expand Up @@ -27,7 +27,8 @@ RUN apt-get install -y \
libudev-dev \
faketime \
zip \
qt5-default
pyqt5-dev \
libglib2.0-0

RUN curl https://pyenv.run | bash
ENV PYENV_ROOT="/root/.pyenv"
Expand Down
2 changes: 1 addition & 1 deletion contrib/build_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ target_dir="$target_tarfile.dir"
mkdir $target_dir
mv hwi $target_dir

if [[ $gui_support == "--with-gui" && $arch == "x86_64" ]]; then
if [[ $gui_support == "--with-gui" && $ARCH == "x86_64" ]]; then
mv hwi-qt $target_dir
fi

Expand Down
1 change: 1 addition & 0 deletions hwilib/devices/keepkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def __init__(self, path: str, password: Optional[str] = None, expert: bool = Fal
"""
model = TrezorModel(
name="K1-14M",
internal_name="keepkey",
minimum_version=(0, 0, 0),
vendors=("keepkey.com"),
usb_ids=(), # unused
Expand Down
2 changes: 1 addition & 1 deletion hwilib/devices/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def check_keypath(key_path: str) -> bool:
AddressType.LEGACY: 3,
}

def handle_chip_exception(e, func_name: str) -> bool:
def handle_chip_exception(e: Union[BTChipException, ApduException], func_name: str) -> bool:
if e.sw in bad_args:
raise BadArgumentError('Bad argument')
elif e.sw == 0x6F00: # BTCHIP_SW_TECHNICAL_PROBLEM
Expand Down
2 changes: 1 addition & 1 deletion hwilib/devices/trezor.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def ignore_input() -> None:
script_pubkey=vout.scriptPubKey,
)
t.bin_outputs.append(o)
assert(psbt_in.non_witness_utxo.hash is not None)
assert psbt_in.non_witness_utxo.hash is not None
logging.debug(psbt_in.non_witness_utxo.hash.hex())
assert psbt_in.non_witness_utxo.sha256 is not None
prevtxs[ser_uint256(psbt_in.non_witness_utxo.sha256)[::-1]] = t
Expand Down
Loading

0 comments on commit cfaf26c

Please sign in to comment.