1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-21 13:58:08 +00:00

chore(tools): improve check-bitcoin-only exception list

This commit is contained in:
matejcik 2023-03-24 16:17:44 +01:00 committed by Martin Milata
parent 955c129bed
commit c9ae02442e

View File

@ -1,7 +1,19 @@
#!/bin/sh
#!/bin/bash
RETURN=0
EXCEPTIONS="decred|omni|ripple|dash|TEXT_MARGIN_LEFT|dash_width|dashlane|flo|mnemonic|meter|refuse|fused|enemy|cinema|syntaxerror|mix|palm|UdesRsK|kcc|derive_cardano|ntity|gather|bmc|cloudflare|rsk7|map|oho|mas|uniq|numbers|aves"
EXCEPTIONS=()
EXCEPTIONS+=( "decred" ) # "decred" figures in field names used by the bitcoin app
EXCEPTIONS+=( "omni" ) # OMNI is part of the bitcoin app
# BIP39 or SLIP39 words that have "dash", "nem", or "flo" in them
EXCEPTIONS+=( "cinema" "dash" "enemy" "float" "flock" "flower" "floor" "floral" )
EXCEPTIONS+=( "mnemonic" ) # has NEM in it
EXCEPTIONS+=( "workflow" "overflow" ) # has Flo in it
EXCEPTIONS+=( "SyntaxError" ) # has Axe in it
GREP_ARGS=()
for exception in "${EXCEPTIONS[@]}"; do
GREP_ARGS+=(-e $exception)
done
# dump all coins except the first 3 (Bitcoin, Testnet, Regtest)
ALTCOINS=$(./common/tools/cointool.py dump -l -p -t -d trezor1 -d trezor2 | grep '"name"' | cut -d '"' -f 4 | tail -n +4)
@ -11,7 +23,7 @@ IFS="
"
for altcoin in $ALTCOINS; do
# echo :"$altcoin":
if strings "$1" | grep -i "$altcoin" | grep -Evi "$EXCEPTIONS" ; then
if strings "$1" | grep -i "$altcoin" | grep -vi ${GREP_ARGS[@]} ; then
RETURN=1
fi
done