Skip to content

Change internal type of protocol parameters to CompactForm Coin #5146

Open
@lehins

Description

@lehins

There are a number of parameters that use Coin as its type.
It will be simpler and safer (will remove the need to use of partial functions) for implementation to switch to using CompactForm Coin.

That being said, CompactForm Coin is an internal type to the ledger and we should not put the burden on the downstream users. Therefore the type in protocol parameters should change to CompactForm Coin, while all the lenses should still use Coin.
In order for those to be useful for us, we need extra lenses, eg:

  • ppDRepDepositL :: Lens' (PParams era) Coin
  • ppDRepCompactDepositL :: Lens' (PParams era) (CompactForm Coin)
  • ppuDRepDepositL :: Lens' (PParamsUpdate era) (StrictMaybe Coin)
  • ppuDRepCompactDepositL :: Lens' (PParamsUpdate era) (StrictMaybe (CompactForm Coin))
  • Rename hkd variant: hkdDRepCompactDepositL :: HKDFunctor f => Lens' (PParamsHKD f era) (HKD f (CompactForm Coin))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions