From f8dd76c3f791097e3d31a197b41e301e74bcfaff Mon Sep 17 00:00:00 2001 From: ioay Date: Tue, 16 Apr 2024 23:52:50 +0200 Subject: [PATCH] Updated logData id param --- subgraph/src/acre-bitcoin-depositor.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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() }