aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
committerAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
commit56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 (patch)
treed6bc2557c56b93177bb14aa376847c6e123a4862 /test
parent13466248004327e9a026cb89f94926f9b060d1c1 (diff)
downloadcoinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz
coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip
format
Diffstat (limited to 'test')
-rw-r--r--test/e2e/ark-receive-from-server-wallet.spec.ts21
-rw-r--r--test/unified-seed.test.ts12
2 files changed, 8 insertions, 25 deletions
diff --git a/test/e2e/ark-receive-from-server-wallet.spec.ts b/test/e2e/ark-receive-from-server-wallet.spec.ts
index 066e776e..bb7acb7b 100644
--- a/test/e2e/ark-receive-from-server-wallet.spec.ts
+++ b/test/e2e/ark-receive-from-server-wallet.spec.ts
@@ -6,9 +6,7 @@ const testSecret = process.env.E2E_TEST_SECRET;
const apiBaseUrl = process.env.E2E_API_BASE_URL || "http://localhost:3119";
const pauseAtEnd = process.env.E2E_PAUSE_AT_END === "true";
-test("bob receives 1000 sats in ark vault after server wallet send", async ({
- page,
-}) => {
+test("bob receives 1000 sats in ark vault after server wallet send", async ({ page }) => {
test.setTimeout(90_000);
test.skip(!testSecret, "E2E_TEST_SECRET is required for /test/ark/send");
@@ -19,9 +17,7 @@ test("bob receives 1000 sats in ark vault after server wallet send", async ({
await expect(page).toHaveURL(new RegExp(`/${username}(?:[/?#]|$)`));
- const arkAccountCard = page.locator(
- '[data-testid="account-card"][data-account-type="ark"]',
- );
+ const arkAccountCard = page.locator('[data-testid="account-card"][data-account-type="ark"]');
const arkAccountCount = await arkAccountCard.count();
expect(arkAccountCount).toBeGreaterThan(0);
@@ -32,10 +28,7 @@ test("bob receives 1000 sats in ark vault after server wallet send", async ({
for (let i = 0; i < arkAccountCount; i++) {
const card = arkAccountCard.nth(i);
await card.scrollIntoViewIfNeeded();
- const accountHref = await card
- .locator('a[href^="/account/"]')
- .first()
- .getAttribute("href");
+ const accountHref = await card.locator('a[href^="/account/"]').first().getAttribute("href");
const accountId = accountHref?.split("/account/")[1];
await card.locator('a[href="/invoice"]').first().click();
@@ -84,9 +77,7 @@ test("bob receives 1000 sats in ark vault after server wallet send", async ({
expect(invoiceOpened).toBeTruthy();
await expect(page).toHaveURL(/\/invoice\/[^/?#]+/);
- const invoiceText = (
- await page.getByTestId("invoice-text").first().innerText()
- ).trim();
+ const invoiceText = (await page.getByTestId("invoice-text").first().innerText()).trim();
const addressMatch = invoiceText.match(/t?ark1[a-z0-9]+/i);
expect(addressMatch).toBeTruthy();
const address = addressMatch![0];
@@ -118,9 +109,7 @@ test("bob receives 1000 sats in ark vault after server wallet send", async ({
let status: any;
for (let i = 0; i < 30; i++) {
- const statusResponse = await page.request.get(
- `${apiBaseUrl}/invoice/${invoiceId}`,
- );
+ const statusResponse = await page.request.get(`${apiBaseUrl}/invoice/${invoiceId}`);
if (statusResponse.ok()) {
status = await statusResponse.json();
if ((status?.received || 0) >= 1000 || (status?.pending || 0) >= 1000) {
diff --git a/test/unified-seed.test.ts b/test/unified-seed.test.ts
index e3c4dd31..4410dbea 100644
--- a/test/unified-seed.test.ts
+++ b/test/unified-seed.test.ts
@@ -95,9 +95,7 @@ describe("unified master seed", () => {
const btcChild = master.derive("m/84'/0'/0'");
const arkChild = master.derive("m/86'/0'/0'/0/0");
- expect(bytesToHex(btcChild.privateKey!)).not.toBe(
- bytesToHex(arkChild.privateKey!),
- );
+ expect(bytesToHex(btcChild.privateKey!)).not.toBe(bytesToHex(arkChild.privateKey!));
});
});
@@ -127,9 +125,7 @@ describe("full encrypt-derive-sign flow", () => {
const recoveredChild = recoveredMaster.derive("m/84'/0'/0'");
expect(recoveredChild.publicExtendedKey).toBe(pubkey);
- expect(bytesToHex(recoveredChild.privateKey!)).toBe(
- bytesToHex(btcChild.privateKey!),
- );
+ expect(bytesToHex(recoveredChild.privateKey!)).toBe(bytesToHex(btcChild.privateKey!));
});
it("simulates Ark unlock from user.seed", async () => {
@@ -187,9 +183,7 @@ describe("full encrypt-derive-sign flow", () => {
describe("backward compatibility", () => {
it("legacy per-account seed (raw hex) decrypts differently than mnemonic entropy", async () => {
// Legacy: encrypt raw 32-byte hex key
- const rawKey = hexToBytes(
- "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
- );
+ const rawKey = hexToBytes("deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef");
const legacySeed = await encrypt(rawKey, password);
// Decrypt legacy seed — get raw bytes back