diff options
| author | Konstantin Ullrich <konstantinullrich12@gmail.com> | 2024-10-07 12:37:30 +0200 |
|---|---|---|
| committer | Konstantin Ullrich <konstantinullrich12@gmail.com> | 2024-10-07 12:37:30 +0200 |
| commit | 98272ee381bd07081502dd426226f58c879300a6 (patch) | |
| tree | 672f6f06727dbc1c84270973ce13e9403913e481 /generate_checksum.sh | |
| parent | 04b29d84a2c368c677cf5ec946269203622ca170 (diff) | |
| parent | 67f4baa015a4407d096e35b6e5a81d72932fb55f (diff) | |
Merge branch 'master' into ledger
# Conflicts:
# .github/workflows/full_check.yaml
# impls/monero.dart/lib/monero.dart
# impls/monero.dart/pubspec.yaml
# patches/monero/0016-add-dummy-device-for-ledger.patch
Diffstat (limited to 'generate_checksum.sh')
| -rwxr-xr-x | generate_checksum.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/generate_checksum.sh b/generate_checksum.sh index c6f9524..4b82e53 100755 --- a/generate_checksum.sh +++ b/generate_checksum.sh @@ -1,14 +1,18 @@ #!/bin/bash cd "$(realpath $(dirname $0))" +if [[ "$(uname)" == "Darwin" ]]; +then + function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum +fi + for coin in monero wownero; do + submodule_hash=$(git ls-tree HEAD ${coin} | xargs | awk '{ print $3 }') COIN=$(echo "$coin" | tr a-z A-Z) COIN_wallet2_api_c_h_sha256=$(sha256sum ${coin}_libwallet2_api_c/src/main/cpp/wallet2_api_c.h | xargs | awk '{ print $1 }') - COIN_wallet2_api_c_cpp_sha256=$(sha256sum ${coin}_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp | xargs | awk '{ print $1 }') + COIN_wallet2_api_c_cpp_sha256=$(sha256sum ${coin}_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp | xargs | awk '{ print $1 }')-${submodule_hash} COIN_wallet2_api_c_exp_sha256=$(sha256sum ${coin}_libwallet2_api_c/${coin}_libwallet2_api_c.exp | xargs | awk '{ print $1 }') - COIN_libwallet2_api_c_version=$(git log --exclude=${coin}_checksum.h --oneline -- ${coin}_libwallet2_api_c | wc -l) - COIN_libwallet2_api_c_date=$(git log --exclude=${coin}_checksum.h -1 --format=%ai -- ${coin}_libwallet2_api_c) cat > ${coin}_libwallet2_api_c/src/main/cpp/${coin}_checksum.h << EOF #ifndef MONEROC_CHECKSUMS @@ -24,5 +28,12 @@ const String wallet2_api_c_h_sha256 = "${COIN_wallet2_api_c_h_sha256}"; const String wallet2_api_c_cpp_sha256 = "${COIN_wallet2_api_c_cpp_sha256}"; const String wallet2_api_c_exp_sha256 = "${COIN_wallet2_api_c_exp_sha256}"; EOF + cat > impls/monero.ts/checksum_${coin}.ts << EOF +export const ${coin}Checksum = { + wallet2_api_c_h_sha256: "${COIN_wallet2_api_c_h_sha256}", + wallet2_api_c_cpp_sha256: "${COIN_wallet2_api_c_cpp_sha256}", + wallet2_api_c_exp_sha256: "${COIN_wallet2_api_c_exp_sha256}", +} +EOF done |
