Skip to content

Commit

Permalink
Add an undefined store for the UTxOHistory.
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Mar 16, 2023
1 parent 544c409 commit a0c65af
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/wallet/cardano-wallet.cabal
Expand Up @@ -238,6 +238,7 @@ library
Cardano.Wallet.DB.Store.Checkpoints
Cardano.Wallet.DB.Store.DeltaUTxO.Model
Cardano.Wallet.DB.Store.DeltaUTxO.Model.Internal
Cardano.Wallet.DB.Store.DeltaUTxO.Store
Cardano.Wallet.DB.Store.Meta.Model
Cardano.Wallet.DB.Store.Meta.Store
Cardano.Wallet.DB.Store.QueryStore
Expand Down
34 changes: 34 additions & 0 deletions lib/wallet/src/Cardano/Wallet/DB/Store/DeltaUTxO/Store.hs
@@ -0,0 +1,34 @@
{-# LANGUAGE ScopedTypeVariables #-}

module Cardano.Wallet.DB.Store.DeltaUTxO.Store
( mkStoreUTxOHistory
) where

import Prelude

import Cardano.Wallet.DB.Store.DeltaUTxO.Model
( DeltaUTxOHistory (..), UTxOHistory (..) )
import Cardano.Wallet.Primitive.Types
( WalletId )
import Data.DBVar
( Store (..) )
import Database.Persist.Sql
( SqlPersistT )
import GHC.Exception
( SomeException )

-- | Create a 'Store' for 'UTxOHistory' using the given 'WalletId' as a key.
mkStoreUTxOHistory
:: WalletId
-> Store (SqlPersistT IO) DeltaUTxOHistory
mkStoreUTxOHistory wid = Store
{ loadS = load wid, writeS = write wid, updateS = update wid }

load :: WalletId -> SqlPersistT IO (Either SomeException UTxOHistory)
load _wid = undefined

write :: WalletId -> UTxOHistory -> SqlPersistT IO ()
write _wid = undefined

update :: WalletId -> Maybe UTxOHistory -> DeltaUTxOHistory -> SqlPersistT IO ()
update _wid = undefined

0 comments on commit a0c65af

Please sign in to comment.