feat: wallet operations engine and encrypted storage with tests

This commit is contained in:
2026-08-19 21:06:17 +02:00
parent 6f966d5a2d
commit 1c9e7165e4
19 changed files with 2698 additions and 7 deletions
+28
View File
@@ -0,0 +1,28 @@
// Shared test scaffolding: an in-memory localStorage (Node has none outside
// a browser) plus the mock-mint helpers every suite uses.
import {vi} from 'vitest'
export class LocalStorageStub {
private map = new Map<string, string>()
getItem = (key: string): string | null => this.map.get(key) ?? null
setItem = (key: string, value: string): void => {
this.map.set(key, String(value))
}
removeItem = (key: string): void => {
this.map.delete(key)
}
clear = (): void => {
this.map.clear()
}
get length(): number {
return this.map.size
}
key = (index: number): string | null => [...this.map.keys()][index] ?? null
}
export const stubLocalStorage = (): LocalStorageStub => {
const stub = new LocalStorageStub()
vi.stubGlobal('localStorage', stub)
return stub
}