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

Codec.CBOR.Extras

Synopsis

Documentation

newtype SerialiseViaFlat a Source #

Newtype to provide Serialise instances for types with a Flat instance that just encodes the flat-serialized value as a CBOR bytestring

Constructors

SerialiseViaFlat a 

Instances

Instances details
Flat a => Serialise (SerialiseViaFlat a) Source # 
Instance details

Defined in Codec.CBOR.Extras

Methods

encode :: SerialiseViaFlat a -> Encoding

decode :: Decoder s (SerialiseViaFlat a)

encodeList :: [SerialiseViaFlat a] -> Encoding

decodeList :: Decoder s [SerialiseViaFlat a]

decodeViaFlat :: Get a -> Decoder s a Source #

data DeserialiseFailureInfo Source #

Similar to DeserialiseFailure, with the difference that plain string reason messages are turned into the datatype: DeserialiseFailureReason.

Constructors

DeserialiseFailureInfo 

Fields

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

A failure reason we (plutus) are not aware of, use whatever message that cborg returns.

readDeserialiseFailureInfo :: DeserialiseFailure -> DeserialiseFailureInfo Source #

The errors returned by cborg are plain strings (untyped). With this function we try to map onto datatypes, those cborg error messages that we are interested in.

Currently we are only interested in error messages returned by the decodeBytes decoder; see scriptCBORDecoder.