Skip to content

Commit

Permalink
fix nullable issues
Browse files Browse the repository at this point in the history
  • Loading branch information
soilking committed Aug 15, 2024
1 parent a2a71fc commit 82c5e49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions projects/subgraph-beanstalk/manifests/ethereum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@ dataSources:
abis:
- name: Replanted
file: ../../subgraph-core/abis/Beanstalk/Beanstalk-Replanted.json
- name: SeedGauge
file: ../../subgraph-core/abis/Beanstalk/Beanstalk-BIP45.json
eventHandlers:
- event: Sunrise(indexed uint256)
handler: handleReplantSunrise
Expand Down Expand Up @@ -929,5 +931,5 @@ dataSources:
# features:
# - grafting
# graft:
# base: QmfJpxvEjd4BdhtGr42MVtjbgnz9PPUmJ35wf7XtCJXeaC
# block: 15279870
# base: QmRJCKP5nLjUNtR2ZZ9F62iBGiKLdkGPX7GzBZLgVfnz3c
# block: 15289930
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ export function setBdv(bdv: BigInt, whitelistTokenSetting: WhitelistTokenSetting
// (the current season snapshots were already created)
const prevHourly = WhitelistTokenHourlySnapshot.load(
whitelistTokenSetting.id.toHexString() + "-" + (whitelistTokenSetting.lastHourlySnapshotSeason - 1).toString()
)!;
);
const prevDaily = WhitelistTokenDailySnapshot.load(
whitelistTokenSetting.id.toHexString() + "-" + (whitelistTokenSetting.lastDailySnapshotDay!.toI32() - 1).toString()
)!;
);

if (prevHourly != null) {
if (prevHourly != null && prevHourly.bdv !== null) {
hourly.deltaBdv = hourly.bdv!.minus(prevHourly.bdv!);
} else {
hourly.deltaBdv = hourly.bdv;
}
if (prevDaily != null) {
if (prevDaily != null && prevDaily.bdv !== null) {
daily.deltaBdv = daily.bdv!.minus(prevDaily.bdv!);
} else {
daily.deltaBdv = daily.bdv;
Expand Down

0 comments on commit 82c5e49

Please sign in to comment.