Skip to content

Commit

Permalink
chore: lowercase for token addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
climberNeedEquipment committed May 21, 2024
1 parent 287a5fd commit 36eaa5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions adapters/layerbank/src/sdk/marketDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface MarketInfo {
underlyingSymbol: string;
exchangeRateStored: bigint;
}

export const getMarketInfos = async (
coreAddress: `0x${string}`,
blockNumber?: bigint
Expand Down Expand Up @@ -43,9 +44,9 @@ export const getMarketInfos = async (
})) as any,
});

const underlyingAddresses = underlyingResults.map(
(v) => v.result as `0x${string}`
);
const underlyingAddresses = underlyingResults
.map((v) => v.result as `0x${string}`)
.map((m) => m.toLowerCase());

const underlyings = underlyingAddresses.map((m) => {
if (m === "0x0000000000000000000000000000000000000000") {
Expand Down
9 changes: 5 additions & 4 deletions adapters/layerbank/src/sdk/subgraphDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ export const getAccountStatesForAddressByPoolAtBlock = async (
// Filter and map the account states
const filteredAccountStates = data.data.accountStates
.filter(
(m: any) => m.account !== zeroAddress && m.account !== deadAddress
(m: any) =>
m.account !== zeroAddress && m.account.toLowerCase() !== deadAddress
)
.map((m: any) => ({
id: m.id,
account: m.account,
token: marketsToUnderlying[m.token],
id: m.id.toLowerCase(),
account: m.account.toLowerCase(),
token: marketsToUnderlying[m.token].toLowerCase(),
lentAmount: BigInt(m.supplied),
borrowAmount: BigInt(m.borrowed),
}));
Expand Down

0 comments on commit 36eaa5d

Please sign in to comment.