plutus-ledger-api-1.30.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusLedgerApi.Common.Versions

Description

This module contains the code for handling the various kinds of version that we care about:

  • Protocol versions
  • Plutus ledger languages
  • Plutus Core language versions
Synopsis

Cardano Protocol versions

newtype MajorProtocolVersion Source #

This represents the major component of the Cardano protocol version. The ledger can only supply the major component of the protocol version, not the minor component, and Plutus should only need to care about the major component anyway. This relies on careful understanding between us and the ledger as to what this means.

Instances

Instances details
Generic MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Associated Types

type Rep MajorProtocolVersion :: Type -> Type Source #

Show MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Eq MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Ord MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Pretty MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

Methods

pretty :: MajorProtocolVersion -> Doc ann

prettyList :: [MajorProtocolVersion] -> Doc ann

Serialise MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

type Rep MajorProtocolVersion Source # 
Instance details

Defined in PlutusLedgerApi.Common.ProtocolVersions

type Rep MajorProtocolVersion = D1 ('MetaData "MajorProtocolVersion" "PlutusLedgerApi.Common.ProtocolVersions" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" 'True) (C1 ('MetaCons "MajorProtocolVersion" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMajorProtocolVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

Protocol Version aliases

shelleyPV :: MajorProtocolVersion Source #

Shelley era was introduced in protocol version 2.0

allegraPV :: MajorProtocolVersion Source #

Allegra era was introduced in protocol version 3.0

maryPV :: MajorProtocolVersion Source #

Mary era was introduced in protocol version 4.0

alonzoPV :: MajorProtocolVersion Source #

Alonzo era was introduced in protocol version 5.0

vasilPV :: MajorProtocolVersion Source #

Vasil era was introduced in protocol version 7.0

valentinePV :: MajorProtocolVersion Source #

Protocol version 8.0 was the Valentine intra-era HF

conwayPV :: MajorProtocolVersion Source #

Conway era was introduced in protocol version 9.0

conwayPlus1PV :: MajorProtocolVersion Source #

The next HF after Conway. It doesn't yet have a name, and it's not yet known whether it will be an intra-era HF or introduce a new era.

knownPVs :: Set MajorProtocolVersion Source #

The set of protocol versions that are "known", i.e. that have been released and have actual differences associated with them.

futurePV :: MajorProtocolVersion Source #

This is a placeholder for when we don't yet know what protocol version will be used for something. It's a very high protocol version that should never appear in reality. New builtins should always be given this protocol version until they've been finalised.

We should not assign names to future protocol versions until it's confirmed that they are correct, otherwise we could accidentally associate something with the wrong protocol version.

Plutus ledger languages

data PlutusLedgerLanguage Source #

The Plutus ledger language. These are entirely different script languages from the ledger's perspective, which on our side are interpreted in very similar ways.

It is a simple enumerated datatype (there is no major and minor components as in protocol version) and the ordering of constructors is essential for deriving Enum,Ord,Bounded.

IMPORTANT: this is different from the Plutus Core language version, Version

Constructors

PlutusV1

introduced in shelley era

PlutusV2

introduced in vasil era

PlutusV3

not yet enabled

Instances

Instances details
Bounded PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Enum PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Generic PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Associated Types

type Rep PlutusLedgerLanguage :: Type -> Type Source #

Show PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

NFData PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Eq PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Ord PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

NoThunks PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Methods

noThunks :: Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> PlutusLedgerLanguage -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy PlutusLedgerLanguage -> String

Pretty PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Methods

pretty :: PlutusLedgerLanguage -> Doc ann

prettyList :: [PlutusLedgerLanguage] -> Doc ann

type Rep PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

type Rep PlutusLedgerLanguage = D1 ('MetaData "PlutusLedgerLanguage" "PlutusLedgerApi.Common.Versions" "plutus-ledger-api-1.30.0.0-AeqdHlc23KHCP4Mgl3sbFx" 'False) (C1 ('MetaCons "PlutusV1" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PlutusV2" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PlutusV3" 'PrefixI 'False) (U1 :: Type -> Type)))

Plutus Core language versions

data Version #

Instances

Instances details
Generic Version 
Instance details

Defined in PlutusCore.Version

Associated Types

type Rep Version :: Type -> Type Source #

Show Version 
Instance details

Defined in PlutusCore.Version

NFData Version 
Instance details

Defined in PlutusCore.Version

Methods

rnf :: Version -> () Source #

Eq Version 
Instance details

Defined in PlutusCore.Version

Ord Version 
Instance details

Defined in PlutusCore.Version

Hashable Version 
Instance details

Defined in PlutusCore.Version

Methods

hashWithSalt :: Int -> Version -> Int

hash :: Version -> Int

Pretty Version 
Instance details

Defined in PlutusCore.Version

Methods

pretty :: Version -> Doc ann

prettyList :: [Version] -> Doc ann

type Rep Version 
Instance details

Defined in PlutusCore.Version

type Rep Version = D1 ('MetaData "Version" "PlutusCore.Version" "plutus-core-1.30.0.0-Brmv4OxgBsXE3Q8WMR2zgg" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "_versionMajor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "_versionMinor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "_versionPatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural))))

Version-testing functions

ledgerLanguageIntroducedIn :: PlutusLedgerLanguage -> MajorProtocolVersion Source #

Query the protocol version that a specific Plutus ledger language was first introduced in.

ledgerLanguagesAvailableIn :: MajorProtocolVersion -> Set PlutusLedgerLanguage Source #

Which Plutus language versions are available in the given MajorProtocolVersion?

See Note [New builtins/language versions and protocol versions]

plcVersionsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set Version) Source #

A map indicating which Plutus Core versions were introduced in which MajorProtocolVersion and PlutusLedgerLanguage. Each version should appear at most once.

This must be updated when new versions are added. See Note [New builtins/language versions and protocol versions]

plcVersionsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set Version Source #

Which Plutus Core language versions are available in the given PlutusLedgerLanguage and MajorProtocolVersion?

See Note [New builtins/language versions and protocol versions]

builtinsIntroducedIn :: Map (PlutusLedgerLanguage, MajorProtocolVersion) (Set DefaultFun) Source #

A map indicating which builtin functions were introduced in which MajorProtocolVersion.

This must be updated when new builtins are added. See Note [New builtins/language versions and protocol versions]

builtinsAvailableIn :: PlutusLedgerLanguage -> MajorProtocolVersion -> Set DefaultFun Source #

Which builtin functions are available in the given given PlutusLedgerLanguage and MajorProtocolVersion?

See Note [New builtins/language versions and protocol versions]