plutus-ledger-api-1.34.1.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

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 PlutusLedgerLanguageTypeType Source #

Show PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

NFData PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Methods

rnfPlutusLedgerLanguage → () Source #

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

Pretty PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

Serialise PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

type Rep PlutusLedgerLanguage Source # 
Instance details

Defined in PlutusLedgerApi.Common.Versions

type Rep PlutusLedgerLanguage = D1 ('MetaData "PlutusLedgerLanguage" "PlutusLedgerApi.Common.Versions" "plutus-ledger-api-1.34.1.0-inplace" 'False) (C1 ('MetaCons "PlutusV1" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "PlutusV2" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "PlutusV3" 'PrefixI 'False) (U1TypeType)))

Plutus Core language versions

data Version Source #

The version of Plutus Core used by this program.

The intention is to convey different levels of backwards compatibility for existing scripts: - Major version changes are backwards-incompatible - Minor version changes are backwards-compatible - Patch version changes should be entirely invisible (and we will likely not use this level)

The version used should be changed only when the language itself changes. For example, adding a new kind of term to the language would require a minor version bump; removing a kind of term would require a major version bump.

Similarly, changing the semantics of the language will require a version bump, typically a major one. This is the main reason why the version is actually tracked in the AST: we can have two language versions with identical ASTs but different semantics, so we need to track the version explicitly.

Compatibility is about compatibility for specific scripts, not about e.g. tools which consume scripts. Adding a new kind of term does not change how existing scripts behave, but does change what tools would need to do to process scripts.

Instances

Instances details
Generic Version 
Instance details

Defined in PlutusCore.Version

Associated Types

type Rep VersionTypeType Source #

Methods

fromVersionRep Version x Source #

toRep Version x → Version Source #

Show Version 
Instance details

Defined in PlutusCore.Version

NFData Version 
Instance details

Defined in PlutusCore.Version

Methods

rnfVersion → () Source #

Eq Version 
Instance details

Defined in PlutusCore.Version

Methods

(==)VersionVersionBool Source #

(/=)VersionVersionBool Source #

Ord Version 
Instance details

Defined in PlutusCore.Version

Hashable Version 
Instance details

Defined in PlutusCore.Version

Methods

hashWithSaltIntVersionInt Source #

hashVersionInt Source #

Pretty Version 
Instance details

Defined in PlutusCore.Version

Methods

prettyVersionDoc ann Source #

prettyList ∷ [Version] → Doc ann Source #

type Rep Version 
Instance details

Defined in PlutusCore.Version

type Rep Version = D1 ('MetaData "Version" "PlutusCore.Version" "plutus-core-1.34.1.0-inplace" '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

ledgerLanguageIntroducedInPlutusLedgerLanguageMajorProtocolVersion Source #

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

ledgerLanguagesAvailableInMajorProtocolVersionSet PlutusLedgerLanguage Source #

Which Plutus language versions are available in the given MajorProtocolVersion?

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

plcVersionsIntroducedInMap (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]

plcVersionsAvailableInPlutusLedgerLanguageMajorProtocolVersionSet Version Source #

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

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

builtinsIntroducedInMap (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]

builtinsAvailableInPlutusLedgerLanguageMajorProtocolVersionSet DefaultFun Source #

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

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