Skip to content

Commit

Permalink
test: add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Grimal committed Jan 3, 2025
1 parent 496ab87 commit 4c12996
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/liquidation-sdk-viem/examples/whitelistedMarkets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ export const check = async <
repaidAssets,
);

if (seizableCollateral.preLiquidation)
console.log("result", result);

if (result) {
dstAmount = result.dstAmount;
} else {
Expand Down Expand Up @@ -297,6 +300,9 @@ export const check = async <
maxUint256,
);

if (seizableCollateral.preLiquidation)
console.log("pre liquidation encoding");

seizableCollateral.preLiquidation
? encoder.preLiquidationPreLiquidate(
position.preLiquidation!.address,
Expand All @@ -314,6 +320,9 @@ export const check = async <
encoder.flush(),
);

if (seizableCollateral.preLiquidation)
console.log("pre liquidation encoded");

const populatedTx = await encoder.encodeExec();
const [gasLimit, blockNumber, txCount, { maxFeePerGas }] =
await Promise.all([
Expand Down Expand Up @@ -352,6 +361,9 @@ export const check = async <
maxFeePerGas,
};

if (seizableCollateral.preLiquidation)
console.log("transaction", transaction);

if (chainId === ChainId.EthMainnet) {
const signedBundle = await Flashbots.signBundle([
{
Expand Down

0 comments on commit 4c12996

Please sign in to comment.