| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Chain.Common
Synopsis
- data Address = Address {}
- data Lovelace
- data AddrAttributes = AddrAttributes {}
- data AddrSpendingData
- type AddressHash = AbstractHash Blake2b_224
- data Attributes h = Attributes {
- attrData ∷ !h
- attrRemain ∷ !UnparsedFields
- newtype BlockCount = BlockCount {}
- newtype ChainDifficulty = ChainDifficulty {}
- newtype KeyHash = KeyHash {}
- data LovelacePortion
- data NetworkMagic
- data TxFeePolicy = TxFeePolicyTxSizeLinear !TxSizeLinear
- data TxSizeLinear = TxSizeLinear !Lovelace !Rational
- hashKey ∷ VerificationKey → KeyHash
- data LovelaceError
- isRedeemAddress ∷ Address → Bool
- sumLovelace ∷ (Foldable t, Functor t) ⇒ t Lovelace → Either LovelaceError Lovelace
- addrNetworkMagic ∷ Address → NetworkMagic
- calculateTxSizeLinear ∷ TxSizeLinear → Natural → Either LovelaceError Lovelace
- checkRedeemAddress ∷ RedeemVerificationKey → Address → Bool
- checkVerKeyAddress ∷ VerificationKey → Address → Bool
- makeNetworkMagic ∷ AProtocolMagic a → NetworkMagic
- mkKnownLovelace ∷ ∀ (n ∷ Nat). (KnownNat n, n <= 45000000000000000) ⇒ Lovelace
- subLovelace ∷ Lovelace → Lovelace → Either LovelaceError Lovelace
- unknownAttributesLength ∷ Attributes a → Int
- dropEmptyAttributes ∷ Dropper s
- addressHash ∷ EncCBOR a ⇒ a → AddressHash a
- decCBORAttributes ∷ t → (Word8 → ByteString → t → Decoder s (Maybe t)) → Decoder s (Attributes t)
- dropAttributes ∷ Dropper s
- newtype HDAddressPayload = HDAddressPayload {}
- encCBORAttributes ∷ [(Word8, t → ByteString)] → Attributes t → Encoding
- data AddrType
- addrSpendingDataToType ∷ AddrSpendingData → AddrType
- newtype Address' = Address' {}
- addressF ∷ Format r (Address → r)
- addressDetailedF ∷ Format r (Address → r)
- checkAddrSpendingData ∷ AddrSpendingData → Address → Bool
- addrToBase58 ∷ Address → ByteString
- encCBORAddr ∷ Address → Encoding
- encCBORAddrCRC32 ∷ Address → Encoding
- decodeAddressBase58 ∷ Text → Either DecoderError Address
- encodeAddressBase58 ∷ Address → Text
- addrAttributesUnwrapped ∷ Address → AddrAttributes
- makeAddress ∷ AddrSpendingData → AddrAttributes → Address
- makeVerKeyAddress ∷ NetworkMagic → VerificationKey → Address
- makeVerKeyHdwAddress ∷ NetworkMagic → HDAddressPayload → VerificationKey → Address
- makeRedeemAddress ∷ NetworkMagic → RedeemVerificationKey → Address
- mkAttributes ∷ h → Attributes h
- decodeCrcProtected ∷ ∀ s a. DecCBOR a ⇒ Decoder s a
- encodeCrcProtected ∷ ToCBOR a ⇒ a → Encoding
- encodedCrcProtectedSizeExpr ∷ ToCBOR a ⇒ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy a → Size
- unsafeAddressHash ∷ EncCBOR a ⇒ a → AddressHash b
- newtype UnparsedFields = UnparsedFields (Map Word8 ByteString)
- attributesAreKnown ∷ Attributes a → Bool
- encodeKnownCborDataItem ∷ EncCBOR a ⇒ a → Encoding
- encodeUnknownCborDataItem ∷ LByteString → Encoding
- knownCborDataItemSizeExpr ∷ Size → Size
- unknownCborDataItemSizeExpr ∷ Size → Size
- decodeKnownCborDataItem ∷ DecCBOR a ⇒ Decoder s a
- decodeUnknownCborDataItem ∷ Decoder s ByteString
- dropChainDifficulty ∷ Dropper s
- data CompactAddress
- toCompactAddress ∷ Address → CompactAddress
- fromCompactAddress ∷ CompactAddress → Address
- unsafeGetCompactAddress ∷ CompactAddress → ShortByteString
- maxLovelaceVal ∷ Word64
- mkLovelace ∷ Word64 → Either LovelaceError Lovelace
- lovelaceF ∷ Format r (Lovelace → r)
- unsafeGetLovelace ∷ Lovelace → Word64
- lovelaceToInteger ∷ Lovelace → Integer
- integerToLovelace ∷ Integer → Either LovelaceError Lovelace
- addLovelace ∷ Lovelace → Lovelace → Either LovelaceError Lovelace
- scaleLovelace ∷ Integral b ⇒ Lovelace → b → Either LovelaceError Lovelace
- scaleLovelaceRational ∷ Lovelace → Rational → Lovelace
- scaleLovelaceRationalUp ∷ Lovelace → Rational → Lovelace
- divLovelace ∷ Integral b ⇒ Lovelace → b → Either LovelaceError Lovelace
- modLovelace ∷ Integral b ⇒ Lovelace → b → Either LovelaceError Lovelace
- rationalToLovelacePortion ∷ Rational → LovelacePortion
- lovelacePortionToRational ∷ LovelacePortion → Rational
- newtype MerkleRoot a = MerkleRoot {}
- data MerkleTree a
- = MerkleEmpty
- | MerkleTree !Word32 !(MerkleNode a)
- mtRoot ∷ MerkleTree a → MerkleRoot a
- mkMerkleTree ∷ EncCBOR a ⇒ [a] → MerkleTree a
- mkMerkleTreeDecoded ∷ [Annotated a ByteString] → MerkleTree a
- data MerkleNode a
- = MerkleBranch !(MerkleRoot a) !(MerkleNode a) !(MerkleNode a)
- | MerkleLeaf !(MerkleRoot a) a
- mkBranch ∷ MerkleNode a → MerkleNode a → MerkleNode a
- mkLeaf ∷ EncCBOR a ⇒ a → MerkleNode a
- mkLeafDecoded ∷ Annotated a ByteString → MerkleNode a
- txSizeLinearMinValue ∷ TxSizeLinear → Lovelace
Documentation
Address is where you can send Lovelace
Constructors
| Address | |
Fields
| |
Instances
Lovelace is the least possible unit of currency
Instances
| ToJSON Lovelace Source # | |||||
| FromCBOR Lovelace Source # | |||||
| ToCBOR Lovelace Source # | |||||
| DecCBOR Lovelace Source # | |||||
| EncCBOR Lovelace Source # | |||||
| NFData Lovelace Source # | |||||
Defined in Cardano.Chain.Common.Lovelace | |||||
| Buildable Lovelace Source # | |||||
| Data Lovelace Source # | |||||
Defined in Cardano.Chain.Common.Lovelace Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → Lovelace → c Lovelace # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c Lovelace # toConstr ∷ Lovelace → Constr # dataTypeOf ∷ Lovelace → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c Lovelace) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c Lovelace) # gmapT ∷ (∀ b. Data b ⇒ b → b) → Lovelace → Lovelace # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → Lovelace → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → Lovelace → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → Lovelace → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → Lovelace → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → Lovelace → m Lovelace # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Lovelace → m Lovelace # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → Lovelace → m Lovelace # | |||||
| Bounded Lovelace Source # | |||||
| Generic Lovelace Source # | |||||
Defined in Cardano.Chain.Common.Lovelace Associated Types
| |||||
| Show Lovelace Source # | |||||
| Eq Lovelace Source # | |||||
| Ord Lovelace Source # | |||||
Defined in Cardano.Chain.Common.Lovelace | |||||
| NoThunks Lovelace Source # | |||||
| ReportSchemaErrors m ⇒ FromJSON m Lovelace Source # | |||||
| Monad m ⇒ ToJSON m Lovelace Source # | |||||
| type Rep Lovelace Source # | |||||
Defined in Cardano.Chain.Common.Lovelace | |||||
data AddrAttributes Source #
Additional information stored along with address. It's intended
to be put into Attributes data type to make it extensible with
softfork.
Constructors
| AddrAttributes | |
Fields | |
Instances
| ToJSON AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods toJSON ∷ AddrAttributes → Value Source # toEncoding ∷ AddrAttributes → Encoding Source # toJSONList ∷ [AddrAttributes] → Value Source # | |||||
| NFData AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods rnf ∷ AddrAttributes → () # | |||||
| Buildable AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| Generic AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Associated Types
| |||||
| Show AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods showsPrec ∷ Int → AddrAttributes → ShowS # show ∷ AddrAttributes → String # showList ∷ [AddrAttributes] → ShowS # | |||||
| Eq AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods (==) ∷ AddrAttributes → AddrAttributes → Bool # (/=) ∷ AddrAttributes → AddrAttributes → Bool # | |||||
| Ord AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods compare ∷ AddrAttributes → AddrAttributes → Ordering # (<) ∷ AddrAttributes → AddrAttributes → Bool # (<=) ∷ AddrAttributes → AddrAttributes → Bool # (>) ∷ AddrAttributes → AddrAttributes → Bool # (>=) ∷ AddrAttributes → AddrAttributes → Bool # | |||||
| HeapWords AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| NoThunks AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes | |||||
| FromCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods fromCBOR ∷ Decoder s (Attributes AddrAttributes) Source # label ∷ Proxy (Attributes AddrAttributes) → Text Source # | |||||
| ToCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods toCBOR ∷ Attributes AddrAttributes → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Attributes AddrAttributes) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Attributes AddrAttributes] → Size Source # | |||||
| DecCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods decCBOR ∷ Decoder s (Attributes AddrAttributes) Source # dropCBOR ∷ Proxy (Attributes AddrAttributes) → Decoder s () Source # label ∷ Proxy (Attributes AddrAttributes) → Text Source # | |||||
| EncCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| type Rep AddrAttributes Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes type Rep AddrAttributes = D1 ('MetaData "AddrAttributes" "Cardano.Chain.Common.AddrAttributes" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "AddrAttributes" 'PrefixI 'True) (S1 ('MetaSel ('Just "aaVKDerivationPath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe HDAddressPayload)) :*: S1 ('MetaSel ('Just "aaNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NetworkMagic))) | |||||
data AddrSpendingData Source #
Data which is bound to an address and must be revealed in order to spend lovelace belonging to this address.
Constructors
| VerKeyASD !VerificationKey | Funds can be spent by revealing a |
| RedeemASD !RedeemVerificationKey | Funds can be spent by revealing a |
Instances
| FromCBOR AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData | |||||
| ToCBOR AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Methods toCBOR ∷ AddrSpendingData → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy AddrSpendingData → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [AddrSpendingData] → Size Source # | |||||
| DecCBOR AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData | |||||
| EncCBOR AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Methods | |||||
| NFData AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Methods rnf ∷ AddrSpendingData → () # | |||||
| Buildable AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Methods | |||||
| Generic AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Associated Types
Methods from ∷ AddrSpendingData → Rep AddrSpendingData x # to ∷ Rep AddrSpendingData x → AddrSpendingData # | |||||
| Show AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Methods showsPrec ∷ Int → AddrSpendingData → ShowS # show ∷ AddrSpendingData → String # showList ∷ [AddrSpendingData] → ShowS # | |||||
| Eq AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Methods | |||||
| type Rep AddrSpendingData Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData type Rep AddrSpendingData = D1 ('MetaData "AddrSpendingData" "Cardano.Chain.Common.AddrSpendingData" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "VerKeyASD" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 VerificationKey)) :+: C1 ('MetaCons "RedeemASD" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RedeemVerificationKey))) | |||||
type AddressHash = AbstractHash Blake2b_224 Source #
Hash used to identify address.
data Attributes h Source #
Convenient wrapper for the datatype to represent it (in binary format) as k-v map
Constructors
| Attributes | |
Fields
| |
Instances
| ToJSON a ⇒ ToJSON (Attributes a) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods toJSON ∷ Attributes a → Value Source # toEncoding ∷ Attributes a → Encoding Source # toJSONList ∷ [Attributes a] → Value Source # toEncodingList ∷ [Attributes a] → Encoding Source # omitField ∷ Attributes a → Bool Source # | |||||
| FromCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods fromCBOR ∷ Decoder s (Attributes AddrAttributes) Source # label ∷ Proxy (Attributes AddrAttributes) → Text Source # | |||||
| FromCBOR (Attributes ()) Source # | |||||
Defined in Cardano.Chain.Common.Attributes | |||||
| ToCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods toCBOR ∷ Attributes AddrAttributes → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Attributes AddrAttributes) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Attributes AddrAttributes] → Size Source # | |||||
| ToCBOR (Attributes ()) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods toCBOR ∷ Attributes () → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Attributes ()) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Attributes ()] → Size Source # | |||||
| DecCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods decCBOR ∷ Decoder s (Attributes AddrAttributes) Source # dropCBOR ∷ Proxy (Attributes AddrAttributes) → Decoder s () Source # label ∷ Proxy (Attributes AddrAttributes) → Text Source # | |||||
| DecCBOR (Attributes ()) Source # | |||||
Defined in Cardano.Chain.Common.Attributes | |||||
| EncCBOR (Attributes AddrAttributes) Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| EncCBOR (Attributes ()) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods encCBOR ∷ Attributes () → Encoding Source # | |||||
| NFData h ⇒ NFData (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods rnf ∷ Attributes h → () # | |||||
| Buildable (Attributes ()) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods build ∷ Attributes () → Builder Source # | |||||
| Buildable h ⇒ Buildable (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods build ∷ Attributes h → Builder Source # | |||||
| Generic (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Associated Types
| |||||
| Show h ⇒ Show (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods showsPrec ∷ Int → Attributes h → ShowS # show ∷ Attributes h → String # showList ∷ [Attributes h] → ShowS # | |||||
| Eq h ⇒ Eq (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes | |||||
| Ord h ⇒ Ord (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods compare ∷ Attributes h → Attributes h → Ordering # (<) ∷ Attributes h → Attributes h → Bool # (<=) ∷ Attributes h → Attributes h → Bool # (>) ∷ Attributes h → Attributes h → Bool # (>=) ∷ Attributes h → Attributes h → Bool # max ∷ Attributes h → Attributes h → Attributes h # min ∷ Attributes h → Attributes h → Attributes h # | |||||
| HeapWords h ⇒ HeapWords (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods heapWords ∷ Attributes h → Int Source # | |||||
| NoThunks h ⇒ NoThunks (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes | |||||
| type Rep (Attributes h) Source # | |||||
Defined in Cardano.Chain.Common.Attributes type Rep (Attributes h) = D1 ('MetaData "Attributes" "Cardano.Chain.Common.Attributes" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "Attributes" 'PrefixI 'True) (S1 ('MetaSel ('Just "attrData") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 h) :*: S1 ('MetaSel ('Just "attrRemain") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UnparsedFields))) | |||||
newtype BlockCount Source #
Constructors
| BlockCount | |
Fields | |
Instances
| FromCBOR BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount | |||||
| ToCBOR BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods toCBOR ∷ BlockCount → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy BlockCount → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [BlockCount] → Size Source # | |||||
| DecCBOR BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount | |||||
| EncCBOR BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods encCBOR ∷ BlockCount → Encoding Source # | |||||
| NFData BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods rnf ∷ BlockCount → () # | |||||
| Buildable BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods build ∷ BlockCount → Builder Source # | |||||
| Enum BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods succ ∷ BlockCount → BlockCount # pred ∷ BlockCount → BlockCount # toEnum ∷ Int → BlockCount # fromEnum ∷ BlockCount → Int # enumFrom ∷ BlockCount → [BlockCount] # enumFromThen ∷ BlockCount → BlockCount → [BlockCount] # enumFromTo ∷ BlockCount → BlockCount → [BlockCount] # enumFromThenTo ∷ BlockCount → BlockCount → BlockCount → [BlockCount] # | |||||
| Generic BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Associated Types
| |||||
| Read BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods readsPrec ∷ Int → ReadS BlockCount # readList ∷ ReadS [BlockCount] # | |||||
| Show BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods showsPrec ∷ Int → BlockCount → ShowS # show ∷ BlockCount → String # showList ∷ [BlockCount] → ShowS # | |||||
| Eq BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount | |||||
| Ord BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount Methods compare ∷ BlockCount → BlockCount → Ordering # (<) ∷ BlockCount → BlockCount → Bool # (<=) ∷ BlockCount → BlockCount → Bool # (>) ∷ BlockCount → BlockCount → Bool # (>=) ∷ BlockCount → BlockCount → Bool # max ∷ BlockCount → BlockCount → BlockCount # min ∷ BlockCount → BlockCount → BlockCount # | |||||
| NoThunks BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount | |||||
| type Rep BlockCount Source # | |||||
Defined in Cardano.Chain.Common.BlockCount type Rep BlockCount = D1 ('MetaData "BlockCount" "Cardano.Chain.Common.BlockCount" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "BlockCount" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |||||
newtype ChainDifficulty Source #
Chain difficulty represents necessary effort to generate a chain. In the simplest case it can be number of blocks in chain.
Constructors
| ChainDifficulty | |
Fields | |
Instances
| ToJSON ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods toJSON ∷ ChainDifficulty → Value Source # toEncoding ∷ ChainDifficulty → Encoding Source # toJSONList ∷ [ChainDifficulty] → Value Source # | |||||
| FromCBOR ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty | |||||
| ToCBOR ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods toCBOR ∷ ChainDifficulty → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ChainDifficulty → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ChainDifficulty] → Size Source # | |||||
| DecCBOR ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty | |||||
| EncCBOR ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods | |||||
| NFData ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods rnf ∷ ChainDifficulty → () # | |||||
| Buildable ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods | |||||
| Enum ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods succ ∷ ChainDifficulty → ChainDifficulty # pred ∷ ChainDifficulty → ChainDifficulty # toEnum ∷ Int → ChainDifficulty # fromEnum ∷ ChainDifficulty → Int # enumFrom ∷ ChainDifficulty → [ChainDifficulty] # enumFromThen ∷ ChainDifficulty → ChainDifficulty → [ChainDifficulty] # enumFromTo ∷ ChainDifficulty → ChainDifficulty → [ChainDifficulty] # enumFromThenTo ∷ ChainDifficulty → ChainDifficulty → ChainDifficulty → [ChainDifficulty] # | |||||
| Generic ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Associated Types
Methods from ∷ ChainDifficulty → Rep ChainDifficulty x # to ∷ Rep ChainDifficulty x → ChainDifficulty # | |||||
| Show ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods showsPrec ∷ Int → ChainDifficulty → ShowS # show ∷ ChainDifficulty → String # showList ∷ [ChainDifficulty] → ShowS # | |||||
| Eq ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods (==) ∷ ChainDifficulty → ChainDifficulty → Bool # (/=) ∷ ChainDifficulty → ChainDifficulty → Bool # | |||||
| Ord ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty Methods compare ∷ ChainDifficulty → ChainDifficulty → Ordering # (<) ∷ ChainDifficulty → ChainDifficulty → Bool # (<=) ∷ ChainDifficulty → ChainDifficulty → Bool # (>) ∷ ChainDifficulty → ChainDifficulty → Bool # (>=) ∷ ChainDifficulty → ChainDifficulty → Bool # | |||||
| NoThunks ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty | |||||
| type Rep ChainDifficulty Source # | |||||
Defined in Cardano.Chain.Common.ChainDifficulty type Rep ChainDifficulty = D1 ('MetaData "ChainDifficulty" "Cardano.Chain.Common.ChainDifficulty" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "ChainDifficulty" 'PrefixI 'True) (S1 ('MetaSel ('Just "unChainDifficulty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |||||
A KeyHash refers to a VerificationKey
Constructors
| KeyHash | |
Fields | |
Instances
| FromCBOR KeyHash Source # | |
| ToCBOR KeyHash Source # | |
| DecCBOR KeyHash Source # | |
| EncCBOR KeyHash Source # | |
| NFData KeyHash Source # | |
Defined in Cardano.Chain.Common.KeyHash | |
| Buildable KeyHash Source # | |
| Show KeyHash Source # | |
| Eq KeyHash Source # | |
| Ord KeyHash Source # | |
| HeapWords KeyHash Source # | |
| NoThunks KeyHash Source # | |
| MonadError SchemaError m ⇒ FromObjectKey m KeyHash Source # | |
Defined in Cardano.Chain.Common.KeyHash | |
| Monad m ⇒ ToObjectKey m KeyHash Source # | |
Defined in Cardano.Chain.Common.KeyHash Methods toObjectKey ∷ KeyHash → m JSString Source # | |
data LovelacePortion Source #
LovelacePortion is a legacy Byron type that we keep only for
compatibility. It was originally intended to represent a fraction of stake
in the system. It is used only for the thresholds used in the update system
rules, most of which are now themselves unused. The remaining case is no
longer interpreted as a fraction of all stake, but as a fraction of the
number of genesis keys.
It has enormous precision, due to the fact that it was originally intended to represent a fraction of all stake and can cover the precision of all the Lovelace in the system.
It is represented as a rational nominator with a fixed implicit denominator
of 1e15. So the nominator must be in the range [0..1e15]. This is also the
representation used on-chain (in update proposals) and in the JSON
genesis file.
It is interpreted as a Rational via the provided conversion functions.
Instances
| ToJSON LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods toJSON ∷ LovelacePortion → Value Source # toEncoding ∷ LovelacePortion → Encoding Source # toJSONList ∷ [LovelacePortion] → Value Source # | |||||
| FromCBOR LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion | |||||
| ToCBOR LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods toCBOR ∷ LovelacePortion → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy LovelacePortion → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [LovelacePortion] → Size Source # | |||||
| DecCBOR LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion | |||||
| EncCBOR LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods | |||||
| NFData LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods rnf ∷ LovelacePortion → () # | |||||
| Buildable LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods | |||||
| Generic LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Associated Types
Methods from ∷ LovelacePortion → Rep LovelacePortion x # to ∷ Rep LovelacePortion x → LovelacePortion # | |||||
| Show LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods showsPrec ∷ Int → LovelacePortion → ShowS # show ∷ LovelacePortion → String # showList ∷ [LovelacePortion] → ShowS # | |||||
| Eq LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods (==) ∷ LovelacePortion → LovelacePortion → Bool # (/=) ∷ LovelacePortion → LovelacePortion → Bool # | |||||
| Ord LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods compare ∷ LovelacePortion → LovelacePortion → Ordering # (<) ∷ LovelacePortion → LovelacePortion → Bool # (<=) ∷ LovelacePortion → LovelacePortion → Bool # (>) ∷ LovelacePortion → LovelacePortion → Bool # (>=) ∷ LovelacePortion → LovelacePortion → Bool # | |||||
| HeapWords LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods | |||||
| NoThunks LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion | |||||
| MonadError SchemaError m ⇒ FromJSON m LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods fromJSON ∷ JSValue → m LovelacePortion Source # | |||||
| Monad m ⇒ ToJSON m LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion Methods toJSON ∷ LovelacePortion → m JSValue Source # | |||||
| type Rep LovelacePortion Source # | |||||
Defined in Cardano.Chain.Common.LovelacePortion type Rep LovelacePortion = D1 ('MetaData "LovelacePortion" "Cardano.Chain.Common.LovelacePortion" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "LovelacePortion" 'PrefixI 'True) (S1 ('MetaSel ('Just "unLovelacePortion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |||||
data NetworkMagic Source #
Constructors
| NetworkMainOrStage | |
| NetworkTestnet !Word32 |
Instances
| ToJSON NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods toJSON ∷ NetworkMagic → Value Source # toEncoding ∷ NetworkMagic → Encoding Source # toJSONList ∷ [NetworkMagic] → Value Source # toEncodingList ∷ [NetworkMagic] → Encoding Source # omitField ∷ NetworkMagic → Bool Source # | |||||
| FromCBOR NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic | |||||
| ToCBOR NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods toCBOR ∷ NetworkMagic → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy NetworkMagic → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [NetworkMagic] → Size Source # | |||||
| DecCBOR NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic | |||||
| EncCBOR NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods | |||||
| NFData NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods rnf ∷ NetworkMagic → () # | |||||
| Buildable NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods build ∷ NetworkMagic → Builder Source # | |||||
| Generic NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Associated Types
| |||||
| Show NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods showsPrec ∷ Int → NetworkMagic → ShowS # show ∷ NetworkMagic → String # showList ∷ [NetworkMagic] → ShowS # | |||||
| Eq NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic | |||||
| Ord NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods compare ∷ NetworkMagic → NetworkMagic → Ordering # (<) ∷ NetworkMagic → NetworkMagic → Bool # (<=) ∷ NetworkMagic → NetworkMagic → Bool # (>) ∷ NetworkMagic → NetworkMagic → Bool # (>=) ∷ NetworkMagic → NetworkMagic → Bool # max ∷ NetworkMagic → NetworkMagic → NetworkMagic # min ∷ NetworkMagic → NetworkMagic → NetworkMagic # | |||||
| HeapWords NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic Methods heapWords ∷ NetworkMagic → Int Source # | |||||
| NoThunks NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic | |||||
| type Rep NetworkMagic Source # | |||||
Defined in Cardano.Chain.Common.NetworkMagic type Rep NetworkMagic = D1 ('MetaData "NetworkMagic" "Cardano.Chain.Common.NetworkMagic" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "NetworkMainOrStage" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "NetworkTestnet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32))) | |||||
data TxFeePolicy Source #
Transaction fee policy represents a formula to compute the minimal allowed Fee for a transaction. Transactions with lesser fees won't be accepted. The Minimal fee may depend on the properties of a transaction (for example, its Size in bytes), so the policy can't be represented simply as a number.
Recall that a transaction fee is the difference between the sum of its
Inputs and the sum of its outputs. The transaction is accepted when
minimal_fee(tx) <= fee(tx), where minimal_fee is the function defined
By the policy.
The policy can change during the lifetime of the blockchain (using the Update mechanism). At the moment we have just one policy type (a linear Equation on the transaction size), but in the future other policies may Be added. To make this future-proof, we also have an "unknown" policy used By older node versions (the ones that haven't updated yet).
Constructors
| TxFeePolicyTxSizeLinear !TxSizeLinear |
Instances
| ToJSON TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods toJSON ∷ TxFeePolicy → Value Source # toEncoding ∷ TxFeePolicy → Encoding Source # toJSONList ∷ [TxFeePolicy] → Value Source # toEncodingList ∷ [TxFeePolicy] → Encoding Source # omitField ∷ TxFeePolicy → Bool Source # | |||||
| FromCBOR TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy | |||||
| ToCBOR TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods toCBOR ∷ TxFeePolicy → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy TxFeePolicy → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [TxFeePolicy] → Size Source # | |||||
| DecCBOR TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy | |||||
| EncCBOR TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods | |||||
| NFData TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods rnf ∷ TxFeePolicy → () # | |||||
| Buildable TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods build ∷ TxFeePolicy → Builder Source # | |||||
| Generic TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Associated Types
| |||||
| Show TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods showsPrec ∷ Int → TxFeePolicy → ShowS # show ∷ TxFeePolicy → String # showList ∷ [TxFeePolicy] → ShowS # | |||||
| Eq TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy | |||||
| Ord TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods compare ∷ TxFeePolicy → TxFeePolicy → Ordering # (<) ∷ TxFeePolicy → TxFeePolicy → Bool # (<=) ∷ TxFeePolicy → TxFeePolicy → Bool # (>) ∷ TxFeePolicy → TxFeePolicy → Bool # (>=) ∷ TxFeePolicy → TxFeePolicy → Bool # max ∷ TxFeePolicy → TxFeePolicy → TxFeePolicy # min ∷ TxFeePolicy → TxFeePolicy → TxFeePolicy # | |||||
| NoThunks TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy | |||||
| MonadError SchemaError m ⇒ FromJSON m TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods fromJSON ∷ JSValue → m TxFeePolicy Source # | |||||
| Monad m ⇒ ToJSON m TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy Methods toJSON ∷ TxFeePolicy → m JSValue Source # | |||||
| type Rep TxFeePolicy Source # | |||||
Defined in Cardano.Chain.Common.TxFeePolicy type Rep TxFeePolicy = D1 ('MetaData "TxFeePolicy" "Cardano.Chain.Common.TxFeePolicy" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "TxFeePolicyTxSizeLinear" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TxSizeLinear))) | |||||
data TxSizeLinear Source #
A linear equation on the transaction size. Represents the s -> a + b*s
function where s is the transaction size in bytes, a and b are
constant coefficients.
Constructors
| TxSizeLinear !Lovelace !Rational |
Instances
| ToJSON TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods toJSON ∷ TxSizeLinear → Value Source # toEncoding ∷ TxSizeLinear → Encoding Source # toJSONList ∷ [TxSizeLinear] → Value Source # toEncodingList ∷ [TxSizeLinear] → Encoding Source # omitField ∷ TxSizeLinear → Bool Source # | |||||
| FromCBOR TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear | |||||
| ToCBOR TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods toCBOR ∷ TxSizeLinear → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy TxSizeLinear → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [TxSizeLinear] → Size Source # | |||||
| DecCBOR TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear | |||||
| EncCBOR TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods | |||||
| NFData TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods rnf ∷ TxSizeLinear → () # | |||||
| Buildable TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods build ∷ TxSizeLinear → Builder Source # | |||||
| Generic TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Associated Types
| |||||
| Show TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods showsPrec ∷ Int → TxSizeLinear → ShowS # show ∷ TxSizeLinear → String # showList ∷ [TxSizeLinear] → ShowS # | |||||
| Eq TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear | |||||
| Ord TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear Methods compare ∷ TxSizeLinear → TxSizeLinear → Ordering # (<) ∷ TxSizeLinear → TxSizeLinear → Bool # (<=) ∷ TxSizeLinear → TxSizeLinear → Bool # (>) ∷ TxSizeLinear → TxSizeLinear → Bool # (>=) ∷ TxSizeLinear → TxSizeLinear → Bool # max ∷ TxSizeLinear → TxSizeLinear → TxSizeLinear # min ∷ TxSizeLinear → TxSizeLinear → TxSizeLinear # | |||||
| NoThunks TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear | |||||
| type Rep TxSizeLinear Source # | |||||
Defined in Cardano.Chain.Common.TxSizeLinear type Rep TxSizeLinear = D1 ('MetaData "TxSizeLinear" "Cardano.Chain.Common.TxSizeLinear" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "TxSizeLinear" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Lovelace) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rational))) | |||||
data LovelaceError Source #
Constructors
| LovelaceOverflow Word64 | |
| LovelaceTooLarge Integer | |
| LovelaceTooSmall Integer | |
| LovelaceUnderflow Word64 Word64 |
Instances
| FromCBOR LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace | |
| ToCBOR LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace Methods toCBOR ∷ LovelaceError → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy LovelaceError → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [LovelaceError] → Size Source # | |
| DecCBOR LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace | |
| EncCBOR LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace Methods | |
| Buildable LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace Methods build ∷ LovelaceError → Builder Source # | |
| Data LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace Methods gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → LovelaceError → c LovelaceError # gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c LovelaceError # toConstr ∷ LovelaceError → Constr # dataTypeOf ∷ LovelaceError → DataType # dataCast1 ∷ Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c LovelaceError) # dataCast2 ∷ Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c LovelaceError) # gmapT ∷ (∀ b. Data b ⇒ b → b) → LovelaceError → LovelaceError # gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → LovelaceError → r # gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → LovelaceError → r # gmapQ ∷ (∀ d. Data d ⇒ d → u) → LovelaceError → [u] # gmapQi ∷ Int → (∀ d. Data d ⇒ d → u) → LovelaceError → u # gmapM ∷ Monad m ⇒ (∀ d. Data d ⇒ d → m d) → LovelaceError → m LovelaceError # gmapMp ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → LovelaceError → m LovelaceError # gmapMo ∷ MonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → LovelaceError → m LovelaceError # | |
| Show LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace Methods showsPrec ∷ Int → LovelaceError → ShowS # show ∷ LovelaceError → String # showList ∷ [LovelaceError] → ShowS # | |
| Eq LovelaceError Source # | |
Defined in Cardano.Chain.Common.Lovelace | |
sumLovelace ∷ (Foldable t, Functor t) ⇒ t Lovelace → Either LovelaceError Lovelace Source #
Compute sum of all lovelace in container. Result is Integer as a
protection against possible overflow.
addrNetworkMagic ∷ Address → NetworkMagic Source #
Get NetworkMagic from Address
checkRedeemAddress ∷ RedeemVerificationKey → Address → Bool Source #
Check if given Address is created from given RedeemVerificationKey
checkVerKeyAddress ∷ VerificationKey → Address → Bool Source #
Check if given Address is created from given VerificationKey
mkKnownLovelace ∷ ∀ (n ∷ Nat). (KnownNat n, n <= 45000000000000000) ⇒ Lovelace Source #
Construct a Lovelace from a KnownNat, known to be less than
maxLovelaceVal
subLovelace ∷ Lovelace → Lovelace → Either LovelaceError Lovelace Source #
Subtraction of lovelace, returning LovelaceError on underflow
dropEmptyAttributes ∷ Dropper s Source #
Drop `Attributes ()` making sure that the UnparsedFields are empty
addressHash ∷ EncCBOR a ⇒ a → AddressHash a Source #
decCBORAttributes ∷ t → (Word8 → ByteString → t → Decoder s (Maybe t)) → Decoder s (Attributes t) Source #
dropAttributes ∷ Dropper s Source #
newtype HDAddressPayload Source #
HDAddressPayload is a specific address attribute that was used by the Cardano wallet at mainnet launch, prior to moving to a BIP-44 style scheme.
It consisted of
- serialized and encrypted using HDPassphrase derivation path from the root key to given descendant key (using ChaChaPoly1305 algorithm)
- cryptographic tag
It is still distinguished as an attribute, but not used by the ledger, because the attributes size limits treat this attribute specially.
Constructors
| HDAddressPayload | |
Fields | |
Instances
| ToJSON HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods toJSON ∷ HDAddressPayload → Value Source # toEncoding ∷ HDAddressPayload → Encoding Source # toJSONList ∷ [HDAddressPayload] → Value Source # | |||||
| FromCBOR HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes | |||||
| ToCBOR HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods toCBOR ∷ HDAddressPayload → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy HDAddressPayload → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [HDAddressPayload] → Size Source # | |||||
| DecCBOR HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes | |||||
| EncCBOR HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| NFData HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods rnf ∷ HDAddressPayload → () # | |||||
| Generic HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Associated Types
Methods from ∷ HDAddressPayload → Rep HDAddressPayload x # to ∷ Rep HDAddressPayload x → HDAddressPayload # | |||||
| Show HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods showsPrec ∷ Int → HDAddressPayload → ShowS # show ∷ HDAddressPayload → String # showList ∷ [HDAddressPayload] → ShowS # | |||||
| Eq HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| Ord HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods compare ∷ HDAddressPayload → HDAddressPayload → Ordering # (<) ∷ HDAddressPayload → HDAddressPayload → Bool # (<=) ∷ HDAddressPayload → HDAddressPayload → Bool # (>) ∷ HDAddressPayload → HDAddressPayload → Bool # (>=) ∷ HDAddressPayload → HDAddressPayload → Bool # max ∷ HDAddressPayload → HDAddressPayload → HDAddressPayload # min ∷ HDAddressPayload → HDAddressPayload → HDAddressPayload # | |||||
| HeapWords HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes Methods | |||||
| NoThunks HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes | |||||
| type Rep HDAddressPayload Source # | |||||
Defined in Cardano.Chain.Common.AddrAttributes type Rep HDAddressPayload = D1 ('MetaData "HDAddressPayload" "Cardano.Chain.Common.AddrAttributes" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "HDAddressPayload" 'PrefixI 'True) (S1 ('MetaSel ('Just "getHDAddressPayload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) | |||||
encCBORAttributes ∷ [(Word8, t → ByteString)] → Attributes t → Encoding Source #
Type of an address. It corresponds to constructors of AddrSpendingData.
It's separated, because Address doesn't store AddrSpendingData, but we
want to know its type.
Instances
| ToJSON AddrType Source # | |||||
| FromCBOR AddrType Source # | |||||
| ToCBOR AddrType Source # | |||||
| DecCBOR AddrType Source # | |||||
| EncCBOR AddrType Source # | |||||
| NFData AddrType Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData | |||||
| Generic AddrType Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData Associated Types
| |||||
| Show AddrType Source # | |||||
| Eq AddrType Source # | |||||
| Ord AddrType Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData | |||||
| HeapWords AddrType Source # | |||||
| NoThunks AddrType Source # | |||||
| type Rep AddrType Source # | |||||
Defined in Cardano.Chain.Common.AddrSpendingData | |||||
addrSpendingDataToType ∷ AddrSpendingData → AddrType Source #
Convert AddrSpendingData to the corresponding AddrType
Hash of this data is stored in Address. This type exists mostly
for internal usage.
Constructors
| Address' | |
Fields | |
Instances
| FromCBOR Address' Source # | |||||
| ToCBOR Address' Source # | |||||
| DecCBOR Address' Source # | |||||
| EncCBOR Address' Source # | |||||
| Generic Address' Source # | |||||
Defined in Cardano.Chain.Common.Address Associated Types
| |||||
| Show Address' Source # | |||||
| Eq Address' Source # | |||||
| type Rep Address' Source # | |||||
Defined in Cardano.Chain.Common.Address type Rep Address' = D1 ('MetaData "Address'" "Cardano.Chain.Common.Address" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "Address'" 'PrefixI 'True) (S1 ('MetaSel ('Just "unAddress'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AddrType, AddrSpendingData, Attributes AddrAttributes)))) | |||||
checkAddrSpendingData ∷ AddrSpendingData → Address → Bool Source #
Check whether given AddrSpendingData corresponds to given Address
decodeAddressBase58 ∷ Text → Either DecoderError Address Source #
Decode an address from Base58 encoded Text.
encodeAddressBase58 ∷ Address → Text Source #
Encode an address to Text. `decodeAddressBase58 (encodeAddressBase58 x) === Right x`
addrAttributesUnwrapped ∷ Address → AddrAttributes Source #
Get AddrAttributes from Address
makeAddress ∷ AddrSpendingData → AddrAttributes → Address Source #
Make an Address from spending data and attributes.
makeVerKeyAddress ∷ NetworkMagic → VerificationKey → Address Source #
A function for making an address from VerificationKey
Arguments
| ∷ NetworkMagic | |
| → HDAddressPayload | Derivation path |
| → VerificationKey | |
| → Address |
A function for making an HDW address
makeRedeemAddress ∷ NetworkMagic → RedeemVerificationKey → Address Source #
A function for making an address from RedeemVerificationKey
mkAttributes ∷ h → Attributes h Source #
decodeCrcProtected ∷ ∀ s a. DecCBOR a ⇒ Decoder s a Source #
Decodes a CBOR blob into a value of type a, checking the serialised CRC
corresponds to the computed one
encodeCrcProtected ∷ ToCBOR a ⇒ a → Encoding Source #
Encodes a value of type a, protecting it from accidental corruption by
protecting it with a CRC.
unsafeAddressHash ∷ EncCBOR a ⇒ a → AddressHash b Source #
newtype UnparsedFields Source #
Representation of unparsed fields in Attributes. Newtype wrapper is used for clear backward compatibility between previous representation (which was just a single ByteString) during transition from Store to CBOR.
Constructors
| UnparsedFields (Map Word8 ByteString) |
Instances
| ToJSON UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods toJSON ∷ UnparsedFields → Value Source # toEncoding ∷ UnparsedFields → Encoding Source # toJSONList ∷ [UnparsedFields] → Value Source # | |||||
| NFData UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods rnf ∷ UnparsedFields → () # | |||||
| Generic UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Associated Types
| |||||
| Show UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods showsPrec ∷ Int → UnparsedFields → ShowS # show ∷ UnparsedFields → String # showList ∷ [UnparsedFields] → ShowS # | |||||
| Eq UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods (==) ∷ UnparsedFields → UnparsedFields → Bool # (/=) ∷ UnparsedFields → UnparsedFields → Bool # | |||||
| Ord UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods compare ∷ UnparsedFields → UnparsedFields → Ordering # (<) ∷ UnparsedFields → UnparsedFields → Bool # (<=) ∷ UnparsedFields → UnparsedFields → Bool # (>) ∷ UnparsedFields → UnparsedFields → Bool # (>=) ∷ UnparsedFields → UnparsedFields → Bool # | |||||
| HeapWords UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes Methods | |||||
| NoThunks UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes | |||||
| type Rep UnparsedFields Source # | |||||
Defined in Cardano.Chain.Common.Attributes type Rep UnparsedFields = D1 ('MetaData "UnparsedFields" "Cardano.Chain.Common.Attributes" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "UnparsedFields" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Word8 ByteString)))) | |||||
attributesAreKnown ∷ Attributes a → Bool Source #
Check whether all data from Attributes is known, i. e. was successfully
parsed into some structured data
encodeKnownCborDataItem ∷ EncCBOR a ⇒ a → Encoding Source #
This is an alias for encodeNestedCbor.
This function is used to handle the case of a known type, but compatible
with the encoding used by encodeUnknownCborDataItem.
encodeUnknownCborDataItem ∷ LByteString → Encoding Source #
This is an alias for encodeNestedCborBytes, so all its details apply.
This function is used to handle the case of an unknown type, so it takes an opaque blob that is the representation of the value of the unknown type.
decodeKnownCborDataItem ∷ DecCBOR a ⇒ Decoder s a Source #
This is an alias for decodeNestedCbor.
This function is used to handle the case of a known type, but compatible
with the encoding used by decodeUnknownCborDataItem.
decodeUnknownCborDataItem ∷ Decoder s ByteString Source #
This is an alias for decodeNestedCborBytes, so all its details apply.
This function is used to handle the case of an unknown type, so it returns an opaque blob that is the representation of the value of the unknown type.
data CompactAddress Source #
A compact in-memory representation for an Address.
Convert using toCompactAddress and fromCompactAddress.
Instances
| FromCBOR CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact | |||||
| ToCBOR CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods toCBOR ∷ CompactAddress → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy CompactAddress → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [CompactAddress] → Size Source # | |||||
| DecCBOR CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact | |||||
| EncCBOR CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods | |||||
| NFData CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods rnf ∷ CompactAddress → () # | |||||
| Generic CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Associated Types
| |||||
| Show CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods showsPrec ∷ Int → CompactAddress → ShowS # show ∷ CompactAddress → String # showList ∷ [CompactAddress] → ShowS # | |||||
| Eq CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods (==) ∷ CompactAddress → CompactAddress → Bool # (/=) ∷ CompactAddress → CompactAddress → Bool # | |||||
| Ord CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods compare ∷ CompactAddress → CompactAddress → Ordering # (<) ∷ CompactAddress → CompactAddress → Bool # (<=) ∷ CompactAddress → CompactAddress → Bool # (>) ∷ CompactAddress → CompactAddress → Bool # (>=) ∷ CompactAddress → CompactAddress → Bool # | |||||
| HeapWords CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact Methods | |||||
| NoThunks CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact | |||||
| type Rep CompactAddress Source # | |||||
Defined in Cardano.Chain.Common.Compact type Rep CompactAddress = D1 ('MetaData "CompactAddress" "Cardano.Chain.Common.Compact" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "CompactAddress" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString))) | |||||
maxLovelaceVal ∷ Word64 Source #
Maximal possible value of Lovelace
mkLovelace ∷ Word64 → Either LovelaceError Lovelace Source #
Constructor for Lovelace returning LovelaceError when c exceeds
maxLovelaceVal
unsafeGetLovelace ∷ Lovelace → Word64 Source #
Unwraps Lovelace. It's called “unsafe” so that people wouldn't use it
willy-nilly if they want to sum lovelace or something. It's actually safe.
addLovelace ∷ Lovelace → Lovelace → Either LovelaceError Lovelace Source #
Addition of lovelace, returning LovelaceError in case of overflow
scaleLovelace ∷ Integral b ⇒ Lovelace → b → Either LovelaceError Lovelace Source #
Scale a Lovelace by an Integral factor, returning LovelaceError when
the result is too large
scaleLovelaceRational ∷ Lovelace → Rational → Lovelace Source #
Scale a Lovelace by a rational factor, rounding down.
scaleLovelaceRationalUp ∷ Lovelace → Rational → Lovelace Source #
Scale a Lovelace by a rational factor, rounding up.
divLovelace ∷ Integral b ⇒ Lovelace → b → Either LovelaceError Lovelace Source #
modLovelace ∷ Integral b ⇒ Lovelace → b → Either LovelaceError Lovelace Source #
rationalToLovelacePortion ∷ Rational → LovelacePortion Source #
Make a LovelacePortion from a Rational
which must be in the range [0..1].
lovelacePortionToRational ∷ LovelacePortion → Rational Source #
Turn a LovelacePortion into a Rational in the range [0..1].
newtype MerkleRoot a Source #
Data type for root of Merkle tree
Constructors
| MerkleRoot | |
Fields
| |
Instances
| ToJSON a ⇒ ToJSON (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods toJSON ∷ MerkleRoot a → Value Source # toEncoding ∷ MerkleRoot a → Encoding Source # toJSONList ∷ [MerkleRoot a] → Value Source # toEncodingList ∷ [MerkleRoot a] → Encoding Source # omitField ∷ MerkleRoot a → Bool Source # | |||||
| DecCBOR a ⇒ FromCBOR (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| (EncCBOR a, Typeable a) ⇒ ToCBOR (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods toCBOR ∷ MerkleRoot a → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (MerkleRoot a) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [MerkleRoot a] → Size Source # | |||||
| DecCBOR a ⇒ DecCBOR (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| EncCBOR a ⇒ EncCBOR (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods encCBOR ∷ MerkleRoot a → Encoding Source # | |||||
| NFData (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods rnf ∷ MerkleRoot a → () # | |||||
| Buildable (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods build ∷ MerkleRoot a → Builder Source # | |||||
| Generic (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Associated Types
| |||||
| Show (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods showsPrec ∷ Int → MerkleRoot a → ShowS # show ∷ MerkleRoot a → String # showList ∷ [MerkleRoot a] → ShowS # | |||||
| Eq (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| Ord (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods compare ∷ MerkleRoot a → MerkleRoot a → Ordering # (<) ∷ MerkleRoot a → MerkleRoot a → Bool # (<=) ∷ MerkleRoot a → MerkleRoot a → Bool # (>) ∷ MerkleRoot a → MerkleRoot a → Bool # (>=) ∷ MerkleRoot a → MerkleRoot a → Bool # max ∷ MerkleRoot a → MerkleRoot a → MerkleRoot a # min ∷ MerkleRoot a → MerkleRoot a → MerkleRoot a # | |||||
| NoThunks (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| type Rep (MerkleRoot a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle type Rep (MerkleRoot a) = D1 ('MetaData "MerkleRoot" "Cardano.Chain.Common.Merkle" "cardano-ledger-byron-1.3.0.0-inplace" 'True) (C1 ('MetaCons "MerkleRoot" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMerkleRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hash Raw)))) | |||||
data MerkleTree a Source #
Constructors
| MerkleEmpty | |
| MerkleTree !Word32 !(MerkleNode a) |
Instances
| Foldable MerkleTree Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods fold ∷ Monoid m ⇒ MerkleTree m → m # foldMap ∷ Monoid m ⇒ (a → m) → MerkleTree a → m # foldMap' ∷ Monoid m ⇒ (a → m) → MerkleTree a → m # foldr ∷ (a → b → b) → b → MerkleTree a → b # foldr' ∷ (a → b → b) → b → MerkleTree a → b # foldl ∷ (b → a → b) → b → MerkleTree a → b # foldl' ∷ (b → a → b) → b → MerkleTree a → b # foldr1 ∷ (a → a → a) → MerkleTree a → a # foldl1 ∷ (a → a → a) → MerkleTree a → a # toList ∷ MerkleTree a → [a] # null ∷ MerkleTree a → Bool # length ∷ MerkleTree a → Int # elem ∷ Eq a ⇒ a → MerkleTree a → Bool # maximum ∷ Ord a ⇒ MerkleTree a → a # minimum ∷ Ord a ⇒ MerkleTree a → a # sum ∷ Num a ⇒ MerkleTree a → a # product ∷ Num a ⇒ MerkleTree a → a # | |||||
| (DecCBOR a, EncCBOR a) ⇒ FromCBOR (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| (EncCBOR a, Typeable a) ⇒ ToCBOR (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods toCBOR ∷ MerkleTree a → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (MerkleTree a) → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [MerkleTree a] → Size Source # | |||||
| (DecCBOR a, EncCBOR a) ⇒ DecCBOR (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| EncCBOR a ⇒ EncCBOR (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods encCBOR ∷ MerkleTree a → Encoding Source # | |||||
| NFData a ⇒ NFData (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods rnf ∷ MerkleTree a → () # | |||||
| Generic (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Associated Types
| |||||
| Show a ⇒ Show (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods showsPrec ∷ Int → MerkleTree a → ShowS # show ∷ MerkleTree a → String # showList ∷ [MerkleTree a] → ShowS # | |||||
| Eq a ⇒ Eq (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| type Rep (MerkleTree a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle type Rep (MerkleTree a) = D1 ('MetaData "MerkleTree" "Cardano.Chain.Common.Merkle" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "MerkleEmpty" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "MerkleTree" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleNode a)))) | |||||
mtRoot ∷ MerkleTree a → MerkleRoot a Source #
Returns root of Merkle tree
mkMerkleTree ∷ EncCBOR a ⇒ [a] → MerkleTree a Source #
Smart constructor for MerkleTree
mkMerkleTreeDecoded ∷ [Annotated a ByteString] → MerkleTree a Source #
Reconstruct a MerkleTree from a decoded list of items
data MerkleNode a Source #
Constructors
| MerkleBranch !(MerkleRoot a) !(MerkleNode a) !(MerkleNode a) | MerkleBranch mRoot mLeft mRight |
| MerkleLeaf !(MerkleRoot a) a | MerkleLeaf mRoot mVal |
Instances
| Foldable MerkleNode Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods fold ∷ Monoid m ⇒ MerkleNode m → m # foldMap ∷ Monoid m ⇒ (a → m) → MerkleNode a → m # foldMap' ∷ Monoid m ⇒ (a → m) → MerkleNode a → m # foldr ∷ (a → b → b) → b → MerkleNode a → b # foldr' ∷ (a → b → b) → b → MerkleNode a → b # foldl ∷ (b → a → b) → b → MerkleNode a → b # foldl' ∷ (b → a → b) → b → MerkleNode a → b # foldr1 ∷ (a → a → a) → MerkleNode a → a # foldl1 ∷ (a → a → a) → MerkleNode a → a # toList ∷ MerkleNode a → [a] # null ∷ MerkleNode a → Bool # length ∷ MerkleNode a → Int # elem ∷ Eq a ⇒ a → MerkleNode a → Bool # maximum ∷ Ord a ⇒ MerkleNode a → a # minimum ∷ Ord a ⇒ MerkleNode a → a # sum ∷ Num a ⇒ MerkleNode a → a # product ∷ Num a ⇒ MerkleNode a → a # | |||||
| NFData a ⇒ NFData (MerkleNode a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods rnf ∷ MerkleNode a → () # | |||||
| Generic (MerkleNode a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Associated Types
| |||||
| Show a ⇒ Show (MerkleNode a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle Methods showsPrec ∷ Int → MerkleNode a → ShowS # show ∷ MerkleNode a → String # showList ∷ [MerkleNode a] → ShowS # | |||||
| Eq a ⇒ Eq (MerkleNode a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle | |||||
| type Rep (MerkleNode a) Source # | |||||
Defined in Cardano.Chain.Common.Merkle type Rep (MerkleNode a) = D1 ('MetaData "MerkleNode" "Cardano.Chain.Common.Merkle" "cardano-ledger-byron-1.3.0.0-inplace" 'False) (C1 ('MetaCons "MerkleBranch" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleRoot a)) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleNode a)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleNode a)))) :+: C1 ('MetaCons "MerkleLeaf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (MerkleRoot a)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
mkBranch ∷ MerkleNode a → MerkleNode a → MerkleNode a Source #
mkLeaf ∷ EncCBOR a ⇒ a → MerkleNode a Source #
mkLeafDecoded ∷ Annotated a ByteString → MerkleNode a Source #