Skip to content

Commit 7697a93

Browse files
committed
fix: rewardsmanager events
Signed-off-by: Tomás Migone <[email protected]>
1 parent bff35ba commit 7697a93

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

packages/indexer-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"dependencies": {
2525
"@pinax/graph-networks-registry": "0.6.7",
2626
"@graphprotocol/common-ts": "3.0.1",
27-
"@graphprotocol/toolshed": "0.6.4",
27+
"@graphprotocol/toolshed": "0.6.5",
2828
"@semiotic-labs/tap-contracts-bindings": "2.0.0",
2929
"@thi.ng/heaps": "1.2.38",
3030
"@types/lodash.clonedeep": "^4.5.7",

packages/indexer-common/src/indexer-management/allocations.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ export class AllocationManager {
764764
const logger = this.logger.child({ action: actionID })
765765
const isLegacy =
766766
(receipt as TransactionReceipt).to === this.network.contracts.HorizonStaking.target
767+
const isHorizon = await this.network.isHorizon.value()
767768

768769
logger.info(`Confirming unallocate transaction`, {
769770
isLegacy,
@@ -803,7 +804,7 @@ export class AllocationManager {
803804

804805
const rewardsEventLogs = isLegacy
805806
? this.network.transactionManager.findEvent(
806-
'RewardsAssigned',
807+
isHorizon ? 'HorizonRewardsAssigned' : 'RewardsAssigned',
807808
this.network.contracts.RewardsManager.interface,
808809
'allocationID',
809810
allocationID,
@@ -1196,7 +1197,7 @@ export class AllocationManager {
11961197
}
11971198

11981199
const rewardsEventLogs = this.network.transactionManager.findEvent(
1199-
'RewardsAssigned',
1200+
isHorizon ? 'HorizonRewardsAssigned' : 'RewardsAssigned',
12001201
this.network.contracts.RewardsManager.interface,
12011202
'allocationID',
12021203
allocationID,

packages/indexer-common/src/indexer-management/resolvers/allocations.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ async function closeLegacyAllocation(
636636
): Promise<{ txHash: string; rewardsAssigned: bigint }> {
637637
const contracts = network.contracts
638638
const transactionManager = network.transactionManager
639+
const isHorizon = await network.isHorizon.value()
639640

640641
// Double-check whether the allocation is still active on chain, to
641642
// avoid unnecessary transactions.
@@ -688,7 +689,7 @@ async function closeLegacyAllocation(
688689
}
689690

690691
const rewardsEventLogs = transactionManager.findEvent(
691-
'RewardsAssigned',
692+
isHorizon ? 'HorizonRewardsAssigned' : 'RewardsAssigned',
692693
contracts.RewardsManager.interface,
693694
'allocationID',
694695
allocation.id,
@@ -853,6 +854,7 @@ async function reallocateLegacyAllocation(
853854
const transactionManager = network.transactionManager
854855
const address = network.specification.indexerOptions.address
855856
const currentEpoch = await contracts.EpochManager.currentEpoch()
857+
const isHorizon = await network.isHorizon.value()
856858

857859
// Double-check whether the allocation is still active on chain, to
858860
// avoid unnecessary transactions.
@@ -1023,7 +1025,7 @@ async function reallocateLegacyAllocation(
10231025
}
10241026

10251027
const rewardsEventLogs = transactionManager.findEvent(
1026-
'RewardsAssigned',
1028+
isHorizon ? 'HorizonRewardsAssigned' : 'RewardsAssigned',
10271029
contracts.RewardsManager.interface,
10281030
'allocationID',
10291031
allocation.id,

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,10 @@
568568
prom-client "14.2.0"
569569
sequelize "6.33.0"
570570

571-
"@graphprotocol/interfaces@^0.2.4":
572-
version "0.2.4"
573-
resolved "https://registry.yarnpkg.com/@graphprotocol/interfaces/-/interfaces-0.2.4.tgz#57e4d391db2f2add181667808d25c99f196e2897"
574-
integrity sha512-a4IiWnKHenL5pli8YXNz/l3idkdWQX1CBT2wqiesqUXt1HKGLMreWySEtrcQHOsCl0jdCMzIMdnAd7KlCZQsCQ==
571+
"@graphprotocol/interfaces@^0.2.5":
572+
version "0.2.5"
573+
resolved "https://registry.yarnpkg.com/@graphprotocol/interfaces/-/interfaces-0.2.5.tgz#b628b198f4f2c6118d6acbf29f70c2de3ba61211"
574+
integrity sha512-z2Worw4OzMs9aDup8MkkoNk/QmJFKhPIfQrYnbu0FKImyi72z1JVQXfaH8ypH3QO4/Lpc3PrK81cJFxqdWNExQ==
575575

576576
"@graphprotocol/[email protected]":
577577
version "0.7.1"
@@ -583,12 +583,12 @@
583583
split2 "^3.1.1"
584584
through2 "^3.0.1"
585585

586-
"@graphprotocol/[email protected].4":
587-
version "0.6.4"
588-
resolved "https://registry.yarnpkg.com/@graphprotocol/toolshed/-/toolshed-0.6.4.tgz#f9be510403b808864fe81a969c04020c5e92b240"
589-
integrity sha512-uFgR6LNxp+3IM4z0+Hb/968PzCGkpECwcdhb3l1jtsMV/PMmYfnsOJqphC84DbHUBG8WNT62D2WQEY9c8ZSucQ==
586+
"@graphprotocol/[email protected].5":
587+
version "0.6.5"
588+
resolved "https://registry.yarnpkg.com/@graphprotocol/toolshed/-/toolshed-0.6.5.tgz#42fd39d1a5b9a41002c81feaecfa574f9e2dbe46"
589+
integrity sha512-yVyFX2rVYzgUUUcuyLCctItNXEQFeNYi739/kZupf3I/FHevaFpIvB4ZFn/Kg9SAi7556Vv3JfAPO6jkJ/xypg==
590590
dependencies:
591-
"@graphprotocol/interfaces" "^0.2.4"
591+
"@graphprotocol/interfaces" "^0.2.5"
592592
"@nomicfoundation/hardhat-ethers" "3.0.8"
593593
debug "^4.4.0"
594594
ethers "6.13.7"

0 commit comments

Comments
 (0)