Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data PlutusVersion
- data SingPlutusVersion (v ∷ PlutusVersion) where
- class SingPlutusVersionI (v ∷ PlutusVersion) where
- fromSingPlutusVersion ∷ SingPlutusVersion v → PlutusVersion
- type family PlutusVersionToApi (v ∷ PlutusVersion) ∷ Type where ...
- singPlutusVersionToApi ∷ SingPlutusVersion v → PlutusScriptVersion (PlutusVersionToApi v)
- type VersionIsGreaterOrEqual (v ∷ PlutusVersion) (u ∷ PlutusVersion) = GreaterOrEqual (v `CmpPlutusVersion` u) ~ 'True
- type VersionIsGreater (v ∷ PlutusVersion) (u ∷ PlutusVersion) = (v `CmpPlutusVersion` u) ~ 'GT
- type family CmpPlutusVersion (v ∷ PlutusVersion) (u ∷ PlutusVersion) ∷ Ordering where ...
Plutus version
data PlutusVersion #
Instances
data SingPlutusVersion (v ∷ PlutusVersion) where #
SingPlutusV1 ∷ SingPlutusVersion 'PlutusV1 | |
SingPlutusV2 ∷ SingPlutusVersion 'PlutusV2 | |
SingPlutusV3 ∷ SingPlutusVersion 'PlutusV3 |
Instances
GCompare SingPlutusVersion # | |
Defined in GeniusYield.Types.PlutusVersion gcompare ∷ ∀ (a ∷ k) (b ∷ k). SingPlutusVersion a → SingPlutusVersion b → GOrdering a b # | |
GEq SingPlutusVersion # | |
Defined in GeniusYield.Types.PlutusVersion geq ∷ ∀ (a ∷ k) (b ∷ k). SingPlutusVersion a → SingPlutusVersion b → Maybe (a :~: b) # |
class SingPlutusVersionI (v ∷ PlutusVersion) where #
Instances
type family PlutusVersionToApi (v ∷ PlutusVersion) ∷ Type where ... #
type VersionIsGreaterOrEqual (v ∷ PlutusVersion) (u ∷ PlutusVersion) = GreaterOrEqual (v `CmpPlutusVersion` u) ~ 'True #
Constraint that v >= u
.
If transaction is making use of V2 features (such as reference inputs) then as these cannot be represented in script context of V1 scripts, we need to ensure that the involved script version is at least V2. Likewise for other versions.
type VersionIsGreater (v ∷ PlutusVersion) (u ∷ PlutusVersion) = (v `CmpPlutusVersion` u) ~ 'GT #
Constraint that v > u
.
type family CmpPlutusVersion (v ∷ PlutusVersion) (u ∷ PlutusVersion) ∷ Ordering where ... #
Type family to compare PlutusVersion
s
CmpPlutusVersion 'PlutusV1 'PlutusV1 = 'EQ | |
CmpPlutusVersion 'PlutusV1 _ = 'LT | |
CmpPlutusVersion 'PlutusV2 'PlutusV1 = 'GT | |
CmpPlutusVersion 'PlutusV2 'PlutusV2 = 'EQ | |
CmpPlutusVersion 'PlutusV2 _ = 'LT | |
CmpPlutusVersion 'PlutusV3 'PlutusV1 = 'GT | |
CmpPlutusVersion 'PlutusV3 'PlutusV2 = 'GT | |
CmpPlutusVersion 'PlutusV3 'PlutusV3 = 'EQ |