Skip to content

Commit

Permalink
Merge pull request #270 from ava-labs/dev
Browse files Browse the repository at this point in the history
Restrict derivation path for BTC app
  • Loading branch information
becominginsane authored Sep 22, 2023
2 parents 7f0801d + 710ee24 commit d0442d9
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- varname: STAX_SDK
target: stax
container:
image: zondax/ledger-app-builder:latest
image: zondax/ledger-app-builder:ledger-d5bfe2e793f15a826971ae9de2adcad524df3e8e
env:
SDK_VARNAME: ${{ matrix.sdk.varname }}
options: --user ${{ needs.configure.outputs.uid_gid }}
Expand Down
43 changes: 43 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,46 @@ cargo *cmd='':
cargo {{cmd}}

insta: (cargo "insta test --review")

_ztest-ci:
#!/bin/env bash
pushd zemu
TESTS=`yarn test --listTests --json | head -n 3 | tail -n 1 | jq -r '.[]'`

has_failed=0
outputs=()

for file in ${TESTS[@]}; do
output=`yarn jest "$file" --maxConcurrency 2 2>&1`
exit=$?

outputs+=("$output")
if [ $exit -ne 0 ]; then
echo "=== Test $file failed ==="
has_failed=1
fi
done

if [ $has_failed -eq 1 ]; then
for i in "${!outputs[@]}"; do
output=$outputs[i]
file=$TESTS[i]
echo "=== Test Output for $file ==="
echo "$output"
done
echo "Some tests failed. See detailed output above."
exit 1
else
echo "All tests passed."
exit 0
fi

popd

# Run the same things as a normal CI workflow
ci:
just miri
cargo fmt -- --check
cargo clippy --all-targets --features "full"
just make clean all
just _ztest-ci
2 changes: 0 additions & 2 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ ifeq (,$(filter $(TARGET_NAME),TARGET_NANOS TARGET_STAX))
# mainnet or testnet. lets pick
# the ones for mainnet for now
DEFINES += BIP32_PUBKEY_VERSION=0x0488B21E
DEFINES += BIP44_COIN_TYPE=0
DEFINES += BIP44_COIN_TYPE_2=0
# The coin type bellow is not part of the btc app,
# but this is necesary here as avax wants support for
# coin_type = 60'
Expand Down
5 changes: 0 additions & 5 deletions app/c/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ const command_descriptor_t COMMAND_DESCRIPTORS[] = {
.ins = GET_WALLET_ADDRESS,
.handler = (command_handler_t)handler_get_wallet_address
},
{
.cla = CLA_APP,
.ins = REGISTER_WALLET,
.handler = (command_handler_t)handler_register_wallet
},
{
.cla = CLA_APP,
.ins = SIGN_PSBT,
Expand Down
2 changes: 1 addition & 1 deletion deps/btc
2 changes: 1 addition & 1 deletion deps/dockerized_build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $(info TESTS_ZEMU_DIR : $(TESTS_ZEMU_DIR))
$(info TESTS_JS_DIR : $(TESTS_JS_DIR))
$(info TESTS_JS_PACKAGE : $(TESTS_JS_PACKAGE))

DOCKER_IMAGE_ZONDAX=zondax/ledger-app-builder:latest
DOCKER_IMAGE_ZONDAX=zondax/ledger-app-builder:ledger-d5bfe2e793f15a826971ae9de2adcad524df3e8e
DOCKER_IMAGE_LEDGER=ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

ifdef INTERACTIVE
Expand Down
2 changes: 1 addition & 1 deletion zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@types/node": "^18.14.6",
"@zondax/ledger-avalanche-app": "link:../js",
"@zondax/zemu": "^0.44.0"
"@zondax/zemu": "=0.44.0"
},
"devDependencies": {
"@ethereumjs/common": "^3.1.1",
Expand Down

0 comments on commit d0442d9

Please sign in to comment.