Skip to content

Commit

Permalink
fix: dont cast bigint to hex
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Nov 22, 2023
1 parent 34206c9 commit dd5155d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions subgraphs/venus/src/mappings/comptroller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable prefer-const */
// to satisfy AS compiler
import { BigInt, log } from '@graphprotocol/graph-ts';
import { log } from '@graphprotocol/graph-ts';

import {
DistributedSupplierVenus,
Expand Down Expand Up @@ -130,12 +130,10 @@ export function handleNewPriceOracle(event: NewPriceOracle): void {
// Also handles DistributedBorrowerVenus with same signature
export function handleXvsDistributed(event: DistributedSupplierVenus): void {
let vTokenAddress = event.params.vToken.toHex();
let venusDelta = event.params.venusDelta.toHex();
const venusDelta = event.params.venusDelta;
let market = Market.load(vTokenAddress);
if (market == null) {
market = createMarket(vTokenAddress);
}
market.totalXvsDistributedMantissa = market.totalXvsDistributedMantissa.plus(
BigInt.fromString(venusDelta),
);
market.totalXvsDistributedMantissa = market.totalXvsDistributedMantissa.plus(venusDelta);
}

0 comments on commit dd5155d

Please sign in to comment.