Skip to content

Commit

Permalink
Change check to exact length
Browse files Browse the repository at this point in the history
  • Loading branch information
MogageNicolae committed Sep 18, 2024
1 parent 5fd932d commit da35134
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/services/src/events/hatom.liquidation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export class HatomLiquidationService {
) {}

public async hatomLiquidationWebhook(eventsLog: EventLog[]): Promise<void> {
const liquidationBorrowTopicsLength = 5;

for (const eventLog of eventsLog) {
if (eventLog.identifier === "liquidateBorrow" && eventLog.topics.length > 0 && eventLog.topics[0] === liquidationBorrowEvent) {
if (eventLog.identifier === "liquidateBorrow" && eventLog.topics.length === liquidationBorrowTopicsLength && eventLog.topics[0] === liquidationBorrowEvent) {
const properties: string[] = ["liquidator", "borrower", "amount", "collateral_mma", "tokens"];
const types: string[] = ["Address", "Address", "BigNumber", "Address", "BigNumber"];
const currentEvent: LiquidationEvent = decodeTopics(properties, eventLog.topics.slice(1), types) as LiquidationEvent;
Expand Down

0 comments on commit da35134

Please sign in to comment.