-
Notifications
You must be signed in to change notification settings - Fork 210
/
Layer.hs
42 lines (38 loc) · 1.21 KB
/
Layer.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- |
-- Copyright: © 2022 IOHK
-- License: Apache-2.0
--
-- An implementation of the DBPendingTxs which uses Persistent and SQLite.
module Cardano.Wallet.DB.Store.Submissions.New.Layer
( mkDbPendingTxs
)
where
import Prelude
import Cardano.Wallet.DB
( DBPendingTxs (..) )
import Cardano.Wallet.DB.Store.Submissions.New.Operations
( DeltaTxSubmissions )
import Cardano.Wallet.Primitive.Types
( WalletId )
import Control.Monad.Except
( ExceptT (ExceptT) )
import Data.DBVar
( DBVar )
import Data.DeltaMap
( DeltaMap )
import Database.Persist.Sql
( SqlPersistT )
-- TODO: This implementation is not completed / fully tested yet.
mkDbPendingTxs
:: DBVar (SqlPersistT IO) (DeltaMap WalletId DeltaTxSubmissions)
-> DBPendingTxs stm
mkDbPendingTxs dbvar = DBPendingTxs
{ putLocalTxSubmission_ = \wid txid tx sl ->
error "putLocalTxSubmissions not implemented"
, readLocalTxSubmissionPending_
= error "readLocalTxSubmissionPending_ not implemented"
, updatePendingTxForExpiry_ = \wid tip -> ExceptT $
error "updatePendingTxForExpiry_ not implemented"
, removePendingOrExpiredTx_ = \wid txId ->
error "removePendingOrExpiredTx_ not implemented"
}