This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
wallet-new/src/Cardano/Wallet Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ module Cardano.Wallet.Kernel.DB.HdWallet (
5555 , hdAccountName
5656 , hdAccountState
5757 , hdAccountStateCurrent
58+ , hdAccountStateCurrentCombined
5859 , hdAccountStateUpToDate
5960 , hdAccountRestorationState
6061 -- *** Account state: up to date
@@ -475,6 +476,16 @@ hdAccountStateCurrent g = to $ \case
475476 HdAccountStateIncomplete st ->
476477 st ^. hdIncompleteCurrent . unCheckpoints . _Wrapped . SNE. head . g
477478
479+ hdAccountStateCurrentCombined :: (a -> a -> a )
480+ -> (forall c . IsCheckpoint c => Getter c a )
481+ -> Getter HdAccountState a
482+ hdAccountStateCurrentCombined combine g = to $ \ case
483+ HdAccountStateUpToDate st ->
484+ st ^. hdUpToDateCheckpoints . unCheckpoints . _Wrapped . SNE. head . g
485+ HdAccountStateIncomplete st ->
486+ combine (st ^. hdIncompleteCurrent . unCheckpoints . _Wrapped . SNE. head . g)
487+ (st ^. hdIncompleteHistorical . unCheckpoints . _Wrapped . SNE. head . g)
488+
478489{- ------------------------------------------------------------------------------
479490 Predicates and tests
480491-------------------------------------------------------------------------------}
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ toAddress acc hdAddress =
200200 (V1 addressOwnership)
201201 where
202202 cardanoAddress = hdAddress ^. HD. hdAddressAddress . fromDb
203- addressMeta = acc ^. HD. hdAccountState . HD. hdAccountStateCurrent (cpAddressMeta cardanoAddress)
203+ addressMeta = acc ^. HD. hdAccountState . HD. hdAccountStateCurrentCombined (<>) (cpAddressMeta cardanoAddress)
204204 -- NOTE
205205 -- In this particular case, the address had to be known by us. As a matter
206206 -- of fact, to construct a 'WalletAddress', we have to be aware of pieces
You can’t perform that action at this time.
0 commit comments