Formatting

This commit is contained in:
2026-04-20 12:26:35 +00:00
parent 32c42cdc2d
commit dbfb2c68d2
32 changed files with 3557 additions and 1828 deletions

View File

@@ -1,6 +1,11 @@
import { BlockchainMonitor, Engine } from "@xo-cash/engine";
import { createStorageAdapter, State, StorageType, type UnspentOutputData } from "@xo-cash/state";
import {
createStorageAdapter,
State,
StorageType,
type UnspentOutputData,
} from "@xo-cash/state";
import { InMemoryBlockchainProvider } from "@xo-cash/engine";
import { convertMnemonicToSeedBytes } from "@xo-cash/crypto";
@@ -9,7 +14,8 @@ import { AppService } from "../../../src/services/app";
import { InMemoryStorage } from "../../../src/services/storage";
import { MockElectrumService } from "./electrum-service";
export const DEFAULT_SEED = "page pencil stock planet limb cluster assault speak off joke private pioneer";
export const DEFAULT_SEED =
"page pencil stock planet limb cluster assault speak off joke private pioneer";
/**
* Options for creating a fake resource (UTXO) in tests.
@@ -39,7 +45,9 @@ export type FakeResourceOptions = {
export const randomTxHash = (): string => {
const bytes = new Uint8Array(32);
crypto.getRandomValues(bytes);
return Array.from(bytes).map(b => b.toString(16).padStart(2, "0")).join("");
return Array.from(bytes)
.map((b) => b.toString(16).padStart(2, "0"))
.join("");
};
/**
@@ -62,7 +70,9 @@ export const addFakeResource = async (
outpointTransactionHash: options.outpointTransactionHash ?? randomTxHash(),
minedAtHeight: options.minedAtHeight ?? 800000,
valueSatoshis: options.valueSatoshis ?? 10000,
lockingBytecode: options.lockingBytecode ?? "76a914000000000000000000000000000000000000000088ac",
lockingBytecode:
options.lockingBytecode ??
"76a914000000000000000000000000000000000000000088ac",
reservedBy: options.reservedBy,
};
@@ -161,4 +171,4 @@ export const createMockAppService = async (engine: Engine) => {
};
return new AppService(engine, storage, config, electrum);
};
};