Copyright | © 2022 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Store
implementations that can store various wallet types
in an SQLite database using
persistent
.
FIXME LATER during ADP-1043:
- Inline the contents of Cardano.Wallet.DB.Sqlite.CheckpointsOld into this module
-
Use
Table
andEmbedding
to construct the relevantStore
rather than implementingloadS
,writeS
,updateS
in a monadic fashion. Hide the new implementation behind a feature flag, i.e. Cardano.Wallet.DB.Sqlite.StoresNew .
Synopsis
- mkStoreWallets :: forall s key. ( PersistAddressBook s, key ~ WalletId ) => Store ( SqlPersistT IO ) ( DeltaMap key ( DeltaWalletState s))
-
class
AddressBookIso
s =>
PersistAddressBook
s
where
- insertPrologue :: WalletId -> Prologue s -> SqlPersistT IO ()
- insertDiscoveries :: WalletId -> SlotNo -> Discoveries s -> SqlPersistT IO ()
- loadPrologue :: WalletId -> SqlPersistT IO ( Maybe ( Prologue s))
- loadDiscoveries :: WalletId -> SlotNo -> SqlPersistT IO ( Discoveries s)
- blockHeaderFromEntity :: Checkpoint -> BlockHeader
- mkStoreWallet :: forall s. PersistAddressBook s => WalletId -> Store ( SqlPersistT IO ) ( DeltaWalletState s)
Documentation
mkStoreWallets :: forall s key. ( PersistAddressBook s, key ~ WalletId ) => Store ( SqlPersistT IO ) ( DeltaMap key ( DeltaWalletState s)) Source #
Store for
WalletState
of multiple different wallets.
class AddressBookIso s => PersistAddressBook s where Source #
Functions for saving loading the wallet's address book to from SQLite
insertPrologue :: WalletId -> Prologue s -> SqlPersistT IO () Source #
insertDiscoveries :: WalletId -> SlotNo -> Discoveries s -> SqlPersistT IO () Source #
loadPrologue :: WalletId -> SqlPersistT IO ( Maybe ( Prologue s)) Source #
loadDiscoveries :: WalletId -> SlotNo -> SqlPersistT IO ( Discoveries s) Source #
Instances
Testing
mkStoreWallet :: forall s. PersistAddressBook s => WalletId -> Store ( SqlPersistT IO ) ( DeltaWalletState s) Source #
Store for
WalletState
of a single wallet.