Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 773ebbf

Browse files
committed
Replace getTotalCoin with utxoBalance.
1 parent 390d7a0 commit 773ebbf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

wallet-new/src/Cardano/Wallet/Kernel/DB/AcidState.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ import Formatting (bprint, build, (%))
5252
import qualified Formatting.Buildable
5353
import Test.QuickCheck (Arbitrary (..), oneof)
5454

55-
import Pos.Chain.Txp (Utxo, getTotalCoinsInUtxo)
56-
import Pos.Core (FlatSlotId, SlotCount, SlotId, flattenSlotIdExplicit)
55+
import Pos.Chain.Txp (Utxo)
56+
import Pos.Core (FlatSlotId, SlotCount, SlotId, flattenSlotIdExplicit,
57+
mkCoin)
5758
import Pos.Core.Chrono (NewestFirst (..), OldestFirst (..))
5859
import Pos.Core.Txp (TxAux, TxId)
5960

@@ -74,6 +75,7 @@ import Cardano.Wallet.Kernel.NodeStateAdaptor (SecurityParameter (..))
7475
import Cardano.Wallet.Kernel.PrefilterTx (AddrWithId,
7576
PrefilteredBlock (..), emptyPrefilteredBlock)
7677
import Cardano.Wallet.Kernel.Util (markMissingMapEntries)
78+
import Cardano.Wallet.Kernel.Util.Core (utxoBalance)
7779

7880
{-------------------------------------------------------------------------------
7981
Top-level database
@@ -452,7 +454,7 @@ restoreHdWallet newRoot slotId utxoByAccount =
452454
tipCheckpoint :: Utxo -> PartialCheckpoint
453455
tipCheckpoint utxo = PartialCheckpoint
454456
{ _pcheckpointUtxo = InDb utxo
455-
, _pcheckpointUtxoBalance = InDb (getTotalCoinsInUtxo utxo)
457+
, _pcheckpointUtxoBalance = InDb . mkCoin . fromIntegral . utxoBalance $ utxo
456458
, _pcheckpointPending = Pending.empty
457459
, _pcheckpointBlockMeta = emptyLocalBlockMeta -- TODO (@mn): is this right?
458460
, _pcheckpointSlotId = InDb slotId

0 commit comments

Comments
 (0)