diff options
| author | Mateusz Franik <47059999+Im-Beast@users.noreply.github.com> | 2024-10-16 07:55:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-16 07:55:11 +0200 |
| commit | fd7bb6ae1c27ffe5d41f3a818ee9034d9bb76138 (patch) | |
| tree | 01e57a1c483370a3f023ed27d401069502694396 /impls/monero.ts/checksum.ts | |
| parent | 44fd5e17bbce52caf681850ac79f463d9ce6bb31 (diff) | |
feat: wownero typescript bindings, regression tests (#71)
* regression tests
* ci: move regression_check to full_check workflow, reuse artifact build
* feat: support wownero in monero.ts bindings
* ci: test wownero regressions as well
* extract wownero-cli as wownero
* actually load wownero when specified
* fix: commitUR not being a symbol in wownero
Diffstat (limited to 'impls/monero.ts/checksum.ts')
| -rw-r--r-- | impls/monero.ts/checksum.ts | 12 |
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") { |
