diff --git a/apps/recovery-relay/components/WithdrawModal/CreateTransaction/index.tsx b/apps/recovery-relay/components/WithdrawModal/CreateTransaction/index.tsx index 84a79cbf..043d88fa 100644 --- a/apps/recovery-relay/components/WithdrawModal/CreateTransaction/index.tsx +++ b/apps/recovery-relay/components/WithdrawModal/CreateTransaction/index.tsx @@ -14,6 +14,7 @@ import { RelayCreateTxRequestParams, RelaySignTxResponseParams, getLogger, + sanatize, } from '@fireblocks/recovery-shared'; import { AssetConfig } from '@fireblocks/asset-config'; import { useWorkspace } from '../../../context/Workspace'; @@ -181,7 +182,7 @@ export const CreateTransaction = ({ asset, inboundRelayParams, setSignTxResponse accountId, values, asset, - derivation, + derivation: sanatize(derivation), prepare: prepareQuery.data, }); diff --git a/apps/recovery-utility/main/background.ts b/apps/recovery-utility/main/background.ts index 13b3e00b..3a2e9ca8 100644 --- a/apps/recovery-utility/main/background.ts +++ b/apps/recovery-utility/main/background.ts @@ -34,6 +34,7 @@ let protocol = deployment.exp : DEFAULT_PROTOCOL; const relay = app.commandLine.hasSwitch('relay'); const util = app.commandLine.hasSwitch('util'); +resetLogs(); console.log(`Command line specified: relay: ${relay}, util: ${util}.`); if (relay && util) { console.error('Both relay and util flags were used, ignoring.'); diff --git a/apps/recovery-utility/main/ipc/getLogs.ts b/apps/recovery-utility/main/ipc/getLogs.ts index c10e6bd4..1613f017 100644 --- a/apps/recovery-utility/main/ipc/getLogs.ts +++ b/apps/recovery-utility/main/ipc/getLogs.ts @@ -81,6 +81,8 @@ ipcMain.handle('logs/get', async () => ), ); +ipcMain.handle('logs/reset', async () => resetLogs()); + export const resetLogs = () => { const logFiles = [ getLogPath('utility'), diff --git a/apps/recovery-utility/renderer/lib/ipc/getLogs.ts b/apps/recovery-utility/renderer/lib/ipc/getLogs.ts index 75783e79..3556e1af 100644 --- a/apps/recovery-utility/renderer/lib/ipc/getLogs.ts +++ b/apps/recovery-utility/renderer/lib/ipc/getLogs.ts @@ -1,3 +1,5 @@ import { ipcRenderer } from 'electron'; export const getLogs = () => ipcRenderer.invoke('logs/get') as Promise; + +export const resetLogs = () => ipcRenderer.invoke('logs/reset') as Promise; diff --git a/apps/recovery-utility/renderer/pages/index.tsx b/apps/recovery-utility/renderer/pages/index.tsx index 77cbf1be..9eeb7298 100644 --- a/apps/recovery-utility/renderer/pages/index.tsx +++ b/apps/recovery-utility/renderer/pages/index.tsx @@ -6,6 +6,7 @@ import { useWorkspace } from '../context/Workspace'; import { getDeployment, useDeployment } from '../lib/ipc'; import { LOGGER_NAME_UTILITY } from '@fireblocks/recovery-shared/constants'; import { resetDeployment } from '../lib/ipc/useDeployment'; +import { resetLogs } from '../lib/ipc/getLogs'; const buttonStyles: SxProps = { padding: '0.2rem', @@ -63,6 +64,7 @@ const Index = () => { const [protocol, setProtocol] = useWrappedState<'UTILITY' | 'RELAY' | null>('util-protocol', null); const onClickDeployment = async (_protocol: 'UTILITY' | 'RELAY') => { + resetLogs(); logger.debug(`Setting deployment ${_protocol}`); useDeployment(_protocol); };