Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an undefined store for the UTxOHistory.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |