Skip to content

Commit

Permalink
chore: PositionDataResponse clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
msacco8 committed Feb 6, 2024
1 parent 64099c8 commit 5c4db22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Forta-Bots-Challenge-4/liquidatable-positions/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export const provideHandleTransaction = (cometWithdrawSupplySignatures: string[]
? await positionFetcherUSDC.delegateCall(call, txEvent.from, txEvent.blockNumber)
: call.address === positionFetcherWETH.cometAddress
? await positionFetcherWETH.delegateCall(call, txEvent.from, txEvent.blockNumber)
: { newPosition: false, position: emptyPositionData };
: { newOrUpdatedPosition: false, position: emptyPositionData };

// generate findings for new or updated positions
if (positionResponse.newPosition) {
if (positionResponse.newOrUpdatedPosition) {
findings.push(createNewPositionFinding(baseAssetAddresses, positionResponse.position));
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type PositionData = {
};

export type PositionDataResponse = {
newPosition: boolean;
newOrUpdatedPosition: boolean;
position: PositionData;
};

Expand All @@ -48,7 +48,7 @@ export const emptyPositionData: PositionData = {
};

export const emptyPositionDataResponse: PositionDataResponse = {
newPosition: false,
newOrUpdatedPosition: false,
position: emptyPositionData,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class PositionFetcher {
token: asset,
};
this.addToCache(borrower, position);
return { newPosition: true, position };
return { newOrUpdatedPosition: true, position };
}
return { ...emptyPositionDataResponse };
}
Expand Down

0 comments on commit 5c4db22

Please sign in to comment.