Skip to content

Commit

Permalink
fix: fence TxParser
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Jan 7, 2024
1 parent f1fc0f6 commit 12b32e7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/services/liquidate/AbstractLiquidatorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 12b32e7

Please sign in to comment.