From b3877ec18b35adcb321cf8052b0526034f280e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pr=C3=A9vost?= <998369+prevostc@users.noreply.github.com> Date: Sat, 20 Apr 2024 14:51:52 +0200 Subject: [PATCH] Format --- src/entity/protocol.ts | 2 -- src/entity/transaction.ts | 5 +---- src/utils/time.ts | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/entity/protocol.ts b/src/entity/protocol.ts index edec90c..617c181 100644 --- a/src/entity/protocol.ts +++ b/src/entity/protocol.ts @@ -48,8 +48,6 @@ export function getBeefyCLProtocolSnapshot(timestamp: BigInt, period: BigInt): P snapshot.harvesterFeesCollectedUSD = ZERO_BD snapshot.strategistFeesCollectedNative = ZERO_BD snapshot.strategistFeesCollectedUSD = ZERO_BD - snapshot.zapFeesCollectedNative = ZERO_BD - snapshot.zapFeesCollectedUSD = ZERO_BD // copy non-reseting values from the previous snapshot to the new snapshot const previousInterval = getPreviousSnapshotIdSuffix(period, interval) diff --git a/src/entity/transaction.ts b/src/entity/transaction.ts index 0187f7a..39ca607 100644 --- a/src/entity/transaction.ts +++ b/src/entity/transaction.ts @@ -2,10 +2,7 @@ import { ethereum } from "@graphprotocol/graph-ts" import { Transaction } from "../../generated/schema" import { ADDRESS_ZERO } from "../utils/address" -export function getTransaction( - block: ethereum.Block, - transaction: ethereum.Transaction, -): Transaction { +export function getTransaction(block: ethereum.Block, transaction: ethereum.Transaction): Transaction { let transactionId = transaction.hash let tx = Transaction.load(transactionId) if (!tx) { diff --git a/src/utils/time.ts b/src/utils/time.ts index 59348b8..3157c18 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -12,6 +12,7 @@ export const PROTOCOL_SNAPSHOT_PERIODS = [DAY, MONTH, QUARTER, YEAR] export const VAULT_SNAPSHOT_PERIODS = [HOUR, DAY, MONTH] export const INVESTOR_SNAPSHOT_PERIODS = [HOUR, DAY, MONTH] + @inline export function getIntervalFromTimestamp(timestamp: BigInt, period: BigInt): BigInt { // if the period is not stable, use date math to calculate the interval