Files
monero_c/generate_checksum.sh
Codex 0d753a0d79
Some checks failed
Check if checksums are in sync / android (push) Failing after 1m42s
Check if dart bindings are in sync / android (push) Failing after 16s
Build documentation / build (push) Has been cancelled
full compatibility check / lib_mingw (monero) (push) Has been cancelled
full compatibility check / lib_mingw (peya) (push) Has been cancelled
full compatibility check / lib_mingw (salvium) (push) Has been cancelled
full compatibility check / lib_android (monero) (push) Has been cancelled
full compatibility check / lib_android (peya) (push) Has been cancelled
full compatibility check / lib_android (salvium) (push) Has been cancelled
full compatibility check / lib_linux (monero) (push) Has been cancelled
full compatibility check / lib_linux (peya) (push) Has been cancelled
full compatibility check / lib_linux (salvium) (push) Has been cancelled
full compatibility check / macos build (monero) (push) Has been cancelled
full compatibility check / macos build (peya) (push) Has been cancelled
full compatibility check / macos build (salvium) (push) Has been cancelled
full compatibility check / ios build (monero) (push) Has been cancelled
full compatibility check / ios build (peya) (push) Has been cancelled
full compatibility check / ios build (salvium) (push) Has been cancelled
full compatibility check / create single release file (push) Has been cancelled
full compatibility check / test ts library (push) Has been cancelled
full compatibility check / linux regression tests (monero) (push) Has been cancelled
full compatibility check / linux regression tests (peya) (push) Has been cancelled
full compatibility check / linux regression tests (salvium) (push) Has been cancelled
full compatibility check / macos regression tests (monero) (push) Has been cancelled
full compatibility check / macos regression tests (peya) (push) Has been cancelled
full compatibility check / macos regression tests (salvium) (push) Has been cancelled
full compatibility check / linux integration tests (monero) (push) Has been cancelled
full compatibility check / linux integration tests (peya) (push) Has been cancelled
full compatibility check / linux integration tests (salvium) (push) Has been cancelled
full compatibility check / macos integration tests (monero) (push) Has been cancelled
full compatibility check / macos integration tests (peya) (push) Has been cancelled
full compatibility check / macos integration tests (salvium) (push) Has been cancelled
full compatibility check / comment on pr (push) Has been cancelled
Add salvium and peya support to monero_c
2026-04-06 14:38:17 +02:00

39 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
cd "$(realpath $(dirname $0))"
if [[ "$(uname)" == "Darwin" ]];
then
function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
fi
for coin in monero salvium peya;
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 }')-${submodule_hash}
COIN_wallet2_api_c_exp_sha256=$(sha256sum ${coin}_libwallet2_api_c/${coin}_libwallet2_api_c.exp | xargs | awk '{ print $1 }')
cat > ${coin}_libwallet2_api_c/src/main/cpp/${coin}_checksum.h << EOF
#ifndef MONEROC_CHECKSUMS
#define MONEROC_CHECKSUMS
const char * ${COIN}_wallet2_api_c_h_sha256 = "${COIN_wallet2_api_c_h_sha256}";
const char * ${COIN}_wallet2_api_c_cpp_sha256 = "${COIN_wallet2_api_c_cpp_sha256}";
const char * ${COIN}_wallet2_api_c_exp_sha256 = "${COIN_wallet2_api_c_exp_sha256}";
#endif
EOF
cat > impls/monero.dart/lib/src/checksum_${coin}.dart << EOF
// ignore_for_file: constant_identifier_names
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