Skip to content

Commit

Permalink
feat: use event specific parameters for payment source
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Jan 20, 2025
1 parent f67c09c commit 9e4958d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/mappings/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function createOrLoadPaymentSource(paymentAddress: Bytes): PaymentSource
let id = paymentAddress.toHexString()
let paymentSource = PaymentSource.load(id)
if (paymentSource == null) {
let paymentSource = new PaymentSource(id)
paymentSource = new PaymentSource(id)
paymentSource.graphNetwork = "1"
paymentSource.totalQueryFees = BigInt.fromI32(0)
paymentSource.totalIndexerQueryFeesCollected = BigInt.fromI32(0)
Expand All @@ -211,7 +211,7 @@ export function createOrLoadIndexerQueryFeePaymentAggregation(paymentAddress: By
let id = paymentAddress.toHexString().concat("-").concat(indexerAddress.toHexString())
let aggregation = IndexerQueryFeePaymentAggregation.load(id)
if (aggregation == null) {
let aggregation = new IndexerQueryFeePaymentAggregation(id)
aggregation = new IndexerQueryFeePaymentAggregation(id)
aggregation.indexer = indexerAddress.toHexString()
aggregation.paymentSource = paymentAddress.toHexString()
aggregation.queryFeesCollected = BigInt.fromI32(0)
Expand Down
4 changes: 2 additions & 2 deletions src/mappings/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export function handleAllocationCollected(event: AllocationCollected): void {
let subgraphDeploymentID = event.params.subgraphDeploymentID.toHexString()
let indexerID = event.params.indexer.toHexString()
let allocationID = event.params.allocationID.toHexString()
let paymentAddress = event.transaction.from
let paymentAddress = event.params.from

// update indexer
let indexer = Indexer.load(indexerID)!
Expand Down Expand Up @@ -705,7 +705,7 @@ export function handleRebateCollected(event: RebateCollected): void {
let subgraphDeploymentID = event.params.subgraphDeploymentID.toHexString()
let indexerID = event.params.indexer.toHexString()
let allocationID = event.params.allocationID.toHexString()
let paymentAddress = event.transaction.from
let paymentAddress = event.params.assetHolder

// update indexer
let indexer = Indexer.load(indexerID)!
Expand Down

0 comments on commit 9e4958d

Please sign in to comment.