Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export EraBoundTime, EpochSlotLength and change cost model … #70

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Maestro/Types/V1/General.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ module Maestro.Types.V1.General
, EraSummary (..)
, EraParameters (..)
, EraBound (..)
, EraBoundTime (..)
, EpochSlotLength (..)
-- * Types for @/protocol-parameters@ endpoint
, AsAda (..)
, AsLovelace (..)
, AsBytes (..)
, ProtocolVersion (..)
, MemoryCpuWith (..)
, CostModel (..)
Expand All @@ -26,6 +31,7 @@ module Maestro.Types.V1.General
import Control.Monad (unless, when)
import Data.Aeson (FromJSON (parseJSON), toEncoding,
toJSON, withText)
import Data.Int (Int64)
import Data.Ratio (denominator, numerator, (%))
import Data.Text (Text)
import qualified Data.Text as Txt
Expand Down Expand Up @@ -147,7 +153,7 @@ newtype AsBytes = AsBytes
-- | Represents lovelaces.
newtype AsAda = AsAda
{ asAdaAda :: AsLovelace
-- ^ See `Ada`.
-- ^ See `AsLovelace`.
}
deriving stock (Eq, Show, Generic)
deriving (FromJSON, ToJSON) via CustomJSON '[FieldLabelModifier '[StripPrefix "asAda", LowerFirst]] AsAda
Expand All @@ -171,7 +177,7 @@ data MemoryCpuWith i = MemoryCpuWith
deriving (FromJSON, ToJSON) via CustomJSON '[FieldLabelModifier '[StripPrefix "memoryCpuWith", LowerFirst]] (MemoryCpuWith i)

-- | A cost model is a vector of coefficients that are used to compute the execution units required to execute a script. Its specifics depend on specific versions of the Plutus interpreter it is used with.
newtype CostModel = CostModel [Natural]
newtype CostModel = CostModel [Int64]
deriving (Eq, Show)
deriving newtype (ToJSON, FromJSON)

Expand Down