| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Naming.Datum
Description
The four-field naming datum codec, transcribed exactly from the
accepted epic-15 contract's simulator/naming-wire.mjs (v0.2.0, commit
13231f58833b8feb57f4b0f9b1117bfcfba0c07d, asset sha256
acbabdf54a271251bd73bf9d84ab2c901107045a7dd77d28a391f22cdd53b0e5).
The datum has exactly four fields, in this order: controlAddress;
paymentDestination as an option (constr(0,[]) none,
constr(1,[bytes]) some); the nextControlCommitment 32-byte digest;
and the retirementQuorum. There is no fifth field and none may be
added. Where this module and the reference disagree, the reference is
right and this module is wrong.
Synopsis
- data PaymentDestination
- data RetirementQuorum = RetirementQuorum {
- quorumMembers :: [ByteString]
- quorumThreshold :: Integer
- data NamingDatum = NamingDatum {}
- data DatumAttachment
- = InlineDatum WireData
- | AttachedDatumHash ByteString
- data DatumShape = DatumShape {
- shapeArity :: Int
- shapeInnerIndex :: Int
- shapeOuterIndex :: Int
- encodeNamingDatum :: NamingDatum -> WireData
- decodeNamingDatum :: WireData -> Maybe NamingDatum
- namingDatumShape :: WireData -> Maybe DatumShape
- serialiseNamingDatum :: NamingDatum -> Maybe ByteString
- deserialiseNamingDatum :: ByteString -> Maybe NamingDatum
- extractNamingDatum :: DatumAttachment -> Maybe NamingDatum
Documentation
data PaymentDestination Source #
The payment destination option: none is constr(0,[]), some is
constr(1,[bytes]).
Constructors
| NoDestination | |
| SomeDestination Address |
Instances
| Show PaymentDestination Source # | |
Defined in Naming.Datum Methods showsPrec :: Int -> PaymentDestination -> ShowS Source # show :: PaymentDestination -> String Source # showList :: [PaymentDestination] -> ShowS Source # | |
| Eq PaymentDestination Source # | |
Defined in Naming.Datum Methods (==) :: PaymentDestination -> PaymentDestination -> Bool Source # (/=) :: PaymentDestination -> PaymentDestination -> Bool Source # | |
data RetirementQuorum Source #
The retirement quorum: distinct 28-byte member key hashes and a threshold between 1 and the member count.
Constructors
| RetirementQuorum | |
Fields
| |
Instances
| Show RetirementQuorum Source # | |
Defined in Naming.Datum Methods showsPrec :: Int -> RetirementQuorum -> ShowS Source # show :: RetirementQuorum -> String Source # showList :: [RetirementQuorum] -> ShowS Source # | |
| Eq RetirementQuorum Source # | |
Defined in Naming.Datum Methods (==) :: RetirementQuorum -> RetirementQuorum -> Bool Source # (/=) :: RetirementQuorum -> RetirementQuorum -> Bool Source # | |
data NamingDatum Source #
The four-field naming datum. The field names are the contract's own; the datum has no fifth field.
Constructors
| NamingDatum | |
Fields
| |
Instances
| Show NamingDatum Source # | |
Defined in Naming.Datum Methods showsPrec :: Int -> NamingDatum -> ShowS Source # show :: NamingDatum -> String Source # showList :: [NamingDatum] -> ShowS Source # | |
| Eq NamingDatum Source # | |
Defined in Naming.Datum Methods (==) :: NamingDatum -> NamingDatum -> Bool Source # (/=) :: NamingDatum -> NamingDatum -> Bool Source # | |
data DatumAttachment Source #
How a datum is attached to an output: inline, or as a hash. The contract accepts only inline.
Constructors
| InlineDatum WireData | |
| AttachedDatumHash ByteString |
Instances
| Show DatumAttachment Source # | |
Defined in Naming.Datum Methods showsPrec :: Int -> DatumAttachment -> ShowS Source # show :: DatumAttachment -> String Source # showList :: [DatumAttachment] -> ShowS Source # | |
| Eq DatumAttachment Source # | |
Defined in Naming.Datum Methods (==) :: DatumAttachment -> DatumAttachment -> Bool Source # (/=) :: DatumAttachment -> DatumAttachment -> Bool Source # | |
data DatumShape Source #
The structural shape the contract records for the canonical datum:
{arity: 4, innerIndex: 0, outerIndex: 0}.
Constructors
| DatumShape | |
Fields
| |
Instances
| Show DatumShape Source # | |
Defined in Naming.Datum Methods showsPrec :: Int -> DatumShape -> ShowS Source # show :: DatumShape -> String Source # showList :: [DatumShape] -> ShowS Source # | |
| Eq DatumShape Source # | |
Defined in Naming.Datum Methods (==) :: DatumShape -> DatumShape -> Bool Source # (/=) :: DatumShape -> DatumShape -> Bool Source # | |
encodeNamingDatum :: NamingDatum -> WireData Source #
Exact mirror of the contract's encodeNamingDatum.
decodeNamingDatum :: WireData -> Maybe NamingDatum Source #
Exact mirror of the contract's decodeNamingDatum: outer
constr(0) of arity 1 wrapping an inner constr(0) of arity 4, then
each field decoded and the whole checked with the contract's
wellFormedFixture. Anything else is refused.
namingDatumShape :: WireData -> Maybe DatumShape Source #
Exact mirror of the contract's namingDatumShape.
serialiseNamingDatum :: NamingDatum -> Maybe ByteString Source #
Exact mirror of the contract's serialiseNamingDatum.
deserialiseNamingDatum :: ByteString -> Maybe NamingDatum Source #
Exact mirror of the contract's deserialiseNamingDatum.
extractNamingDatum :: DatumAttachment -> Maybe NamingDatum Source #
Exact mirror of the contract's extractNamingDatum: only an inline
datum is decoded; an attached datum hash is refused.