Skip to content

Commit

Permalink
fix: cover edge case in bulker scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
EviLord032 committed May 7, 2024
1 parent 412a70a commit 75e7982
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scenario/BulkerScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ scenario(
filter: async (ctx) => await isBulkerSupported(ctx) && await isRewardSupported(ctx) && !matchesDeployment(ctx, [{deployment: 'weth'}, { network: 'linea-goerli' }]),
supplyCaps: {
$asset0: 3000,
$asset1: 3000,
},
tokenBalances: {
albert: { $base: '== 1000000', $asset0: 3000 },
Expand All @@ -177,7 +178,10 @@ scenario(
const baseAssetAddress = await comet.baseToken();
const baseAsset = context.getAssetByAddress(baseAssetAddress);
const baseScale = (await comet.baseScale()).toBigInt();
const { asset: collateralAssetAddress, scale: scaleBN } = await comet.getAssetInfo(0);
// if asset 0 is native token we took asset 1
const { asset: asset0, scale: scale0 } = await comet.getAssetInfo(0);
const { asset: asset1, scale: scale1 } = await comet.getAssetInfo(1);
const { asset: collateralAssetAddress, scale: scaleBN } = asset0 === wrappedNativeToken ? { asset: asset1, scale: scale1 } : { asset: asset0, scale: scale0 };
const collateralAsset = context.getAssetByAddress(collateralAssetAddress);
const collateralScale = scaleBN.toBigInt();
const [rewardTokenAddress] = await rewards.rewardConfig(comet.address);
Expand Down

0 comments on commit 75e7982

Please sign in to comment.