summaryrefslogtreecommitdiff
path: root/impls/monero.ts/checksum.ts
diff options
context:
space:
mode:
authorsneurlax <sneurlax@gmail.com>2024-10-16 17:14:41 -0500
committerGitHub <noreply@github.com>2024-10-16 17:14:41 -0500
commit6260fed0d483dad6d8af016e1b223c36c13dca5b (patch)
treeff6accbbe075eef647b3666fce42ab8cf2874778 /impls/monero.ts/checksum.ts
parentb556f50129d1a55c81cb5bcdf749f154137c9999 (diff)
parent939040032f6e22529ccb6b5f54d9c48fc94db3d6 (diff)
Merge branch 'master' into rust
Diffstat (limited to 'impls/monero.ts/checksum.ts')
-rw-r--r--impls/monero.ts/checksum.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/impls/monero.ts/checksum.ts b/impls/monero.ts/checksum.ts
index 22d3038..b0d12b0 100644
--- a/impls/monero.ts/checksum.ts
+++ b/impls/monero.ts/checksum.ts
@@ -1,8 +1,8 @@
import { moneroChecksum } from "./checksum_monero.ts";
-import { readCString } from "./src/utils.ts";
-import { dylib, loadDylib } from "./src/bindings.ts";
+import { getSymbol, readCString } from "./src/utils.ts";
+import { dylib, loadMoneroDylib } from "./src/bindings.ts";
-loadDylib();
+loadMoneroDylib();
export class ChecksumError extends Error {
readonly code: number;
@@ -21,7 +21,7 @@ export class ChecksumError extends Error {
* @returns {ChecksumError} which contains information about why checksum failed
*/
export async function validateChecksum(): Promise<ChecksumError | null> {
- const cppHeaderHash = await readCString(await dylib.symbols.MONERO_checksum_wallet2_api_c_h(), false);
+ const cppHeaderHash = await readCString(await getSymbol("checksum_wallet2_api_c_h")!(), false);
const tsHeaderHash = moneroChecksum.wallet2_api_c_h_sha256;
const errors: string[] = [];
@@ -32,14 +32,14 @@ export async function validateChecksum(): Promise<ChecksumError | null> {
errorCode++;
}
- const cppSourceHash = await readCString(await dylib.symbols.MONERO_checksum_wallet2_api_c_cpp(), false);
+ const cppSourceHash = await readCString(await getSymbol("checksum_wallet2_api_c_cpp")!(), false);
const tsSourceHash = moneroChecksum.wallet2_api_c_cpp_sha256;
if (cppSourceHash !== tsSourceHash) {
errors.push(`ERR: CPP source file check mismatch ${cppSourceHash} == ${tsSourceHash}`);
errorCode++;
}
- const cppExportHash = await readCString(await dylib.symbols.MONERO_checksum_wallet2_api_c_exp(), false);
+ const cppExportHash = await readCString(await getSymbol("checksum_wallet2_api_c_exp")!(), false);
const tsExportHash = moneroChecksum.wallet2_api_c_exp_sha256;
if (cppExportHash !== tsExportHash) {
if (Deno.build.os !== "darwin") {