Skip to content

Commit

Permalink
handlePaymentDistributed function mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Taombawkry committed Aug 24, 2024
1 parent 23251cc commit 084c797
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/subgraph/summitshare-dev/src/event-escrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
PaymentDistributed as PaymentDistributedEvent
} from "../generated/templates/EventEscrow/EventEscrow"
import { Beneficiary, Escrow, PaymentDistributed } from "../generated/schema"
import { log } from '@graphprotocol/graph-ts'
import { Address, log } from '@graphprotocol/graph-ts'

export function handleEventEscrowDeployed(
event: EventEscrowDeployedEvent
Expand Down Expand Up @@ -35,18 +35,18 @@ export function handleEventEscrowDeployed(

export function handlePaymentDistributed(event: PaymentDistributedEvent): void {

// let beneficiary = event.params.beneficiary
// let amount = event.params.amount
//let indexedcaller = event.params.indexedcaller
// let paymentDistributed = new PaymentDistributed(event.address.toHexString().concat("-").concat(beneficiary.toHexString()))

// paymentDistributed.escrow = event.address.toHexString()
// paymentDistributed.beneficiary = beneficiary.toHexString()
// paymentDistributed.amount = amount
//paymentDistributed.indexedcaller = indexedcaller.toHexString()
// paymentDistributed.blockNumber = event.block.number
// paymentDistributed.blockTimestamp = event.block.timestamp
// paymentDistributed.transactionHash = event.transaction.hash
// paymentDistributed.save()
let beneficiary = event.params.beneficiary
let amount = event.params.amount
let indexedcaller: Address = event.params.indexedcaller
let paymentDistributed = new PaymentDistributed(event.address.toHexString().concat("-").concat(beneficiary.toHexString()))

paymentDistributed.escrow = event.address.toHexString()
paymentDistributed.beneficiary = beneficiary.toHexString()
paymentDistributed.amount = amount
paymentDistributed.indexedcaller = indexedcaller
paymentDistributed.blockNumber = event.block.number
paymentDistributed.blockTimestamp = event.block.timestamp
paymentDistributed.transactionHash = event.transaction.hash
paymentDistributed.save()

}

0 comments on commit 084c797

Please sign in to comment.