Skip to content

Commit

Permalink
Merge pull request #236 from VenusProtocol/update-tests
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
coreyar authored Jan 8, 2025
2 parents 4bcd9dd + b4a3f7d commit 5ebe340
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion subgraphs/venus/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const main = () => {
network: 'chapel',
comptrollerAddress: bscTestnetCoreDeployments.addresses.Unitroller,
startBlock: '2802485',
vwbETHAddress: bscTestnetCoreDeployments.addresses.vWBETH,
wbETHAddress: '0xf9f98365566f4d55234f24b99caa1afbe6428d44',
vTRXAddress: '0x369fea97f6fb7510755dca389088d9e2e2819278',
vTUSDOldAddress: '0x3a00d9b02781f47d033bad62edc55fbf8d083fb0',
},
Expand Down
6 changes: 3 additions & 3 deletions subgraphs/venus/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Address } from '@graphprotocol/graph-ts';

import {
comptrollerAddress as comptrollerAddressString,
vwbETHAddress as vwbETHAddressString,
wbETHAddress as wbETHAddressString,
vTRXAddress as vTRXAddressString,
vTUSDOldAddress as vTUSDOldAddressString,
} from './config';
Expand All @@ -14,8 +14,8 @@ export const nullAddress = Address.fromString(nullAddressString);

export const nativeAddress = Address.fromString('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE');

export const vwbETHAddress = Address.fromString(
vwbETHAddressString.length > 0 ? vwbETHAddressString : nullAddressString,
export const wbETHAddress = Address.fromString(
wbETHAddressString.length > 0 ? wbETHAddressString : nullAddressString,
);

export const vTRXAddressAddress = Address.fromString(
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/venus/src/constants/config-template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export const comptrollerAddress = '{{ comptrollerAddress }}';

export const vwbETHAddress = '{{ vwbETHAddress }}';
export const wbETHAddress = '{{ wbETHAddress }}';

export const vTRXAddress = '{{ vTRXAddress }}';

Expand Down
4 changes: 2 additions & 2 deletions subgraphs/venus/src/operations/getOrCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { VToken } from '../../generated/templates/VToken/VToken';
import { zeroBigInt32 } from '../constants';
import {
nativeAddress,
vwbETHAddress,
wbETHAddress,
vTRXAddressAddress,
vTUSDOldAddress,
} from '../constants/addresses';
Expand Down Expand Up @@ -186,7 +186,7 @@ export function getOrCreateToken(asset: Address): Token {
let tokenEntity = Token.load(getTokenId(asset));

if (!tokenEntity) {
if (asset.equals(vwbETHAddress)) {
if (asset.equals(wbETHAddress)) {
return getOrCreateWrappedEthToken();
} else {
const erc20 = BEP20.bind(asset);
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/venus/tests/scripts/checkMarketPositions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const checkMarketPositions = async (
assert.equal(
marketPosition.vTokenBalanceMantissa,
accountBalance.toString(),
`incorrect supply balance for account ${marketPosition.account.id} in market ${MarketPosition.market.symbol} ${MarketPosition.market.id}. Subgraph Value: ${
`incorrect supply balance for account ${marketPosition.account.id} in market ${marketPosition.market.symbol} ${marketPosition.market.id}. Subgraph Value: ${
marketPosition.vTokenBalanceMantissa
}, contractValue: ${accountBalance.toString()}`,
);
Expand All @@ -45,7 +45,7 @@ const checkMarketPositions = async (
updatedSubgraphValue,
borrowBalanceStored.toString(),
`
incorrect borrow balance on account ${marketPosition.account.id} on market ${MarketPosition.market.symbol} ${MarketPosition.market.id}, accountBorrowIndex: ${MarketPosition.borrowIndex}, marketBorrowIndex ${MarketPosition.market.borrowIndex} subgraphValue: ${MarketPosition.storedBorrowBalanceMantissa} contractValue: ${borrowBalanceStored}`,
incorrect borrow balance on account ${marketPosition.account.id} on market ${marketPosition.market.symbol} ${marketPosition.market.id}, accountBorrowIndex: ${marketPosition.borrowIndex}, marketBorrowIndex ${marketPosition.market.borrowIndex} subgraphValue: ${marketPosition.storedBorrowBalanceMantissa} contractValue: ${borrowBalanceStored}`,
);
} catch (e) {
console.log(e.message);
Expand Down

0 comments on commit 5ebe340

Please sign in to comment.