From 1e3d9d96e7c01866a0ce5a10e99ed84abe5af18c Mon Sep 17 00:00:00 2001 From: Sam Holmes Date: Mon, 8 Apr 2024 13:46:05 -0700 Subject: [PATCH] Rename files to match main exported interface The convention is such that if a file's main purpose is to define a interface/type by a class or factory function, then the file name should match the name of that interface. So, we remove "make" from file names, and we make some changes to interface type names to match the file name. --- src/bch.ts | 2 +- src/bsv.ts | 2 +- src/btc.ts | 2 +- ...akeCurrencyPlugin.ts => CurrencyPlugin.ts} | 8 ++++---- ...{makeCurrencyTools.ts => CurrencyTools.ts} | 0 ...{makeEngineEmitter.ts => EngineEmitter.ts} | 2 +- .../plugin/{makeMetadata.ts => Metadata.ts} | 2 +- .../plugin/{pluginState.ts => PluginState.ts} | 8 ++++---- .../{serverScores.ts => ServerScores.ts} | 0 src/common/plugin/types.ts | 4 ++-- .../db/{makeBaselets.ts => Baselets.ts} | 0 .../db/Models/ProcessorTransaction.ts | 6 +++--- .../utxobased/db/{makeMutex.ts => Mutex.ts} | 0 .../db/{makeProcessor.ts => Processor.ts} | 2 +- src/common/utxobased/db/util/utxo.ts | 2 +- .../{makeServerStates.ts => ServerStates.ts} | 8 ++++---- .../{makeUtxoEngine.ts => UtxoEngine.ts} | 10 +++++----- ...eUtxoEngineState.ts => UtxoEngineState.ts} | 20 +++++++++---------- ...eUtxoWalletTools.ts => UtxoWalletTools.ts} | 6 +++--- .../engine/util/getOwnUtxosFromTx.ts | 2 +- src/common/utxobased/network/BlockBook.ts | 6 +++--- src/common/utxobased/network/Socket.ts | 2 +- ...{MakeSocketEmitter.ts => SocketEmitter.ts} | 0 src/firo.ts | 2 +- src/ftc.ts | 2 +- src/index.ts | 2 +- src/ltc.ts | 2 +- src/tbch.ts | 2 +- src/tbtc.ts | 2 +- src/tbtg.ts | 2 +- .../common.ts | 0 .../currencies/bitcoin.ts | 0 .../currencies/bitcoincash.ts | 0 .../currencies/bitcoinsv.ts | 0 .../currencies/digibyte.ts | 0 .../currencies/feathercoin.ts | 0 .../currencies/groestlcoin.ts | 0 .../currencies/litecoin.ts | 0 .../currencies/smartcash.ts | 0 .../currencies/zcoin.ts | 0 .../index.ts | 0 ...yPlugin.spec.ts => CurrencyPlugin.spec.ts} | 2 +- ...{makeMetadata.spec.ts => Metadata.spec.ts} | 4 ++-- ...verScores.spec.ts => ServerScores.spec.ts} | 4 ++-- test/common/utxobased/db/Processor.spec.ts | 2 +- .../utxobased/engine/UtxoWalletTools.spec.ts | 2 +- .../utxobased/network/BlockBook.spec.ts | 8 ++++---- 47 files changed, 65 insertions(+), 65 deletions(-) rename src/common/plugin/{makeCurrencyPlugin.ts => CurrencyPlugin.ts} (87%) rename src/common/plugin/{makeCurrencyTools.ts => CurrencyTools.ts} (100%) rename src/common/plugin/{makeEngineEmitter.ts => EngineEmitter.ts} (97%) rename src/common/plugin/{makeMetadata.ts => Metadata.ts} (97%) rename src/common/plugin/{pluginState.ts => PluginState.ts} (96%) rename src/common/plugin/{serverScores.ts => ServerScores.ts} (100%) rename src/common/utxobased/db/{makeBaselets.ts => Baselets.ts} (100%) rename src/common/utxobased/db/{makeMutex.ts => Mutex.ts} (100%) rename src/common/utxobased/db/{makeProcessor.ts => Processor.ts} (99%) rename src/common/utxobased/engine/{makeServerStates.ts => ServerStates.ts} (97%) rename src/common/utxobased/engine/{makeUtxoEngine.ts => UtxoEngine.ts} (98%) rename src/common/utxobased/engine/{makeUtxoEngineState.ts => UtxoEngineState.ts} (98%) rename src/common/utxobased/engine/{makeUtxoWalletTools.ts => UtxoWalletTools.ts} (98%) rename src/common/utxobased/network/{MakeSocketEmitter.ts => SocketEmitter.ts} (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/common.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/bitcoin.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/bitcoincash.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/bitcoinsv.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/digibyte.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/feathercoin.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/groestlcoin.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/litecoin.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/smartcash.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/currencies/zcoin.ts (100%) rename test/common/plugin/{currencyPlugin.fixtures => CurrencyPlugin.fixtures}/index.ts (100%) rename test/common/plugin/{currencyPlugin.spec.ts => CurrencyPlugin.spec.ts} (99%) rename test/common/plugin/{makeMetadata.spec.ts => Metadata.spec.ts} (95%) rename test/common/plugin/{serverScores.spec.ts => ServerScores.spec.ts} (98%) diff --git a/src/bch.ts b/src/bch.ts index b2f8b694..8755948e 100644 --- a/src/bch.ts +++ b/src/bch.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/bitcoincash' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/bsv.ts b/src/bsv.ts index f51cb9ab..8059f176 100644 --- a/src/bsv.ts +++ b/src/bsv.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/bitcoinsv' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/btc.ts b/src/btc.ts index b9fb7b2a..2f457c1c 100644 --- a/src/btc.ts +++ b/src/btc.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/bitcoin' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/common/plugin/makeCurrencyPlugin.ts b/src/common/plugin/CurrencyPlugin.ts similarity index 87% rename from src/common/plugin/makeCurrencyPlugin.ts rename to src/common/plugin/CurrencyPlugin.ts index 565b8701..4c46f44e 100644 --- a/src/common/plugin/makeCurrencyPlugin.ts +++ b/src/common/plugin/CurrencyPlugin.ts @@ -7,11 +7,11 @@ import { EdgeWalletInfo } from 'edge-core-js/types' -import { makeUtxoEngine } from '../utxobased/engine/makeUtxoEngine' import { asUtxoUserSettings } from '../utxobased/engine/types' -import { makeCurrencyTools } from './makeCurrencyTools' -import { makeEngineEmitter } from './makeEngineEmitter' -import { makePluginState } from './pluginState' +import { makeUtxoEngine } from '../utxobased/engine/UtxoEngine' +import { makeCurrencyTools } from './CurrencyTools' +import { makeEngineEmitter } from './EngineEmitter' +import { makePluginState } from './PluginState' import { EngineConfig, PluginInfo } from './types' export function makeCurrencyPlugin( diff --git a/src/common/plugin/makeCurrencyTools.ts b/src/common/plugin/CurrencyTools.ts similarity index 100% rename from src/common/plugin/makeCurrencyTools.ts rename to src/common/plugin/CurrencyTools.ts diff --git a/src/common/plugin/makeEngineEmitter.ts b/src/common/plugin/EngineEmitter.ts similarity index 97% rename from src/common/plugin/makeEngineEmitter.ts rename to src/common/plugin/EngineEmitter.ts index 2542f8e6..f8b463c0 100644 --- a/src/common/plugin/makeEngineEmitter.ts +++ b/src/common/plugin/EngineEmitter.ts @@ -5,7 +5,7 @@ import { } from 'edge-core-js/types' import { EventEmitter } from 'events' -import { SubscribeAddressResponse } from '../utxobased/network/BlockBookAPI' +import { SubscribeAddressResponse } from '../utxobased/network/blockbookApi' export declare interface EngineEmitter { emit: (( diff --git a/src/common/plugin/makeMetadata.ts b/src/common/plugin/Metadata.ts similarity index 97% rename from src/common/plugin/makeMetadata.ts rename to src/common/plugin/Metadata.ts index 8361fecb..bec6d8cf 100644 --- a/src/common/plugin/makeMetadata.ts +++ b/src/common/plugin/Metadata.ts @@ -4,7 +4,7 @@ import { EdgeLog } from 'edge-core-js/types' import { makeMemlet } from 'memlet' import AwaitLock from '../utxobased/engine/await-lock' -import { EngineEmitter, EngineEvent } from './makeEngineEmitter' +import { EngineEmitter, EngineEvent } from './EngineEmitter' import { asLocalWalletMetadata, LocalWalletMetadata } from './types' import { removeItem } from './utils' diff --git a/src/common/plugin/pluginState.ts b/src/common/plugin/PluginState.ts similarity index 96% rename from src/common/plugin/pluginState.ts rename to src/common/plugin/PluginState.ts index 780ec3f2..60734a9a 100644 --- a/src/common/plugin/pluginState.ts +++ b/src/common/plugin/PluginState.ts @@ -5,19 +5,19 @@ import { Disklet } from 'disklet' import { EdgeIo, EdgeLog } from 'edge-core-js/types' import { makeMemlet } from 'memlet' -import { UtxoEngineState } from '../utxobased/engine/makeUtxoEngineState' import { UtxoUserSettings } from '../utxobased/engine/types' +import { UtxoEngineState } from '../utxobased/engine/UtxoEngineState' import { asServerCache, ServerCache, ServerList, ServerScores -} from './serverScores' +} from './ServerScores' // Info server endpoint to getting ServerListInfo data const serverListInfoUrl = 'https://info1.edge.app/v1/blockBook/' -// The filename for ServerInfoCache data (see serverScores.ts) -// Perhaps this should be in serverScores.ts file, but that'll take some refactoring +// The filename for ServerInfoCache data (see ServerScores.ts) +// Perhaps this should be in ServerScores.ts file, but that'll take some refactoring const SERVER_CACHE_FILE = 'serverCache.json' // ServerListInfo data structure from info server and saved to disk diff --git a/src/common/plugin/serverScores.ts b/src/common/plugin/ServerScores.ts similarity index 100% rename from src/common/plugin/serverScores.ts rename to src/common/plugin/ServerScores.ts diff --git a/src/common/plugin/types.ts b/src/common/plugin/types.ts index 90c7439d..4884f66f 100644 --- a/src/common/plugin/types.ts +++ b/src/common/plugin/types.ts @@ -25,8 +25,8 @@ import * as wif from 'wif' import { asIUTXO, IProcessorTransaction, IUTXO } from '../utxobased/db/types' import { ScriptTemplates } from '../utxobased/info/scriptTemplates/types' import { UtxoPicker } from '../utxobased/keymanager/utxopicker' -import { EngineEmitter } from './makeEngineEmitter' -import { PluginState } from './pluginState' +import { EngineEmitter } from './EngineEmitter' +import { PluginState } from './PluginState' export type CurrencyFormat = ReturnType export const asCurrencyFormat = asValue('bip32', 'bip44', 'bip49', 'bip84') diff --git a/src/common/utxobased/db/makeBaselets.ts b/src/common/utxobased/db/Baselets.ts similarity index 100% rename from src/common/utxobased/db/makeBaselets.ts rename to src/common/utxobased/db/Baselets.ts diff --git a/src/common/utxobased/db/Models/ProcessorTransaction.ts b/src/common/utxobased/db/Models/ProcessorTransaction.ts index 4bfaa0e5..42933a51 100644 --- a/src/common/utxobased/db/Models/ProcessorTransaction.ts +++ b/src/common/utxobased/db/Models/ProcessorTransaction.ts @@ -4,9 +4,9 @@ import BN from 'bn.js' import { EdgeTransaction, JsonObject } from 'edge-core-js/types' import { PluginInfo } from '../../../plugin/types' -import { UTXOPluginWalletTools } from '../../engine/makeUtxoWalletTools' import { UtxoTxOtherParams } from '../../engine/types' -import { Processor } from '../makeProcessor' +import { UtxoWalletTools } from '../../engine/UtxoWalletTools' +import { Processor } from '../Processor' import { IProcessorTransaction } from '../types' export const fromEdgeTransaction = ( @@ -54,7 +54,7 @@ export const fromEdgeTransaction = ( interface ToEdgeTransactionArgs { walletId: string tx: IProcessorTransaction - walletTools: UTXOPluginWalletTools + walletTools: UtxoWalletTools processor: Processor pluginInfo: PluginInfo } diff --git a/src/common/utxobased/db/makeMutex.ts b/src/common/utxobased/db/Mutex.ts similarity index 100% rename from src/common/utxobased/db/makeMutex.ts rename to src/common/utxobased/db/Mutex.ts diff --git a/src/common/utxobased/db/makeProcessor.ts b/src/common/utxobased/db/Processor.ts similarity index 99% rename from src/common/utxobased/db/makeProcessor.ts rename to src/common/utxobased/db/Processor.ts index 8e6ee2d4..78c651f1 100644 --- a/src/common/utxobased/db/makeProcessor.ts +++ b/src/common/utxobased/db/Processor.ts @@ -6,7 +6,7 @@ import { makeMemlet } from 'memlet' import { unixTime } from '../../../util/unixTime' import { AddressPath, ChangePath } from '../../plugin/types' -import { makeBaselets } from './makeBaselets' +import { makeBaselets } from './Baselets' import { addressPathToPrefix, TxIdByDate } from './Models/baselet' import { IAddress, diff --git a/src/common/utxobased/db/util/utxo.ts b/src/common/utxobased/db/util/utxo.ts index 300d3f5d..07dc07b6 100644 --- a/src/common/utxobased/db/util/utxo.ts +++ b/src/common/utxobased/db/util/utxo.ts @@ -3,7 +3,7 @@ import { BIP43PurposeTypeEnum, ScriptTypeEnum } from '../../keymanager/keymanager' -import { Processor } from '../makeProcessor' +import { Processor } from '../Processor' import { IProcessorTransaction, IUTXO } from '../types' export const utxoFromProcessorTransactionInput = async ( diff --git a/src/common/utxobased/engine/makeServerStates.ts b/src/common/utxobased/engine/ServerStates.ts similarity index 97% rename from src/common/utxobased/engine/makeServerStates.ts rename to src/common/utxobased/engine/ServerStates.ts index 35be1103..f177eb83 100644 --- a/src/common/utxobased/engine/makeServerStates.ts +++ b/src/common/utxobased/engine/ServerStates.ts @@ -1,16 +1,16 @@ import { EdgeLog, EdgeTransaction } from 'edge-core-js/types' import { parse } from 'uri-js' -import { EngineEmitter, EngineEvent } from '../../plugin/makeEngineEmitter' -import { PluginState } from '../../plugin/pluginState' +import { EngineEmitter, EngineEvent } from '../../plugin/EngineEmitter' +import { PluginState } from '../../plugin/PluginState' import { PluginInfo } from '../../plugin/types' import { removeItem } from '../../plugin/utils' import { SafeWalletInfo } from '../keymanager/cleaners' import { BlockBook, makeBlockBook } from '../network/BlockBook' -import { SubscribeAddressResponse } from '../network/BlockBookAPI' +import { SubscribeAddressResponse } from '../network/blockbookApi' import Deferred from '../network/Deferred' -import { SocketEmitter, SocketEvent } from '../network/MakeSocketEmitter' import { WsTask } from '../network/Socket' +import { SocketEmitter, SocketEvent } from '../network/SocketEmitter' import { pushUpdate, removeIdFromQueue } from '../network/socketQueue' import { MAX_CONNECTIONS, NEW_CONNECTIONS } from './constants' diff --git a/src/common/utxobased/engine/makeUtxoEngine.ts b/src/common/utxobased/engine/UtxoEngine.ts similarity index 98% rename from src/common/utxobased/engine/makeUtxoEngine.ts rename to src/common/utxobased/engine/UtxoEngine.ts index 9e790a9b..8cd90164 100644 --- a/src/common/utxobased/engine/makeUtxoEngine.ts +++ b/src/common/utxobased/engine/UtxoEngine.ts @@ -21,15 +21,15 @@ import { import { filterUndefined } from '../../../util/filterUndefined' import { unixTime } from '../../../util/unixTime' import { makeFees } from '../../fees/makeFees' -import { EngineEmitter, EngineEvent } from '../../plugin/makeEngineEmitter' -import { makeMetadata } from '../../plugin/makeMetadata' +import { EngineEmitter, EngineEvent } from '../../plugin/EngineEmitter' +import { makeMetadata } from '../../plugin/Metadata' import { EngineConfig, TxOptions } from '../../plugin/types' import { upgradeMemos } from '../../upgradeMemos' -import { makeProcessor } from '../db/makeProcessor' import { fromEdgeTransaction, toEdgeTransaction } from '../db/Models/ProcessorTransaction' +import { makeProcessor } from '../db/Processor' import { IProcessorTransaction, IUTXO } from '../db/types' import { utxoFromProcessorTransactionInput } from '../db/util/utxo' import { @@ -47,8 +47,6 @@ import { } from '../keymanager/keymanager' import { asMaybeInsufficientFundsErrorPlus } from '../keymanager/types' import { transactionSizeFromHex } from '../keymanager/utxopicker/utils' -import { makeUtxoEngineState, transactionChanged } from './makeUtxoEngineState' -import { makeUtxoWalletTools } from './makeUtxoWalletTools' import { createPayment, getPaymentDetails, sendPayment } from './paymentRequest' import { asUtxoSignMessageOtherParams, @@ -63,6 +61,8 @@ import { pathToPurposeType, sumUtxos } from './utils' +import { makeUtxoEngineState, transactionChanged } from './UtxoEngineState' +import { makeUtxoWalletTools } from './UtxoWalletTools' export async function makeUtxoEngine( config: EngineConfig diff --git a/src/common/utxobased/engine/makeUtxoEngineState.ts b/src/common/utxobased/engine/UtxoEngineState.ts similarity index 98% rename from src/common/utxobased/engine/makeUtxoEngineState.ts rename to src/common/utxobased/engine/UtxoEngineState.ts index ca590e01..31dc4148 100644 --- a/src/common/utxobased/engine/makeUtxoEngineState.ts +++ b/src/common/utxobased/engine/UtxoEngineState.ts @@ -7,8 +7,8 @@ import { EdgeTransaction } from 'edge-core-js/types' -import { EngineEmitter, EngineEvent } from '../../plugin/makeEngineEmitter' -import { PluginState } from '../../plugin/pluginState' +import { EngineEmitter, EngineEvent } from '../../plugin/EngineEmitter' +import { PluginState } from '../../plugin/PluginState' import { AddressPath, ChangePath, @@ -18,8 +18,8 @@ import { PluginInfo } from '../../plugin/types' import { removeItem } from '../../plugin/utils' -import { Processor } from '../db/makeProcessor' import { toEdgeTransaction } from '../db/Models/ProcessorTransaction' +import { Processor } from '../db/Processor' import { IAddress, IProcessorTransaction, @@ -42,19 +42,19 @@ import { transactionMessage, transactionMessageSpecific, TransactionResponse -} from '../network/BlockBookAPI' +} from '../network/blockbookApi' import Deferred from '../network/Deferred' import { WsTask } from '../network/Socket' import AwaitLock from './await-lock' import { BLOCKBOOK_TXS_PER_PAGE, CACHE_THROTTLE } from './constants' -import { makeServerStates, ServerStates } from './makeServerStates' -import { UTXOPluginWalletTools } from './makeUtxoWalletTools' +import { makeServerStates, ServerStates } from './ServerStates' import { getFormatSupportedBranches, getScriptTypeFromPurposeType, pathToPurposeType, validScriptPubkeyFromAddress } from './utils' +import { UtxoWalletTools } from './UtxoWalletTools' export interface UtxoEngineState { processedPercent: number @@ -86,7 +86,7 @@ export interface UtxoEngineState { } export interface UtxoEngineStateConfig extends EngineConfig { - walletTools: UTXOPluginWalletTools + walletTools: UtxoWalletTools walletInfo: SafeWalletInfo processor: Processor } @@ -513,7 +513,7 @@ export function makeUtxoEngineState( interface CommonArgs { pluginInfo: PluginInfo walletInfo: SafeWalletInfo - walletTools: UTXOPluginWalletTools + walletTools: UtxoWalletTools processor: Processor emitter: EngineEmitter taskCache: TaskCache @@ -686,7 +686,7 @@ interface TransactionChangedArgs { walletId: string tx: IProcessorTransaction emitter: EngineEmitter - walletTools: UTXOPluginWalletTools + walletTools: UtxoWalletTools pluginInfo: PluginInfo processor: Processor } @@ -1079,7 +1079,7 @@ const updateTransactions = ( } interface DeriveScriptAddressArgs { - walletTools: UTXOPluginWalletTools + walletTools: UtxoWalletTools engineInfo: EngineInfo processor: Processor format: CurrencyFormat diff --git a/src/common/utxobased/engine/makeUtxoWalletTools.ts b/src/common/utxobased/engine/UtxoWalletTools.ts similarity index 98% rename from src/common/utxobased/engine/makeUtxoWalletTools.ts rename to src/common/utxobased/engine/UtxoWalletTools.ts index ba14e0b7..9cebf59d 100644 --- a/src/common/utxobased/engine/makeUtxoWalletTools.ts +++ b/src/common/utxobased/engine/UtxoWalletTools.ts @@ -32,7 +32,7 @@ export interface WalletToolsConfig { publicKey: PublicKey } -export interface UTXOPluginWalletTools { +export interface UtxoWalletTools { getPubkey: (args: AddressPath) => string getScriptPubkey: (args: AddressPath) => ScriptPubkeyReturn @@ -96,14 +96,14 @@ interface SignMessageArgs { export function makeUtxoWalletTools( config: WalletToolsConfig -): UTXOPluginWalletTools { +): UtxoWalletTools { const { pluginInfo, publicKey } = config const { engineInfo } = pluginInfo const { name: coin } = pluginInfo.coinInfo const xpubKeys = publicKey.publicKeys - const fns: UTXOPluginWalletTools = { + const fns: UtxoWalletTools = { getPubkey(args: AddressPath): string { if (xpubKeys[args.format] == null) { throw new Error( diff --git a/src/common/utxobased/engine/util/getOwnUtxosFromTx.ts b/src/common/utxobased/engine/util/getOwnUtxosFromTx.ts index c13092bd..b94c5c16 100644 --- a/src/common/utxobased/engine/util/getOwnUtxosFromTx.ts +++ b/src/common/utxobased/engine/util/getOwnUtxosFromTx.ts @@ -1,5 +1,5 @@ import { EngineInfo } from '../../../plugin/types' -import { Processor } from '../../db/makeProcessor' +import { Processor } from '../../db/Processor' import { IProcessorTransaction, IUTXO } from '../../db/types' import { BIP43PurposeTypeEnum } from '../../keymanager/keymanager' import { getScriptTypeFromPurposeType, pathToPurposeType } from '../utils' diff --git a/src/common/utxobased/network/BlockBook.ts b/src/common/utxobased/network/BlockBook.ts index 2dad4de3..a7f00b8c 100644 --- a/src/common/utxobased/network/BlockBook.ts +++ b/src/common/utxobased/network/BlockBook.ts @@ -1,7 +1,7 @@ import { Cleaner } from 'cleaners' import { EdgeLog, EdgeTransaction } from 'edge-core-js/types' -import { EngineEmitter, EngineEvent } from '../../plugin/makeEngineEmitter' +import { EngineEmitter, EngineEvent } from '../../plugin/EngineEmitter' import { addressMessage, AddressResponse, @@ -20,10 +20,10 @@ import { SubscribeNewBlockResponse, transactionMessage, TransactionResponse -} from './BlockBookAPI' +} from './blockbookApi' import Deferred from './Deferred' -import { SocketEmitter } from './MakeSocketEmitter' import { makeSocket, OnQueueSpaceCB } from './Socket' +import { SocketEmitter } from './SocketEmitter' export type WatchAddressesCB = ( response: SubscribeAddressResponse diff --git a/src/common/utxobased/network/Socket.ts b/src/common/utxobased/network/Socket.ts index 09c5af9a..4fa90650 100644 --- a/src/common/utxobased/network/Socket.ts +++ b/src/common/utxobased/network/Socket.ts @@ -3,8 +3,8 @@ import { EdgeLog } from 'edge-core-js/types' import { removeItem } from '../../plugin/utils' import Deferred from './Deferred' -import { SocketEmitter, SocketEvent } from './MakeSocketEmitter' import { setupWS } from './nodejsWS' +import { SocketEmitter, SocketEvent } from './SocketEmitter' import { pushUpdate, removeIdFromQueue } from './socketQueue' import { InnerSocket, InnerSocketCallbacks, ReadyState } from './types' import { setupBrowser } from './windowWS' diff --git a/src/common/utxobased/network/MakeSocketEmitter.ts b/src/common/utxobased/network/SocketEmitter.ts similarity index 100% rename from src/common/utxobased/network/MakeSocketEmitter.ts rename to src/common/utxobased/network/SocketEmitter.ts diff --git a/src/firo.ts b/src/firo.ts index ebe935c8..3f7878d7 100644 --- a/src/firo.ts +++ b/src/firo.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/zcoin' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/ftc.ts b/src/ftc.ts index b6b6a1e8..8e609204 100644 --- a/src/ftc.ts +++ b/src/ftc.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/feathercoin' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/index.ts b/src/index.ts index cc1592f7..928e0b8b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCorePlugins } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { all } from './common/utxobased/info/all' const plugins: EdgeCorePlugins = {} diff --git a/src/ltc.ts b/src/ltc.ts index 79b28213..127d8325 100644 --- a/src/ltc.ts +++ b/src/ltc.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/litecoin' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/tbch.ts b/src/tbch.ts index aa33a3da..d6b432ce 100644 --- a/src/tbch.ts +++ b/src/tbch.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/bitcoincashtestnet' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/tbtc.ts b/src/tbtc.ts index 2efcae42..6f0ee210 100644 --- a/src/tbtc.ts +++ b/src/tbtc.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/bitcointestnet' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/src/tbtg.ts b/src/tbtg.ts index d31dfa03..2c8a9869 100644 --- a/src/tbtg.ts +++ b/src/tbtg.ts @@ -1,6 +1,6 @@ import { EdgeCorePluginOptions, EdgeCurrencyPlugin } from 'edge-core-js/types' -import { makeCurrencyPlugin } from './common/plugin/makeCurrencyPlugin' +import { makeCurrencyPlugin } from './common/plugin/CurrencyPlugin' import { info } from './common/utxobased/info/bitcoingoldtestnet' const plugin = (options: EdgeCorePluginOptions): EdgeCurrencyPlugin => diff --git a/test/common/plugin/currencyPlugin.fixtures/common.ts b/test/common/plugin/CurrencyPlugin.fixtures/common.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/common.ts rename to test/common/plugin/CurrencyPlugin.fixtures/common.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/bitcoin.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/bitcoin.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/bitcoin.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/bitcoin.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/bitcoincash.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/bitcoincash.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/bitcoincash.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/bitcoincash.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/bitcoinsv.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/bitcoinsv.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/bitcoinsv.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/bitcoinsv.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/digibyte.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/digibyte.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/digibyte.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/digibyte.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/feathercoin.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/feathercoin.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/feathercoin.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/feathercoin.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/groestlcoin.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/groestlcoin.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/groestlcoin.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/groestlcoin.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/litecoin.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/litecoin.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/litecoin.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/litecoin.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/smartcash.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/smartcash.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/smartcash.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/smartcash.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/currencies/zcoin.ts b/test/common/plugin/CurrencyPlugin.fixtures/currencies/zcoin.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/currencies/zcoin.ts rename to test/common/plugin/CurrencyPlugin.fixtures/currencies/zcoin.ts diff --git a/test/common/plugin/currencyPlugin.fixtures/index.ts b/test/common/plugin/CurrencyPlugin.fixtures/index.ts similarity index 100% rename from test/common/plugin/currencyPlugin.fixtures/index.ts rename to test/common/plugin/CurrencyPlugin.fixtures/index.ts diff --git a/test/common/plugin/currencyPlugin.spec.ts b/test/common/plugin/CurrencyPlugin.spec.ts similarity index 99% rename from test/common/plugin/currencyPlugin.spec.ts rename to test/common/plugin/CurrencyPlugin.spec.ts index 0532c3bb..7b7e6bf9 100644 --- a/test/common/plugin/currencyPlugin.spec.ts +++ b/test/common/plugin/CurrencyPlugin.spec.ts @@ -11,7 +11,7 @@ import { before, describe, it } from 'mocha' import edgeCorePlugins from '../../../src/index' import { testLog } from '../../util/testLog' -import { fixtures } from './currencyPlugin.fixtures/index' +import { fixtures } from './CurrencyPlugin.fixtures/index' describe('currencyPlugins.spec', () => { for (const fixture of fixtures) { diff --git a/test/common/plugin/makeMetadata.spec.ts b/test/common/plugin/Metadata.spec.ts similarity index 95% rename from test/common/plugin/makeMetadata.spec.ts rename to test/common/plugin/Metadata.spec.ts index 7ed53126..c7239878 100644 --- a/test/common/plugin/makeMetadata.spec.ts +++ b/test/common/plugin/Metadata.spec.ts @@ -7,8 +7,8 @@ import { EdgeLog } from 'edge-core-js/types' import { EngineEmitter, EngineEvent -} from '../../../src/common/plugin/makeEngineEmitter' -import { makeMetadata, Metadata } from '../../../src/common/plugin/makeMetadata' +} from '../../../src/common/plugin/EngineEmitter' +import { makeMetadata, Metadata } from '../../../src/common/plugin/Metadata' import { makeFakeLog } from '../../utils' chai.should() diff --git a/test/common/plugin/serverScores.spec.ts b/test/common/plugin/ServerScores.spec.ts similarity index 98% rename from test/common/plugin/serverScores.spec.ts rename to test/common/plugin/ServerScores.spec.ts index 9d8be9f3..c68bfdc1 100644 --- a/test/common/plugin/serverScores.spec.ts +++ b/test/common/plugin/ServerScores.spec.ts @@ -3,10 +3,10 @@ import { assert } from 'chai' import { describe, it } from 'mocha' -import { ServerScores } from '../../../src/common/plugin/serverScores' +import { ServerScores } from '../../../src/common/plugin/ServerScores' import { makeFakeLog } from '../../utils' -describe(`ServerCache`, function () { +describe(`ServerScores`, function () { const testLog = makeFakeLog() const callback = (_: string): void => { return diff --git a/test/common/utxobased/db/Processor.spec.ts b/test/common/utxobased/db/Processor.spec.ts index 6ebd4046..1cf5be58 100644 --- a/test/common/utxobased/db/Processor.spec.ts +++ b/test/common/utxobased/db/Processor.spec.ts @@ -6,7 +6,7 @@ import { makeMemoryDisklet } from 'disklet' import { makeProcessor, Processor -} from '../../../../src/common/utxobased/db/makeProcessor' +} from '../../../../src/common/utxobased/db/Processor' import { IAddress, IProcessorTransaction, diff --git a/test/common/utxobased/engine/UtxoWalletTools.spec.ts b/test/common/utxobased/engine/UtxoWalletTools.spec.ts index fd0fe2f7..4fc46600 100644 --- a/test/common/utxobased/engine/UtxoWalletTools.spec.ts +++ b/test/common/utxobased/engine/UtxoWalletTools.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' -import { makeUtxoWalletTools } from '../../../../src/common/utxobased/engine/makeUtxoWalletTools' +import { makeUtxoWalletTools } from '../../../../src/common/utxobased/engine/UtxoWalletTools' import { info as pluginInfo } from '../../../../src/common/utxobased/info/bitcoin' describe('wallet tools tests', () => { diff --git a/test/common/utxobased/network/BlockBook.spec.ts b/test/common/utxobased/network/BlockBook.spec.ts index 25ed9c1a..66abbca7 100644 --- a/test/common/utxobased/network/BlockBook.spec.ts +++ b/test/common/utxobased/network/BlockBook.spec.ts @@ -6,18 +6,18 @@ import WS from 'ws' import { EngineEmitter, EngineEvent -} from '../../../../src/common/plugin/makeEngineEmitter' +} from '../../../../src/common/plugin/EngineEmitter' import { BlockBook, makeBlockBook } from '../../../../src/common/utxobased/network/BlockBook' -import { SubscribeAddressResponse } from '../../../../src/common/utxobased/network/BlockBookAPI' +import { SubscribeAddressResponse } from '../../../../src/common/utxobased/network/blockbookApi' import Deferred from '../../../../src/common/utxobased/network/Deferred' +import { WsTask } from '../../../../src/common/utxobased/network/Socket' import { SocketEmitter, SocketEvent -} from '../../../../src/common/utxobased/network/MakeSocketEmitter' -import { WsTask } from '../../../../src/common/utxobased/network/Socket' +} from '../../../../src/common/utxobased/network/SocketEmitter' import { makeFakeLog } from '../../../utils' chai.should()