Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ProtVer = ProtVer { }
- type FixedPoint = Digits34
- (==>) :: Bool -> Bool -> Bool
- (⭒) :: Nonce -> Nonce -> Nonce
- data Network
- networkToWord8 :: Network -> Word8
- word8ToNetwork :: Word8 -> Maybe Network
-
data
Nonce
- = Nonce !( Hash Blake2b_256 Nonce )
- | NeutralNonce
- newtype Seed = Seed ( Hash Blake2b_256 Seed )
- data UnitInterval
- data PositiveUnitInterval
- data PositiveInterval
- data NonNegativeInterval
-
class
Bounded
r =>
BoundedRational
r
where
- boundRational :: Rational -> Maybe r
- unboundRational :: r -> Rational
- boundedRationalFromCBOR :: BoundedRational r => Decoder s r
- boundedRationalToCBOR :: BoundedRational r => r -> Encoding
- fpPrecision :: FixedPoint
- promoteRatio :: Integral a => Ratio a -> Rational
- invalidKey :: Word -> Decoder s a
- mkNonceFromOutputVRF :: OutputVRF v -> Nonce
- mkNonceFromNumber :: Word64 -> Nonce
- data Url
- urlToText :: Url -> Text
- textToUrl :: Text -> Maybe Url
- data DnsName
- dnsToText :: DnsName -> Text
- textToDns :: Text -> Maybe DnsName
- newtype Port = Port { }
- data ActiveSlotCoeff
- mkActiveSlotCoeff :: PositiveUnitInterval -> ActiveSlotCoeff
- activeSlotVal :: ActiveSlotCoeff -> PositiveUnitInterval
- activeSlotLog :: ActiveSlotCoeff -> FixedPoint
- module Data.Maybe.Strict
-
newtype
BlocksMade
crypto =
BlocksMade
{
- unBlocksMade :: Map ( KeyHash ' StakePool crypto) Natural
- newtype TxIx = TxIx Word64
- txIxToInt :: TxIx -> Int
- txIxFromIntegral :: Integral a => a -> Maybe TxIx
- mkTxIxPartial :: HasCallStack => Integer -> TxIx
- newtype CertIx = CertIx Word64
- certIxToInt :: CertIx -> Int
- certIxFromIntegral :: Integral a => a -> Maybe CertIx
- mkCertIxPartial :: HasCallStack => Integer -> CertIx
-
data
Globals
=
Globals
{
- epochInfo :: !( EpochInfo ( Either Text ))
- slotsPerKESPeriod :: ! Word64
- stabilityWindow :: ! Word64
- randomnessStabilisationWindow :: ! Word64
- securityParameter :: ! Word64
- maxKESEvo :: ! Word64
- quorum :: ! Word64
- maxMajorPV :: ! Natural
- maxLovelaceSupply :: ! Word64
- activeSlotCoeff :: ! ActiveSlotCoeff
- networkId :: ! Network
- systemStart :: ! SystemStart
- epochInfoPure :: Globals -> EpochInfo Identity
- type ShelleyBase = ReaderT Globals Identity
Documentation
Instances
Eq ProtVer Source # | |
Ord ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show ProtVer Source # | |
Generic ProtVer Source # | |
NFData ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToJSON ProtVer Source # | |
FromJSON ProtVer Source # | |
ToCBOR ProtVer Source # | |
FromCBOR ProtVer Source # | |
NoThunks ProtVer Source # | |
FromCBORGroup ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes fromCBORGroup :: Decoder s ProtVer Source # |
|
ToCBORGroup ProtVer Source # | |
type Rep ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes
type
Rep
ProtVer
=
D1
('
MetaData
"ProtVer" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-0.1.0.0-3EJt5rxsPizAWHDEqGPh9V" '
False
) (
C1
('
MetaCons
"ProtVer" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"pvMajor") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
Natural
)
:*:
S1
('
MetaSel
('
Just
"pvMinor") '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
Natural
)))
|
type FixedPoint = Digits34 Source #
Instances
Bounded Network Source # | |
Enum Network Source # | |
Defined in Cardano.Ledger.BaseTypes succ :: Network -> Network Source # pred :: Network -> Network Source # toEnum :: Int -> Network Source # fromEnum :: Network -> Int Source # enumFrom :: Network -> [ Network ] Source # enumFromThen :: Network -> Network -> [ Network ] Source # enumFromTo :: Network -> Network -> [ Network ] Source # enumFromThenTo :: Network -> Network -> Network -> [ Network ] Source # |
|
Eq Network Source # | |
Ord Network Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show Network Source # | |
Generic Network Source # | |
NFData Network Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToJSON Network Source # | |
FromJSON Network Source # | |
ToCBOR Network Source # | |
FromCBOR Network Source # | |
NoThunks Network Source # | |
type Rep Network Source # | |
Defined in Cardano.Ledger.BaseTypes |
networkToWord8 :: Network -> Word8 Source #
Evolving nonce type.
Nonce !( Hash Blake2b_256 Nonce ) | |
NeutralNonce |
Identity element |
Instances
Eq Nonce Source # | |
Ord Nonce Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show Nonce Source # | |
Generic Nonce Source # | |
NFData Nonce Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToJSON Nonce Source # | |
FromJSON Nonce Source # | |
ToCBOR Nonce Source # | |
FromCBOR Nonce Source # | |
NoThunks Nonce Source # | |
type Rep Nonce Source # | |
Defined in Cardano.Ledger.BaseTypes
type
Rep
Nonce
=
D1
('
MetaData
"Nonce" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-0.1.0.0-3EJt5rxsPizAWHDEqGPh9V" '
False
) (
C1
('
MetaCons
"Nonce" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
(
Hash
Blake2b_256
Nonce
)))
:+:
C1
('
MetaCons
"NeutralNonce" '
PrefixI
'
False
) (
U1
::
Type
->
Type
))
|
Seed to the verifiable random function.
We do not expose the constructor to
Seed
. Instead, a
Seed
should be
created using
mkSeed
for a VRF calculation.
Seed ( Hash Blake2b_256 Seed ) |
Instances
Eq Seed Source # | |
Ord Seed Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show Seed Source # | |
Generic Seed Source # | |
ToCBOR Seed Source # | |
SignableRepresentation Seed Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
NoThunks Seed Source # | |
type Rep Seed Source # | |
Defined in Cardano.Ledger.BaseTypes
type
Rep
Seed
=
D1
('
MetaData
"Seed" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-0.1.0.0-3EJt5rxsPizAWHDEqGPh9V" '
True
) (
C1
('
MetaCons
"Seed" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
(
Hash
Blake2b_256
Seed
))))
|
data UnitInterval Source #
Type to represent a value in the unit interval [0; 1]
Instances
data PositiveUnitInterval Source #
Type to represent a value in the unit interval (0; 1]
Instances
data PositiveInterval Source #
Type to represent a value in the interval (0; +∞)
Instances
data NonNegativeInterval Source #
Type to represent a value in the interval [0; +∞)
Instances
class Bounded r => BoundedRational r where Source #
Type clases that allows conversion between
Rational
and some form of bounded
rational type. Bounds can be restricted by both the
Bounded
type class and underlyng
representation.
maybe True (\br -> minBound <= br && br <= maxBound) . boundRational
Roundtrip properties must hold:
\r -> maybe True ((r ==) . unboundRational) (boundRational r) \br -> Just br == boundRational (unboundRational br)
boundRational :: Rational -> Maybe r Source #
Returns
Nothing
when supplied value is not within bounds or when precision is
too high to be represented by the underlying type
Example
>>>
:set -XTypeApplications
>>>
import Data.Ratio
>>>
boundRational @UnitInterval $ 2 % 3
Just (2 % 3)>>>
boundRational @UnitInterval (-0.5)
Nothing>>>
boundRational @UnitInterval (1.5)
Nothing>>>
boundRational @UnitInterval 0
Just (0 % 1)>>>
boundRational @PositiveUnitInterval 0
Nothing
unboundRational :: r -> Rational Source #
Promote bounded rational type into the unbounded
Rational
.
Instances
BoundedRational UnitInterval Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
BoundedRational PositiveUnitInterval Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
BoundedRational PositiveInterval Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
BoundedRational NonNegativeInterval Source # | |
Defined in Cardano.Ledger.BaseTypes |
boundedRationalFromCBOR :: BoundedRational r => Decoder s r Source #
Deserialize
BoundedRational
type using
Rational
deserialization and
fail when bounds are violated.
boundedRationalToCBOR :: BoundedRational r => r -> Encoding Source #
Serialize
BoundedRational
type in the same way
Rational
is serialized.
invalidKey :: Word -> Decoder s a Source #
mkNonceFromOutputVRF :: OutputVRF v -> Nonce Source #
Make a nonce from the VRF output bytes
mkNonceFromNumber :: Word64 -> Nonce Source #
Make a nonce from a number.
Instances
Instances
Eq DnsName Source # | |
Ord DnsName Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show DnsName Source # | |
Generic DnsName Source # | |
NFData DnsName Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToJSON DnsName Source # | |
FromJSON DnsName Source # | |
ToCBOR DnsName Source # | |
FromCBOR DnsName Source # | |
NoThunks DnsName Source # | |
type Rep DnsName Source # | |
Defined in Cardano.Ledger.BaseTypes |
Instances
Eq Port Source # | |
Num Port Source # | |
Ord Port Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show Port Source # | |
Generic Port Source # | |
NFData Port Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToJSON Port Source # | |
FromJSON Port Source # | |
ToCBOR Port Source # | |
FromCBOR Port Source # | |
NoThunks Port Source # | |
type Rep Port Source # | |
Defined in Cardano.Ledger.BaseTypes |
data ActiveSlotCoeff Source #
Instances
module Data.Maybe.Strict
newtype BlocksMade crypto Source #
Blocks made
BlocksMade | |
|
Instances
Indices
Transaction index.
Instances
Bounded TxIx Source # | |
Enum TxIx Source # | |
Eq TxIx Source # | |
Ord TxIx Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
Show TxIx Source # | |
NFData TxIx Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToCBOR TxIx Source # | |
FromCBOR TxIx Source # | |
NoThunks TxIx Source # | |
mkTxIxPartial :: HasCallStack => Integer -> TxIx Source #
Certificate index. Use
certIxFromIntegral
in order to construct this
index safely from anything other than
Word16
. There is also
mkCertIxPartial
that can be used for testing.
Instances
Bounded CertIx Source # | |
Enum CertIx Source # | |
Defined in Cardano.Ledger.BaseTypes succ :: CertIx -> CertIx Source # pred :: CertIx -> CertIx Source # toEnum :: Int -> CertIx Source # fromEnum :: CertIx -> Int Source # enumFrom :: CertIx -> [ CertIx ] Source # enumFromThen :: CertIx -> CertIx -> [ CertIx ] Source # enumFromTo :: CertIx -> CertIx -> [ CertIx ] Source # enumFromThenTo :: CertIx -> CertIx -> CertIx -> [ CertIx ] Source # |
|
Eq CertIx Source # | |
Ord CertIx Source # | |
Show CertIx Source # | |
NFData CertIx Source # | |
Defined in Cardano.Ledger.BaseTypes |
|
ToCBOR CertIx Source # | |
FromCBOR CertIx Source # | |
NoThunks CertIx Source # | |
certIxToInt :: CertIx -> Int Source #
mkCertIxPartial :: HasCallStack => Integer -> CertIx Source #
STS Base
Globals | |
|