summaryrefslogtreecommitdiff
path: root/generate_checksum.sh
diff options
context:
space:
mode:
authorcyan <cyjan@mrcyjanek.net>2024-09-19 10:59:07 +0200
committerGitHub <noreply@github.com>2024-09-19 10:59:07 +0200
commitd1940944943cd79ce1f2b2080456dd28bec5c36f (patch)
tree8a2a29c5de6cec47ccefff3472f38a8ecb9fb8af /generate_checksum.sh
parent0b91e91d19d4a11d753f9bdda56398bcfcdb4260 (diff)
feat: deno ffi bindings (#40)
* initial ts commit * monero.ts improvements * test on latest, build on debian:bookworm * feat: upstream changes to bindings * chore: update checksums * feat: allow manually loading dylib * chore: add readme * fix: free strings after being read to prevent potential memory leaks * fix: load dylib * fix: checksum checks segfaulting because of freeing const variables --------- Co-authored-by: Mateusz Franik <47059999+Im-Beast@users.noreply.github.com> Co-authored-by: Im-Beast <franik.mateusz@gmail.com>
Diffstat (limited to 'generate_checksum.sh')
-rwxr-xr-xgenerate_checksum.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/generate_checksum.sh b/generate_checksum.sh
index 5847ff5..4b82e53 100755
--- a/generate_checksum.sh
+++ b/generate_checksum.sh
@@ -1,6 +1,11 @@
#!/bin/bash
cd "$(realpath $(dirname $0))"
-function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
+
+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 }')
@@ -23,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