From 12b32e7ebb9e9c540427f415da492a290ce7313f Mon Sep 17 00:00:00 2001 From: doomsower <12031673+doomsower@users.noreply.github.com> Date: Sun, 7 Jan 2024 15:33:51 -0300 Subject: [PATCH] fix: fence TxParser --- .../liquidate/AbstractLiquidatorService.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/services/liquidate/AbstractLiquidatorService.ts b/src/services/liquidate/AbstractLiquidatorService.ts index de3d613..21c5b64 100644 --- a/src/services/liquidate/AbstractLiquidatorService.ts +++ b/src/services/liquidate/AbstractLiquidatorService.ts @@ -82,7 +82,12 @@ export default abstract class AbstractLiquidatorService { try { const pfResult = await this.findClosePath(ca); - const pathHuman = TxParser.parseMultiCall(pfResult.calls); + let pathHuman: string[] = []; + try { + pathHuman = TxParser.parseMultiCall(pfResult.calls); + } catch (e) { + pathHuman = [`${e}`]; + } this.log.debug(pathHuman); const executor = this.keyService.takeVacantExecutor(); @@ -134,7 +139,12 @@ export default abstract class AbstractLiquidatorService { optimisticResult.calls = pfResult.calls; optimisticResult.pathAmount = pfResult.underlyingBalance.toString(); - const pathHuman = TxParser.parseMultiCall(pfResult.calls); + let pathHuman: string[] = []; + try { + pathHuman = TxParser.parseMultiCall(pfResult.calls); + } catch (e) { + pathHuman = [`${e}`]; + } this.log.debug({ pathHuman }, "path found"); const balanceBefore = await this.getExecutorBalance(ca);