diff --git a/lib/Internal/Budget.hs b/lib/Internal/Budget.hs index 1411c65..f19126b 100644 --- a/lib/Internal/Budget.hs +++ b/lib/Internal/Budget.hs @@ -38,9 +38,8 @@ readBudget (intAllos, _) <- combineError intAlloRes acntRes (,) let res1 = mapErrors (readIncome c intAllos budgetSpan) bgtIncomes let res2 = expandTransfers c budgetSpan bgtTransfers - txs <- combineError (concat <$> res1) res2 (++) - shadow <- addShadowTransfers bgtShadowTransfers txs - return $ txs ++ shadow + combineErrorM (concat <$> res1) res2 $ \is ts -> + addShadowTransfers bgtShadowTransfers (is ++ ts) where c = CommitR (CommitHash $ hash b) CTBudget acntRes = mapErrors isNotIncomeAcnt alloAcnts diff --git a/lib/Internal/Database.hs b/lib/Internal/Database.hs index 3927b76..419c13a 100644 --- a/lib/Internal/Database.hs +++ b/lib/Internal/Database.hs @@ -81,6 +81,7 @@ sync pool root c bs hs = do liftIO $ print $ length $ coRead history liftIO $ print $ length $ coUpdate history liftIO $ print $ (\(DeleteTxs e a b c' d) -> (length e, length a, length b, length c', length d)) $ coDelete history + liftIO $ print $ fmap (length . snd) $ coCreate budgets' -- liftIO $ print $ length $ M.elems $ tsAccountMap txState -- liftIO $ print $ length $ M.elems $ tsCurrencyMap txState -- liftIO $ print $ length $ M.elems $ tsTagMap txState