Skip to content

Commit

Permalink
refactor: compare checksummed addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Oct 22, 2024
1 parent d289ec1 commit 2371477
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions subgraphs/isolated-pools/tests/integration/checkEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ethers } from 'hardhat';

import createSubgraphClient from '../../subgraph-client';

const { getAddress } = ethers.utils;

const subgraphClient = createSubgraphClient(
'http://graph-node:8000/subgraphs/name/venusprotocol/venus-isolated-pools',
);
Expand All @@ -28,18 +30,18 @@ export const checkMarket = async (marketAddress: string) => {

expect(market?.cashMantissa).to.equal(await vToken.getCash());
expect(market?.reservesMantissa).to.equal(await vToken.totalReserves());
expect(market?.pool.id).to.equal(await vToken.comptroller());
expect(getAddress(market?.pool.id)).to.equal(await vToken.comptroller());
expect(market?.isListed).to.equal(comptroller.markets(marketAddress).isListed);
expect(market?.collateralFactorMantissa).to.equal(
comptroller.markets(marketAddress).collateralFactorMantissa,
);
expect(market?.exchangeRateMantissa).to.equal(vToken?.exchangeRateStored);
expect(market?.interestRateModelAddress).to.equal(vToken?.interestRateModel.toLowerCase());
expect(getAddress(market?.interestRateModelAddress)).to.equal(vToken?.interestRateModel());
expect(market?.name).to.equal(vToken?.name());
expect(market?.reservesMantissa).to.equal(vToken?.totalReserves());
expect(market?.supplyRateMantissa).to.equal(vToken?.supplyRatePerBlock());
expect(market?.symbol).to.equal(await vToken.symbol());
expect(market?.underlyingAddress).to.equal(vToken?.underlyingAddress.toLowerCase());
expect(getAddress(market?.underlyingAddress)).to.equal(vToken?.underlyingAddress());
expect(market?.borrowCapMantissa).to.equal(vToken?.borrowCaps(marketAddress));
expect(market?.supplyCapMantissa).to.equal(vToken?.supplyCaps(marketAddress));
expect(market?.accrualBlockNumber).to.equal(vToken?.accrualBlockNumber());
Expand Down

0 comments on commit 2371477

Please sign in to comment.