Skip to content

Commit

Permalink
fix divide by zero subgraph indexing error (#1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparkallas authored Jan 31, 2024
1 parent 40e7b55 commit 52a0a84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-18-bookworm",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// If having issues with Nix then consult:
Expand All @@ -21,19 +21,21 @@
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers-contrib/features/act:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// 1. using nix to create a reproduciable build
// 2. install foundry for people don't want to use nix
// 3. if you want to use nix further, do "nix develop"
"postCreateCommand": "./tasks/fix-devcontainer.sh && nix develop . -c bash <(echo \"yarn install && yarn build\") && curl -L https://foundry.paradigm.xyz | bash & foundryup"

"postCreateCommand": [
"curl -L https://foundry.paradigm.xyz | bash",
"source /home/node/.bashrc && foundryup",
"yarn global add npm-run-all",
"yarn install && yarn build",
"./tasks/fix-devcontainer.sh && nix develop . -c bash <(echo \"yarn install && yarn build\")"
]
// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
4 changes: 2 additions & 2 deletions packages/subgraph/src/mappingHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1487,9 +1487,9 @@ export function updateAggregateEntitiesTransferData(
*/
export function updatePoolMemberTotalAmountUntilUpdatedAtFields(pool: Pool, poolMember: PoolMember): PoolMember {
let amountReceivedDelta = BIG_INT_ZERO;
// if the pool has any units, we calculate the delta
// if the pool member has any units, we calculate the delta
// otherwise the delta is going to be 0
if (!pool.totalUnits.equals(BIG_INT_ZERO)) {
if (!poolMember.units.equals(BIG_INT_ZERO)) {
const distributedAmountDelta = pool.totalAmountDistributedUntilUpdatedAt
.minus(poolMember.poolTotalAmountDistributedUntilUpdatedAt);

Expand Down

0 comments on commit 52a0a84

Please sign in to comment.