Skip to content

Commit

Permalink
wip: sync
Browse files Browse the repository at this point in the history
  • Loading branch information
EviLord032 committed Apr 11, 2024
1 parent 00fafb3 commit 61fa54e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
13 changes: 7 additions & 6 deletions scenario/BulkerScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { expectBase, isRewardSupported, isBulkerSupported, getExpectedBaseBalanc
import { exp } from '../test/helpers';

// XXX properly handle cases where asset0 is WETH
scenario.skip(
scenario.only(
'Comet#bulker > (non-WETH base) all non-reward actions in one txn',
{
filter: async (ctx) => await isBulkerSupported(ctx) && !matchesDeployment(ctx, [{deployment: 'weth'}, {network: 'mumbai'}, { network: 'linea-goerli' }]),
filter: async (ctx) =>
await isBulkerSupported(ctx) && !matchesDeployment(ctx, [{deployment: 'weth'}, {network: 'mumbai'}, { network: 'linea-goerli' }, {deployment: 'weth-lrt', network: 'mainnet'}]),
supplyCaps: {
$asset0: 3000,
$asset1: 3000,
Expand All @@ -25,10 +26,10 @@ scenario.skip(
const baseAsset = context.getAssetByAddress(baseAssetAddress);
const baseScale = (await comet.baseScale()).toBigInt();
// console.log('we are here')
const numAssets = await comet.numAssets()
// console.log({numAssets})
const numAssets = await comet.numAssets();
console.log({numAssets});
// console.log({comet})
// console.log({comet: await comet.getAssetInfo(0)})
console.log({comet: await comet.getAssetInfo(0)});
const { asset: collateralAssetAddress, scale: scaleBN } = await comet.getAssetInfo(0);
const collateralAsset = context.getAssetByAddress(collateralAssetAddress);
const collateralScale = scaleBN.toBigInt();
Expand Down Expand Up @@ -164,7 +165,7 @@ scenario(
);

// XXX properly handle cases where asset0 is WETH
scenario(
scenario.only(
'Comet#bulker > (non-WETH base) all actions in one txn',
{
filter: async (ctx) => await isBulkerSupported(ctx) && await isRewardSupported(ctx) && !matchesDeployment(ctx, [{deployment: 'weth'}, { network: 'linea-goerli' }]),
Expand Down
9 changes: 1 addition & 8 deletions scenario/LiquidationBotScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ scenario(
mainnet: {
usdc: ' == 5000', // COMP
weth: ' == 10000', // CB_ETH
'weth-lrt': ' == 100' // EZ_ETH
'weth-lrt': ' == 1' // EZ_ETH
},
};

Expand Down Expand Up @@ -794,24 +794,19 @@ scenario(
weth9
]
) as OnChainLiquidator;
console.log('12');

const baseToken = await comet.baseToken();
const { asset: collateralAssetAddress } = await comet.getAssetInfo(0);
console.log('123');
const initialRecipientBalance = await betty.getErc20Balance(baseToken);
const [initialNumAbsorbs, initialNumAbsorbed] = await comet.liquidatorPoints(betty.address);
console.log('1234');

const borrowCapacity = await borrowCapacityForAsset(comet, albert, 0);
const borrowAmount = (borrowCapacity.mul(90n)).div(100n);
console.log('12345');

await albert.withdrawAsset({
asset: baseToken,
amount: borrowAmount
});
console.log('123456');

await world.increaseTime(
await timeUntilUnderwater({
Expand All @@ -820,10 +815,8 @@ scenario(
fudgeFactor: 60n * 10n // 10 minutes past when position is underwater
})
);
console.log('1234567');

await comet.connect(betty.signer).accrueAccount(albert.address); // force accrue
console.log('12345678');

expect(await comet.isLiquidatable(albert.address)).to.be.true;
expect(await comet.collateralBalanceOf(albert.address, collateralAssetAddress)).to.be.greaterThan(0);
Expand Down

0 comments on commit 61fa54e

Please sign in to comment.