Skip to content

Commit

Permalink
fix: fix getAllocation bug in old signature
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
  • Loading branch information
tmigone authored and pcarranzav committed Sep 11, 2023
1 parent 61bcee2 commit 39db3df
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
61 changes: 61 additions & 0 deletions abis/IStakingStitched.json
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,67 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_allocationID",
"type": "address"
}
],
"name": "getAllocation",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "indexer",
"type": "address"
},
{
"internalType": "bytes32",
"name": "subgraphDeploymentID",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "createdAtEpoch",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "closedAtEpoch",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "collectedFees",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "effectiveAllocation",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "accRewardsPerAllocatedToken",
"type": "uint256"
}
],
"internalType": "struct IStakingData.Allocation",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ export function handleAllocationClosedCobbDouglas(event: AllocationClosed1): voi
// We must call the contract directly to see how many fees are getting closed in this
// allocation. The event does not emit this information
let staking = Staking.bind(event.address)
let contractAlloc = staking.getAllocation(event.params.allocationID)
let contractAlloc = staking.getAllocation1(event.params.allocationID)
pool.totalQueryFees = pool.totalQueryFees.plus(contractAlloc.collectedFees)
pool.save()

Expand Down

0 comments on commit 39db3df

Please # to comment.