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

PlutusLedgerApi.Common.SerialisedScript

Synopsis

Documentation

type SerialisedScript = ShortByteString Source #

Scripts to the ledger are serialised bytestrings.

serialiseCompiledCode ∷ ∀ a. CompiledCode a → SerialisedScript Source #

Turns a program which was compiled using the 'PlutusTx' toolchain into a binary format that is understood by the network and can be stored on-chain.

serialiseUPLCProgram DeBruijn DefaultUni DefaultFun () → SerialisedScript Source #

Turns a program's AST (most likely manually constructed) into a binary format that is understood by the network and can be stored on-chain.

uncheckedDeserialiseUPLCSerialisedScriptProgram DeBruijn DefaultUni DefaultFun () Source #

Deserialises a SerialisedScript back into an AST. Does *not* do ledger-language-version-specific checks like for allowable builtins.

scriptCBORDecoderPlutusLedgerLanguageMajorProtocolVersionDecoder s ScriptNamedDeBruijn Source #

This decoder decodes the names directly into NamedDeBruijns rather than DeBruijns. This is needed because the CEK machine expects NameDeBruijns, but there are obviously no names in the serialised form of a Script. Rather than traversing the term and inserting fake names after deserialising, this lets us do at the same time as deserialising.

newtype ScriptNamedDeBruijn Source #

A script with named de-bruijn indices.

data ScriptForEvaluation Source #

A Plutus script ready to be evaluated on-chain, via evaluateScriptRestricting.

Instances

Instances details
Generic ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Associated Types

type Rep ScriptForEvaluationTypeType Source #

Show ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

NFData ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Methods

rnfScriptForEvaluation → () Source #

Eq ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

NoThunks ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

type Rep ScriptForEvaluation Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

type Rep ScriptForEvaluation = D1 ('MetaData "ScriptForEvaluation" "PlutusLedgerApi.Common.SerialisedScript" "plutus-ledger-api-1.38.0.0-inplace" 'False) (C1 ('MetaCons "UnsafeScriptForEvaluation" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SerialisedScript) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ScriptNamedDeBruijn)))

data ScriptDecodeError Source #

An error that occurred during script deserialization.

Constructors

CBORDeserialiseError !DeserialiseFailureInfo

an error from the underlying CBOR/serialise library

RemainderError !ByteString

Script was successfully parsed, but more (runaway) bytes encountered after script's position

LedgerLanguageNotAvailableError

the plutus version of the given script is not enabled yet

Fields

PlutusCoreLanguageNotAvailableError 

Fields

Instances

Instances details
Exception ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Show ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Eq ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

AsScriptDecodeError ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

Pretty ScriptDecodeError Source # 
Instance details

Defined in PlutusLedgerApi.Common.SerialisedScript

class AsScriptDecodeError r where Source #

Minimal complete definition

_ScriptDecodeError

data DeserialiseFailureReason Source #

The reason of the cbor failure as a datatype, not as a plain string.

Constructors

EndOfInput

Not enough input provided

ExpectedBytes

The bytes inside the input are malformed.

OtherReason String

This is either a cbor failure that we (plutus) are not aware of, or an underlying flat failure. We use whatever message cborg or flat returns.

deserialiseScript Source #

Arguments

∷ ∀ m. MonadError ScriptDecodeError m 
PlutusLedgerLanguage

the Plutus ledger language of the script.

MajorProtocolVersion

which major protocol version the script was submitted in.

SerialisedScript

the script to deserialise.

→ m ScriptForEvaluation 

The deserialization from a serialised script into a ScriptForEvaluation, ready to be evaluated on-chain. Called inside phase-1 validation (i.e., deserialisation error is a phase-1 error).