summaryrefslogtreecommitdiff
path: root/tests/compare.ts
blob: 8c13fc531a38d003835521df22c1533d0e565937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { assertEquals } from "jsr:@std/assert";

import { WalletManager } from "../impls/monero.ts/mod.ts";
import { loadDylib } from "./utils.ts";

const coin = Deno.args[0] as "monero" | "wownero";
const version = Deno.args[1];
const walletInfo = JSON.parse(Deno.args[2]);

loadDylib(coin, version);

const walletManager = await WalletManager.new();
const wallet = await walletManager.openWallet(walletInfo.path, walletInfo.password);

assertEquals(await wallet.address(), walletInfo.address);

assertEquals(await wallet.publicSpendKey(), walletInfo.publicSpendKey);
assertEquals(await wallet.secretSpendKey(), walletInfo.secretSpendKey);

assertEquals(await wallet.publicViewKey(), walletInfo.publicViewKey);
assertEquals(await wallet.secretViewKey(), walletInfo.secretViewKey);

await wallet.store(walletInfo.path);