Skip to content

Commit

Permalink
Updated logData id param
Browse files Browse the repository at this point in the history
  • Loading branch information
ioay committed Apr 16, 2024
1 parent 742d770 commit f8dd76c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions subgraph/src/acre-bitcoin-depositor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,20 @@ export function handleStakeRequestInitialized(
)

const stakeEntity = new Stake(event.transaction.hash.toHexString())

const stakerEntity = getOrCreateStaker(event.params.staker)
stakerEntity.save()

const logDataBtc = getOrCreateLog(
`${event.transaction.hash.toHexString()}btc`,
)
const logDataEth = getOrCreateLog(
`${event.transaction.hash.toHexString()}eth`,
)
const logDataBtc = getOrCreateLog(event.transaction.hash.toHexString())
const logDataEth = getOrCreateLog(event.transaction.hash.toHexString())

logDataBtc.activity = stakeEntity.id
logDataBtc.timestamp = event.block.timestamp
logDataBtc.chain = "Bitcoin"
logDataBtc.amount = event.params.initialAmount
logDataBtc.save()

logDataEth.activity = stakeEntity.id
logDataEth.timestamp = event.block.timestamp
logDataEth.chain = "Ethereum"
logDataEth.amount = event.params.initialAmount
logDataEth.save()

entity.depositKey = event.params.depositKey
entity.caller = event.params.caller
Expand All @@ -42,5 +34,8 @@ export function handleStakeRequestInitialized(
entity.blockTimestamp = event.block.timestamp
entity.transactionHash = event.transaction.hash

logDataEth.save()
logDataBtc.save()
stakerEntity.save()
entity.save()
}

0 comments on commit f8dd76c

Please sign in to comment.