diff --git a/src/common/plugin/CurrencyPlugin.ts b/src/common/plugin/CurrencyPlugin.ts index 11257da0..5a146e71 100644 --- a/src/common/plugin/CurrencyPlugin.ts +++ b/src/common/plugin/CurrencyPlugin.ts @@ -69,10 +69,9 @@ export function makeCurrencyPlugin( currencyTools, initOptions: asUtxoInitOptions(initOptions), io, - options: { - ...pluginOptions, - ...engineOptions, - emitter + emitter, + engineOptions: { + ...engineOptions }, pluginState } diff --git a/src/common/plugin/types.ts b/src/common/plugin/types.ts index e277d2df..160a086d 100644 --- a/src/common/plugin/types.ts +++ b/src/common/plugin/types.ts @@ -356,16 +356,13 @@ export interface EngineConfig { pluginInfo: PluginInfo pluginDisklet: Disklet currencyTools: EdgeCurrencyTools - options: EngineOptions + engineOptions: EdgeCurrencyEngineOptions + emitter: EngineEmitter initOptions: UtxoInitOptions io: EdgeIo pluginState: PluginState } -export interface EngineOptions extends EdgeCurrencyEngineOptions { - emitter: EngineEmitter -} - export type LocalWalletMetadata = ReturnType export const asLocalWalletMetadata = asObject({ balance: asString, diff --git a/src/common/utxobased/engine/UtxoEngine.ts b/src/common/utxobased/engine/UtxoEngine.ts index 9042a2f9..7343b4e5 100644 --- a/src/common/utxobased/engine/UtxoEngine.ts +++ b/src/common/utxobased/engine/UtxoEngine.ts @@ -73,19 +73,14 @@ export async function makeUtxoEngine( const { pluginInfo, pluginDisklet, - // Rename to make it explicit that this is sensitive memory - options, + emitter, + engineOptions, io, pluginState } = config - const { - walletLocalDisklet, - walletLocalEncryptedDisklet, - emitter, - log - } = options + const { walletLocalDisklet, walletLocalEncryptedDisklet, log } = engineOptions const { currencyInfo, engineInfo, coinInfo } = pluginInfo - const userSettings = asUtxoUserSettings(options.userSettings) + const userSettings = asUtxoUserSettings(engineOptions.userSettings) // We should move the active server list to the engine state, // since multiple accounts can be logged in at once, @@ -120,7 +115,7 @@ export async function makeUtxoEngine( disklet: pluginDisklet, pluginInfo, io, - log: config.options.log + log: config.engineOptions.log }) const metadata = await makeMetadata({ @@ -983,11 +978,11 @@ export async function makeUtxoEngine( const tmpEngineProcessor = makeUtxoEngineProcessor({ ...config, - options: { - ...config.options, + emitter: tmpEmitter, + engineOptions: { + ...config.engineOptions, walletLocalDisklet: tmpDisklet, - walletLocalEncryptedDisklet: tmpEncryptedDisklet, - emitter: tmpEmitter + walletLocalEncryptedDisklet: tmpEncryptedDisklet }, pluginInfo: { ...pluginInfo, diff --git a/src/common/utxobased/engine/UtxoEngineProcessor.ts b/src/common/utxobased/engine/UtxoEngineProcessor.ts index 6f2608ba..82f51dad 100644 --- a/src/common/utxobased/engine/UtxoEngineProcessor.ts +++ b/src/common/utxobased/engine/UtxoEngineProcessor.ts @@ -91,14 +91,15 @@ export function makeUtxoEngineProcessor( const { initOptions, io, - options, + emitter, + engineOptions, pluginState, pluginInfo, dataLayer, walletInfo, walletTools } = config - const { emitter, log } = options + const { log } = engineOptions const { walletFormats } = walletInfo.keys