plutus-core-1.34.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Codec.Extras.SerialiseViaFlat

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 

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

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.

readDeserialiseFailureInfoDeserialiseFailureDeserialiseFailureInfo 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.