diff --git a/subgraph/src/acre-bitcoin-depositor.ts b/subgraph/src/acre-bitcoin-depositor.ts index 61be4d8f3..0f80abb4b 100644 --- a/subgraph/src/acre-bitcoin-depositor.ts +++ b/subgraph/src/acre-bitcoin-depositor.ts @@ -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 @@ -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() }