Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module contains instances and types necessary for storing wallets in a SQL database with Persistent.
It's in a separate module due to the GHC stage restriction.
The ToJSON/FromJSON and Read instance orphans exist due to class constraints on Persistent functions.
Synopsis
- sqlSettings' :: MkPersistSettings
- fromText' :: FromText a => Text -> Either Text a
- aesonFromText :: FromText a => String -> Value -> Parser a
- fromPersistValueFromText :: FromText a => PersistValue -> Either Text a
- fromPersistValueRead :: Read a => PersistValue -> Either Text a
- directionToBool :: Direction -> Bool
- directionFromBool :: Bool -> Direction
- newtype TxId = TxId { }
-
newtype
BlockId
=
BlockId
{
- getBlockId :: Hash "BlockHeader"
- hashOfNoParent :: Hash "BlockHeader"
- fromMaybeHash :: Maybe ( Hash "BlockHeader") -> BlockId
- toMaybeHash :: BlockId -> Maybe ( Hash "BlockHeader")
- persistSlotNo :: SlotNo -> PersistValue
- unPersistSlotNo :: PersistValue -> Either Text SlotNo
- mkEpochNo :: Word32 -> Either Text EpochNo
- persistEpochNo :: EpochNo -> PersistValue
- stdGenFromString :: String -> Either Text StdGen
- stdGenToString :: StdGen -> String
- newtype HDPassphrase = HDPassphrase ( Passphrase "addr-derivation-payload")
-
newtype
EitherText
a =
EitherText
{
- getEitherText :: Either Text a
Documentation
sqlSettings' :: MkPersistSettings Source #
Settings for generating the Persistent types.
aesonFromText :: FromText a => String -> Value -> Parser a Source #
Aeson parser defined in terms of
fromText
fromPersistValueFromText :: FromText a => PersistValue -> Either Text a Source #
fromPersistValue
defined in terms of
fromText
fromPersistValueRead :: Read a => PersistValue -> Either Text a Source #
fromPersistValue
defined in terms of the
Read
class
directionToBool :: Direction -> Bool Source #
directionFromBool :: Bool -> Direction Source #
Wraps 'Hash Tx ' because the persistent entity syntax doesn't seem to support parameterized types.
Instances
BlockId | |
|
Instances
hashOfNoParent :: Hash "BlockHeader" Source #
Magic value that denotes the hash of the parent of the genesis block (which does not exist). This value is used for serializing the Nothing case of the #parentHeaderHash field.
persistSlotNo :: SlotNo -> PersistValue Source #
persistEpochNo :: EpochNo -> PersistValue Source #
stdGenFromString :: String -> Either Text StdGen Source #
In
random < 1.2
there used to be an
instance Read StdGen
, but no
longer.
The format used to look like this:
5889121503043413025 17512980752375952679
stdGenToString :: StdGen -> String Source #
newtype HDPassphrase Source #
HDPassphrase ( Passphrase "addr-derivation-payload") |
Instances
newtype EitherText a Source #
Newtype to get a MonadFail instance for
Either Text
.
We need it to use
parseTimeM
.
Instances
Monad EitherText Source # | |
Defined in Cardano.Wallet.DB.Sqlite.Types (>>=) :: EitherText a -> (a -> EitherText b) -> EitherText b Source # (>>) :: EitherText a -> EitherText b -> EitherText b Source # return :: a -> EitherText a Source # |
|
Functor EitherText Source # | |
Defined in Cardano.Wallet.DB.Sqlite.Types fmap :: (a -> b) -> EitherText a -> EitherText b Source # (<$) :: a -> EitherText b -> EitherText a Source # |
|
MonadFail EitherText Source # | |
Defined in Cardano.Wallet.DB.Sqlite.Types fail :: String -> EitherText a Source # |
|
Applicative EitherText Source # | |
Defined in Cardano.Wallet.DB.Sqlite.Types pure :: a -> EitherText a Source # (<*>) :: EitherText (a -> b) -> EitherText a -> EitherText b Source # liftA2 :: (a -> b -> c) -> EitherText a -> EitherText b -> EitherText c Source # (*>) :: EitherText a -> EitherText b -> EitherText b Source # (<*) :: EitherText a -> EitherText b -> EitherText a Source # |