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 7a58df6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions subgraph/src/acre-bitcoin-depositor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ export function handleStakeRequestInitialized(
const entity = new StakeRequestInitialized(
event.transaction.hash.toHexString(),
)

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

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

const logDataBtc = getOrCreateLog(
`${event.transaction.hash.toHexString()}btc`,
Expand All @@ -26,13 +23,11 @@ export function handleStakeRequestInitialized(
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 +37,8 @@ export function handleStakeRequestInitialized(
entity.blockTimestamp = event.block.timestamp
entity.transactionHash = event.transaction.hash

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

0 comments on commit 7a58df6

Please sign in to comment.