Skip to content

Commit

Permalink
fix(SubgraphService): use correct payment type for collect indexing r…
Browse files Browse the repository at this point in the history
…ewards
  • Loading branch information
Maikol committed Sep 17, 2024
1 parent 81a9fa2 commit fa4ead6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ abstract contract AllocationManager is EIP712Upgradeable, GraphDirectory, Alloca
uint256 delegatorCut = _graphStaking().getDelegationFeeCut(
allocation.indexer,
address(this),
IGraphPayments.PaymentTypes.IndexingFee
IGraphPayments.PaymentTypes.IndexingRewards
);
IHorizonStakingTypes.DelegationPool memory delegationPool = _graphStaking().getDelegationPool(
allocation.indexer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ contract SubgraphServiceTest is SubgraphServiceSharedTest {
uint256 delegatorCut = staking.getDelegationFeeCut(
allocation.indexer,
address(subgraphService),
// TODO: this should be fixed in AllocationManager, it should be IndexingRewards instead
IGraphPayments.PaymentTypes.IndexingFee
IGraphPayments.PaymentTypes.IndexingRewards
);
IHorizonStakingTypes.DelegationPool memory delegationPool = staking.getDelegationPool(allocation.indexer, address(subgraphService));
indexingRewardsData.tokensDelegationRewards = delegationPool.shares > 0 ? paymentCollected.mulPPM(delegatorCut) : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ contract SubgraphServiceCollectIndexingTest is SubgraphServiceTest {
_setDelegationFeeCut(
users.indexer,
address(subgraphService),
// TODO: this should be fixed in AllocationManager, it should be IndexingRewards instead
IGraphPayments.PaymentTypes.IndexingFee,
IGraphPayments.PaymentTypes.IndexingRewards,
delegationFeeCut
);
IGraphPayments.PaymentTypes paymentType = IGraphPayments.PaymentTypes.IndexingRewards;
Expand All @@ -51,8 +50,7 @@ contract SubgraphServiceCollectIndexingTest is SubgraphServiceTest {
_setDelegationFeeCut(
users.indexer,
address(subgraphService),
// TODO: this should be fixed in AllocationManager, it should be IndexingRewards instead
IGraphPayments.PaymentTypes.IndexingFee,
IGraphPayments.PaymentTypes.IndexingRewards,
delegationFeeCut
);
// Undelegate
Expand Down Expand Up @@ -97,8 +95,7 @@ contract SubgraphServiceCollectIndexingTest is SubgraphServiceTest {
_setDelegationFeeCut(
users.indexer,
address(subgraphService),
// TODO: this should be fixed in AllocationManager, it should be IndexingRewards instead
IGraphPayments.PaymentTypes.IndexingFee,
IGraphPayments.PaymentTypes.IndexingRewards,
delegationFeeCut
);

Expand Down

0 comments on commit fa4ead6

Please sign in to comment.