Add import template into tui. Fix tests that fail on macos. Fix some updates.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// Node js tool for temp dir
|
||||
import { tmpdir } from "node:os";
|
||||
|
||||
import { BlockchainMonitor, Engine } from "@xo-cash/engine";
|
||||
|
||||
import {
|
||||
@@ -16,6 +19,7 @@ import { InMemoryStorage } from "../../../src/services/storage";
|
||||
import { MockElectrumService } from "./electrum-service";
|
||||
import { MockRatesService } from "./rates-service";
|
||||
import { RatesService } from "../../../src/services/rates";
|
||||
import { SettingsService } from "../../../src/services/settings";
|
||||
|
||||
export const DEFAULT_SEED =
|
||||
"page pencil stock planet limb cluster assault speak off joke private pioneer";
|
||||
@@ -67,8 +71,6 @@ export const addFakeResource = async (
|
||||
status: UnspentOutputStatus.CONFIRMED,
|
||||
selectable: true,
|
||||
privacy: false,
|
||||
templateIdentifier: options.templateIdentifier ?? "test-template",
|
||||
outputIdentifier: options.outputIdentifier ?? "receiveOutput",
|
||||
outpointIndex: options.outpointIndex ?? 0,
|
||||
outpointTransactionHash: options.outpointTransactionHash ?? randomTxHash(),
|
||||
minedAtHeight: options.minedAtHeight ?? 800000,
|
||||
@@ -143,10 +145,7 @@ export const createMockEngine = async (seed: string) => {
|
||||
|
||||
// Create the in-memory blockchain provider.
|
||||
const blockchainProvider = new InMemoryBlockchainProvider();
|
||||
await blockchainProvider.initialize({
|
||||
applicationIdentifier: "xo-cli-tests",
|
||||
electrumOptions: {},
|
||||
});
|
||||
await blockchainProvider.initialize();
|
||||
|
||||
// Create the blockchain monitor instance.
|
||||
const blockchainMonitor = new BlockchainMonitor(state, blockchainProvider);
|
||||
@@ -160,10 +159,13 @@ export const createMockEngine = async (seed: string) => {
|
||||
};
|
||||
|
||||
export const createMockAppService = async (engine: Engine) => {
|
||||
const settings = new SettingsService(`${tmpdir()}/xo-cli-tests-settings.json`);
|
||||
settings.setCurrency("USD");
|
||||
|
||||
const storage = await InMemoryStorage.create();
|
||||
|
||||
const mockRates = new MockRatesService();
|
||||
const rates = new RatesService(mockRates);
|
||||
const rates = new RatesService(mockRates, settings);
|
||||
|
||||
const mockElectrum = new MockElectrumService();
|
||||
|
||||
@@ -176,5 +178,5 @@ export const createMockAppService = async (engine: Engine) => {
|
||||
invitationStoragePath: "test-invitations.db",
|
||||
};
|
||||
|
||||
return new AppService(engine, storage, config, mockElectrum, rates);
|
||||
return new AppService(engine, storage, config, mockElectrum, rates, settings);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user