| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Pool.Parameters
Description
Typed stake-pool registration parameters. Validate hashes, relays, metadata and margin once, then assemble or update the record without effects.
parameters { metadata = Nothing } removes an optional metadata reference.
Synopsis
- data PoolParameters = PoolParameters {
- operator :: !(KeyHash StakePool)
- vrfKeyHash :: !VrfKeyHash
- blsKey :: !(Maybe BlsKey)
- pledge :: !Word64
- cost :: !Word64
- margin :: !UnitInterval
- rewardAccount :: !RewardAddress
- owners :: !(Set (KeyHash Stake))
- relays :: ![Relay]
- metadata :: !(Maybe Metadata)
- data VrfKeyHash
- vrfKeyHashFromBytes :: ByteString -> Either Error VrfKeyHash
- vrfKeyHashBytes :: VrfKeyHash -> ByteString
- encodeCbor :: PoolParameters -> ByteString
- encodeCborWith :: SetEncoding -> PoolParameters -> ByteString
- decodeCbor :: ByteString -> Either Error PoolParameters
Documentation
data PoolParameters Source #
Registration parameters. Assembly and record updates are total because constrained fields are validated values. Equality is semantic (numeric margin, unordered owners, ordered relays); Show is diagnostic. No ledger-era admission, minimum cost, pledge funding, or BLS proof verification is implied.
Constructors
| PoolParameters | |
Fields
| |
Instances
| Show PoolParameters Source # | |
Defined in Cometa.Internal.Pool Methods showsPrec :: Int -> PoolParameters -> ShowS # show :: PoolParameters -> String # showList :: [PoolParameters] -> ShowS # | |
| Eq PoolParameters Source # | |
Defined in Cometa.Internal.Pool Methods (==) :: PoolParameters -> PoolParameters -> Bool # (/=) :: PoolParameters -> PoolParameters -> Bool # | |
| Ord PoolParameters Source # | |
Defined in Cometa.Internal.Pool Methods compare :: PoolParameters -> PoolParameters -> Ordering # (<) :: PoolParameters -> PoolParameters -> Bool # (<=) :: PoolParameters -> PoolParameters -> Bool # (>) :: PoolParameters -> PoolParameters -> Bool # (>=) :: PoolParameters -> PoolParameters -> Bool # max :: PoolParameters -> PoolParameters -> PoolParameters # min :: PoolParameters -> PoolParameters -> PoolParameters # | |
data VrfKeyHash Source #
Exact 32-byte VRF verification-key hash. Importing does not verify a key.
Instances
| Show VrfKeyHash Source # | |
Defined in Cometa.Internal.Pool Methods showsPrec :: Int -> VrfKeyHash -> ShowS # show :: VrfKeyHash -> String # showList :: [VrfKeyHash] -> ShowS # | |
| Eq VrfKeyHash Source # | |
Defined in Cometa.Internal.Pool | |
| Ord VrfKeyHash Source # | |
Defined in Cometa.Internal.Pool Methods compare :: VrfKeyHash -> VrfKeyHash -> Ordering # (<) :: VrfKeyHash -> VrfKeyHash -> Bool # (<=) :: VrfKeyHash -> VrfKeyHash -> Bool # (>) :: VrfKeyHash -> VrfKeyHash -> Bool # (>=) :: VrfKeyHash -> VrfKeyHash -> Bool # max :: VrfKeyHash -> VrfKeyHash -> VrfKeyHash # min :: VrfKeyHash -> VrfKeyHash -> VrfKeyHash # | |
vrfKeyHashFromBytes :: ByteString -> Either Error VrfKeyHash Source #
Import exactly 32 VRF digest bytes without hashing; other lengths return
InvalidPoolHashLength with the actual byte count.
vrfKeyHashBytes :: VrfKeyHash -> ByteString Source #
Exact VRF digest bytes.
encodeCbor :: PoolParameters -> ByteString Source #
Fresh definite CBOR array containing the nine pool fields, or ten when a BLS key is present after the VRF hash. Owners are sorted and tagged 258; relay order and duplicates remain. Re-encoding semantic data may change transaction identity.
encodeCborWith :: SetEncoding -> PoolParameters -> ByteString Source #
Fresh definite parameters with the requested tag on the sorted owner set. Other fields use their usual encoding. This re-encodes semantic data; it is not an edit to an imported transaction's exact bytes.
decodeCbor :: ByteString -> Either Error PoolParameters Source #
Decode the complete array. Definite or indefinite arrays and
nonminimal unsigned integers are accepted. All field bounds, arities, UTF-8
and trailing bytes are checked; violations return
InvalidPoolCbor. The original encoding is not retained.
Duplicate owners are rejected; untagged owner sets are accepted.
A null BLS placeholder is accepted and omitted on re-encoding.