Copyright | © 2022 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Re-exports functionality provided by module
Credential
,
but with a safer interface.
Safe
Ptr
interface
Pointer to a slot number, transaction index and an index in certificate list.
Instances
Eq Ptr | |
Ord Ptr | |
Show Ptr | |
Generic Ptr | |
NFData Ptr | |
Defined in Cardano.Ledger.Credential |
|
FromCBOR Ptr | |
ToCBOR Ptr | |
ToCBORGroup Ptr | |
FromCBORGroup Ptr | |
Defined in Cardano.Ledger.Credential fromCBORGroup :: Decoder s Ptr Source # |
|
NoThunks Ptr | |
type Rep Ptr | |
Defined in Cardano.Ledger.Credential
type
Rep
Ptr
=
D1
('
MetaData
"Ptr" "Cardano.Ledger.Credential" "cardano-ledger-core-0.1.0.0-3EJt5rxsPizAWHDEqGPh9V" '
False
) (
C1
('
MetaCons
"Ptr" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
SourceStrict
'
DecidedUnpack
) (
Rec0
SlotNo
)
:*:
(
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
SourceStrict
'
DecidedUnpack
) (
Rec0
TxIx
)
:*:
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
SourceStrict
'
DecidedUnpack
) (
Rec0
CertIx
))))
|
safePtr :: SlotNo32 -> TxIx -> CertIx -> Ptr Source #
Safely constructs a
Ptr
without silent truncation of slot numbers.
Use
toSlotNo32
to convert an ordinary
SlotNo
to a
SlotNo32
.
This function should satisfy the following property:
safeUnwrapPtr (safePtr s t c) == (s, t, c)
safeUnwrapPtr :: Ptr -> ( SlotNo32 , TxIx , CertIx ) Source #
Safely deconstructs a
Ptr
.
Use
fromSlotNo32
to convert the returned slot number to a
SlotNo
.
This function should satisfy the following property:
safeUnwrapPtr (safePtr s t c) == (s, t, c)
Conversions to and from
Slot32
A 32-bit wide slot number.
Instances
Eq SlotNo32 Source # | |
Num SlotNo32 Source # | |
Defined in Cardano.Ledger.Credential.Safe (+) :: SlotNo32 -> SlotNo32 -> SlotNo32 Source # (-) :: SlotNo32 -> SlotNo32 -> SlotNo32 Source # (*) :: SlotNo32 -> SlotNo32 -> SlotNo32 Source # negate :: SlotNo32 -> SlotNo32 Source # abs :: SlotNo32 -> SlotNo32 Source # signum :: SlotNo32 -> SlotNo32 Source # fromInteger :: Integer -> SlotNo32 Source # |
|
Ord SlotNo32 Source # | |
Defined in Cardano.Ledger.Credential.Safe |
|
Show SlotNo32 Source # | |