Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- addEpochInterval ∷ EpochNo → EpochInterval → EpochNo
- binOpEpochNo ∷ (Word64 → Word64 → Word64) → EpochNo → EpochNo → EpochNo
- newtype SlotNo = SlotNo {}
- data WithOrigin t
- newtype EpochNo = EpochNo {}
- newtype EpochSize = EpochSize {}
- newtype EpochInterval = EpochInterval {}
- newtype BlockNo = BlockNo {}
- data ProtVer = ProtVer {}
- module Cardano.Ledger.Binary.Version
- 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
- fpPrecision ∷ FixedPoint
- integralToBounded ∷ ∀ i b m. (Integral i, Integral b, Bounded b, MonadFail m) ⇒ i → m b
- promoteRatio ∷ Integral a ⇒ Ratio a → Rational
- invalidKey ∷ MonadFail m ⇒ Word → m a
- mkNonceFromOutputVRF ∷ OutputVRF v → Nonce
- mkNonceFromNumber ∷ Word64 → Nonce
- data Url
- urlToText ∷ Url → Text
- textToUrl ∷ MonadFail m ⇒ Int → Text → m Url
- data DnsName
- dnsToText ∷ DnsName → Text
- textToDns ∷ MonadFail m ⇒ Int → Text → m DnsName
- newtype Port = Port {}
- data ActiveSlotCoeff
- mkActiveSlotCoeff ∷ PositiveUnitInterval → ActiveSlotCoeff
- activeSlotVal ∷ ActiveSlotCoeff → PositiveUnitInterval
- activeSlotLog ∷ ActiveSlotCoeff → FixedPoint
- module Data.Maybe.Strict
- newtype BlocksMade = BlocksMade {}
- kindObject ∷ Text → [Pair] → Value
- newtype TxIx = TxIx {}
- txIxToInt ∷ TxIx → Int
- txIxFromIntegral ∷ ∀ a m. (Integral a, MonadFail m) ⇒ a → m TxIx
- mkTxIx ∷ Word16 → TxIx
- mkTxIxPartial ∷ HasCallStack ⇒ Integer → TxIx
- newtype CertIx = CertIx {}
- certIxToInt ∷ CertIx → Int
- certIxFromIntegral ∷ ∀ a m. (Integral a, MonadFail m) ⇒ a → m CertIx
- mkCertIx ∷ Word16 → CertIx
- mkCertIxPartial ∷ HasCallStack ⇒ Integer → CertIx
- data Anchor = Anchor {
- anchorUrl ∷ !Url
- anchorDataHash ∷ !(SafeHash AnchorData)
- newtype AnchorData = AnchorData ByteString
- hashAnchorData ∷ AnchorData → SafeHash AnchorData
- data Globals = Globals {}
- epochInfoPure ∷ Globals → EpochInfo Identity
- type ShelleyBase = ReaderT Globals Identity
- data Relation
- data Mismatch (r ∷ Relation) a = Mismatch {
- mismatchSupplied ∷ !a
- mismatchExpected ∷ !a
- swapMismatch ∷ Mismatch r a → (a, a)
- unswapMismatch ∷ (a, a) → Mismatch r a
- class Inject t s where
- inject ∷ t → s
Documentation
addEpochInterval ∷ EpochNo → EpochInterval → EpochNo Source #
Add a EpochInterval (a positive change) to an EpochNo to get a new EpochNo
binOpEpochNo ∷ (Word64 → Word64 → Word64) → EpochNo → EpochNo → EpochNo Source #
Convenience function for doing binary operations on two EpochNo
s
The 0-based index for the Ourboros time slot.
Instances
FromJSON SlotNo | |
ToJSON SlotNo | |
Bounded SlotNo | |
Enum SlotNo | |
Generic SlotNo | |
Num SlotNo | |
Show SlotNo | |
FromCBOR SlotNo | |
ToCBOR SlotNo | |
DecCBOR SlotNo | |
EncCBOR SlotNo | |
NFData SlotNo | |
Defined in Cardano.Slotting.Slot | |
Eq SlotNo | |
Ord SlotNo | |
NoThunks SlotNo | |
Serialise SlotNo | |
type Rep SlotNo | |
Defined in Cardano.Slotting.Slot type Rep SlotNo = D1 ('MetaData "SlotNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "SlotNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlotNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
data WithOrigin t Source #
Instances
An epoch, i.e. the number of the epoch.
Instances
FromJSON EpochNo | |
ToJSON EpochNo | |
Enum EpochNo | |
Defined in Cardano.Slotting.Slot | |
Generic EpochNo | |
Show EpochNo | |
FromCBOR EpochNo | |
ToCBOR EpochNo | |
DecCBOR EpochNo | |
EncCBOR EpochNo | |
NFData EpochNo | |
Defined in Cardano.Slotting.Slot | |
Eq EpochNo | |
Ord EpochNo | |
NoThunks EpochNo | |
Serialise EpochNo | |
type Rep EpochNo | |
Defined in Cardano.Slotting.Slot type Rep EpochNo = D1 ('MetaData "EpochNo" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "EpochNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
Instances
FromJSON EpochSize | |
ToJSON EpochSize | |
Enum EpochSize | |
Generic EpochSize | |
Show EpochSize | |
FromCBOR EpochSize | |
ToCBOR EpochSize | |
DecCBOR EpochSize | |
EncCBOR EpochSize | |
NFData EpochSize | |
Defined in Cardano.Slotting.Slot | |
Eq EpochSize | |
Ord EpochSize | |
Defined in Cardano.Slotting.Slot | |
NoThunks EpochSize | |
type Rep EpochSize | |
Defined in Cardano.Slotting.Slot type Rep EpochSize = D1 ('MetaData "EpochSize" "Cardano.Slotting.Slot" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "EpochSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unEpochSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
newtype EpochInterval Source #
Instances
The 0-based index of the block in the blockchain. BlockNo is <= SlotNo and is only equal at slot N if there is a block for every slot where N <= SlotNo.
Instances
FromJSON BlockNo | |
ToJSON BlockNo | |
Bounded BlockNo | |
Enum BlockNo | |
Defined in Cardano.Slotting.Block | |
Generic BlockNo | |
Num BlockNo | |
Show BlockNo | |
FromCBOR BlockNo | |
ToCBOR BlockNo | |
DecCBOR BlockNo | |
EncCBOR BlockNo | |
NFData BlockNo | |
Defined in Cardano.Slotting.Block | |
Eq BlockNo | |
Ord BlockNo | |
NoThunks BlockNo | |
Serialise BlockNo | |
type Rep BlockNo | |
Defined in Cardano.Slotting.Block type Rep BlockNo = D1 ('MetaData "BlockNo" "Cardano.Slotting.Block" "cardano-slotting-0.2.0.0-4dc0085b2dcaf395960acff0c4fce29dfb45e68c3d685013ce6bc77613efa68b" 'True) (C1 ('MetaCons "BlockNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) |
Instances
FromJSON ProtVer Source # | |
ToJSON ProtVer Source # | |
Generic ProtVer Source # | |
Show ProtVer Source # | |
FromCBOR ProtVer Source # | |
ToCBOR ProtVer Source # | |
DecCBOR ProtVer Source # | |
EncCBOR ProtVer Source # | |
DecCBORGroup ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes | |
EncCBORGroup ProtVer Source # | |
ToPlutusData ProtVer Source # | |
Defined in Cardano.Ledger.Plutus.ToPlutusData | |
NFData ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq ProtVer Source # | |
Ord ProtVer Source # | |
NoThunks ProtVer Source # | |
type Rep ProtVer Source # | |
Defined in Cardano.Ledger.BaseTypes type Rep ProtVer = D1 ('MetaData "ProtVer" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "ProtVer" 'PrefixI 'True) (S1 ('MetaSel ('Just "pvMajor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Version) :*: S1 ('MetaSel ('Just "pvMinor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural))) |
type FixedPoint = Digits34 Source #
Instances
FromJSON Network Source # | |
ToJSON Network Source # | |
Bounded Network Source # | |
Enum Network Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Generic Network Source # | |
Show Network Source # | |
DecCBOR Network Source # | |
EncCBOR Network Source # | |
Default Network Source # | |
Defined in Cardano.Ledger.BaseTypes | |
NFData Network Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq Network Source # | |
Ord Network Source # | |
NoThunks Network Source # | |
type Rep Network Source # | |
Evolving nonce type.
Nonce !(Hash Blake2b_256 Nonce) | |
NeutralNonce | Identity element |
Instances
FromJSON Nonce Source # | |
ToJSON Nonce Source # | |
Generic Nonce Source # | |
Show Nonce Source # | |
FromCBOR Nonce Source # | |
ToCBOR Nonce Source # | |
DecCBOR Nonce Source # | |
EncCBOR Nonce Source # | |
NFData Nonce Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq Nonce Source # | |
Ord 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-1.17.0.0-inplace" '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.
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
.
invalidKey ∷ MonadFail m ⇒ Word → m a Source #
Report an error when a numeric key of the type constructor doesn't match.
mkNonceFromOutputVRF ∷ OutputVRF v → Nonce Source #
Make a nonce from the VRF output bytes
mkNonceFromNumber ∷ Word64 → Nonce Source #
Make a nonce from a number.
textToUrl ∷ MonadFail m ⇒ Int → Text → m Url Source #
Turn a Text into a Url, fail if the Text has more than n
Bytes
Instances
textToDns ∷ MonadFail m ⇒ Int → Text → m DnsName Source #
Turn a Text into a DnsName, fail if the Text has more than n
Bytes
data ActiveSlotCoeff Source #
Instances
module Data.Maybe.Strict
newtype BlocksMade Source #
Number of blocks which have been created by stake pools in the current epoch.
Instances
Indices
Transaction index.
Instances
ToJSON TxIx Source # | |
Bounded TxIx Source # | |
Enum TxIx Source # | |
Generic TxIx Source # | |
Show TxIx Source # | |
FromCBOR TxIx Source # | |
ToCBOR TxIx Source # | |
DecCBOR TxIx Source # | |
EncCBOR TxIx Source # | |
NFData TxIx Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq TxIx Source # | |
Ord TxIx Source # | |
MemPack TxIx Source # | |
NoThunks TxIx Source # | |
type Rep TxIx Source # | |
mkTxIxPartial ∷ HasCallStack ⇒ Integer → TxIx Source #
Certificate index. There is mkCertIxPartial
that can be used for testing when constructing
from other integral types that are larger than Word16
Instances
ToJSON CertIx Source # | |
Bounded CertIx Source # | |
Enum CertIx Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Show CertIx Source # | |
FromCBOR CertIx Source # | |
ToCBOR CertIx Source # | |
DecCBOR CertIx Source # | |
EncCBOR CertIx Source # | |
NFData CertIx Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq CertIx Source # | |
Ord CertIx Source # | |
NoThunks CertIx Source # | |
certIxToInt ∷ CertIx → Int Source #
Anchor | |
|
Instances
FromJSON Anchor Source # | |
ToJSON Anchor Source # | |
Generic Anchor Source # | |
Show Anchor Source # | |
DecCBOR Anchor Source # | |
EncCBOR Anchor Source # | |
Default Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes | |
NFData Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq Anchor Source # | |
Ord Anchor Source # | |
NoThunks Anchor Source # | |
type Rep Anchor Source # | |
Defined in Cardano.Ledger.BaseTypes type Rep Anchor = D1 ('MetaData "Anchor" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "Anchor" 'PrefixI 'True) (S1 ('MetaSel ('Just "anchorUrl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Url) :*: S1 ('MetaSel ('Just "anchorDataHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SafeHash AnchorData)))) |
newtype AnchorData Source #
Instances
SafeToHash AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes (==) ∷ AnchorData → AnchorData → Bool # (/=) ∷ AnchorData → AnchorData → Bool # | |
HashAnnotated AnchorData AnchorData Source # | |
Defined in Cardano.Ledger.BaseTypes |
hashAnchorData ∷ AnchorData → SafeHash AnchorData Source #
Deprecated: In favor of hashAnnotated
Hash AnchorData
STS Base
Globals | |
|
Instances
Generic Globals Source # | |
Show Globals Source # | |
NFData Globals Source # | |
Defined in Cardano.Ledger.BaseTypes | |
NoThunks Globals Source # | |
type Rep Globals Source # | |
Defined in Cardano.Ledger.BaseTypes type Rep Globals = D1 ('MetaData "Globals" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "Globals" 'PrefixI 'True) (((S1 ('MetaSel ('Just "epochInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (EpochInfo (Either Text))) :*: S1 ('MetaSel ('Just "slotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "stabilityWindow") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "randomnessStabilisationWindow") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "securityParameter") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))) :*: ((S1 ('MetaSel ('Just "maxKESEvo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "quorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "maxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))) :*: (S1 ('MetaSel ('Just "activeSlotCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveSlotCoeff) :*: (S1 ('MetaSel ('Just "networkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('Just "systemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SystemStart)))))) |
epochInfoPure ∷ Globals → EpochInfo Identity Source #
Pure epoch info via throw. Note that this should only be used when we can
guarantee the validity of the translation; in particular, the EpochInfo
used here should never be applied to user-supplied input.
Relationship descriptor for the expectation in the Mismatch
type.
RelEQ | Equal |
RelLT | Less then |
RelGT | Greater then |
RelLTEQ | Less then or equal |
RelGTEQ | Greater then or equal |
RelSubset | Is subset of |
Instances
FromJSON Relation Source # | |
ToJSON Relation Source # | |
Bounded Relation Source # | |
Enum Relation Source # | |
Generic Relation Source # | |
Show Relation Source # | |
NFData Relation Source # | |
Defined in Cardano.Ledger.BaseTypes | |
Eq Relation Source # | |
Ord Relation Source # | |
NoThunks Relation Source # | |
type Rep Relation Source # | |
Defined in Cardano.Ledger.BaseTypes type Rep Relation = D1 ('MetaData "Relation" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.17.0.0-inplace" 'False) ((C1 ('MetaCons "RelEQ" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "RelLT" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "RelGT" 'PrefixI 'False) (U1 ∷ Type → Type))) :+: (C1 ('MetaCons "RelLTEQ" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "RelGTEQ" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "RelSubset" 'PrefixI 'False) (U1 ∷ Type → Type)))) |
data Mismatch (r ∷ Relation) a Source #
This is intended to help clarify supplied and expected values reported by predicate-failures in all eras.
Mismatch | |
|
Instances
swapMismatch ∷ Mismatch r a → (a, a) Source #
Convert a Mismatch
to a tuple that has "supplied" and "expected" swapped places
unswapMismatch ∷ (a, a) → Mismatch r a Source #
Convert a tuple that has "supplied" and "expected" swapped places to a Mismatch
type.