Skip to content

Commit d335617

Browse files
committed
fix rollback deletes
1 parent 1507f59 commit d335617

File tree

5 files changed

+119
-196
lines changed

5 files changed

+119
-196
lines changed

cardano-db-sync/src/Cardano/DbSync/Era/Universal/Adjust.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ prepareRewardsForDeletion trce nw cache epochNo rewards = do
9696
then pure ([], [], [], [])
9797
else pure $ unzip4 validParams
9898

99-
-- Add this helper function
100-
areParamsEmpty :: ([a], [b], [c], [d]) -> Bool
101-
areParamsEmpty (as, bs, cs, ds) = null as || null bs || null cs || null ds
99+
areParamsEmpty :: ([DB.StakeAddressId], [DB.RewardSource], [Word64], [DB.PoolHashId]) -> Bool
100+
areParamsEmpty (addrs, types, epochs, pools) =
101+
null addrs && null types && null epochs && null pools

cardano-db-sync/src/Cardano/DbSync/Era/Universal/Epoch.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ insertRewards syncEnv nw earnedEpoch spendableEpoch cache rewardsChunk = do
261261
DB.ManualDbConstraints {..} <- liftIO $ readTVarIO $ envDbConstraints syncEnv
262262
let chunckDbRewards = splittRecordsEvery maxBulkSize dbRewards
263263
-- minimising the bulk inserts into hundred thousand chunks to improve performance
264-
forM_ chunckDbRewards $ \rws -> DB.insertBulkRewards dbConstraintEpochStake rws
264+
forM_ chunckDbRewards $ \rws -> DB.insertBulkRewards dbConstraintRewards rws
265265
where
266266
mkRewards ::
267267
MonadIO m =>

0 commit comments

Comments
 (0)