morley-0.7.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Lorentz.EntryPoints.Impl

Description

Common implementations of entrypoints.

Synopsis

Documentation

data EpdPlain Source #

Implementation of ParameterHasEntryPoints which fits for case when your contract exposes multiple entrypoints via having sum type as its parameter.

In particular, each constructor would produce a homonymous entrypoint with argument type equal to type of constructor field (each constructor should have only one field). Constructor called Default will designate the default entrypoint.

Instances
PlainEntryPointsC EpdPlain cp => EntryPointsDerivation EpdPlain cp Source # 
Instance details

Defined in Lorentz.EntryPoints.Impl

type EpdAllEntryPoints EpdPlain cp Source # 
Instance details

Defined in Lorentz.EntryPoints.Impl

type EpdLookupEntryPoint EpdPlain cp Source # 
Instance details

Defined in Lorentz.EntryPoints.Impl

data EpdRecursive Source #

Extension of EpdPlain on parameters being defined as several nested datatypes.

In particular, this will traverse sum types recursively, stopping at Michelson primitives (like Natural) and constructors with number of fields different from one.

It does not assign names to intermediate nodes of Or tree, only to the very leaves.

If some entrypoint arguments have custom IsoValue instance, this derivation way will not work. As a workaround, you can wrap your argument into some primitive (e.g. :!).

data EpdDelegate Source #

Extension of EpdPlain on parameters being defined as several nested datatypes.

In particular, it will traverse the immediate sum type, and require another ParameterHasEntryPoints for the inner complex datatypes. Only those inner types are considered which are the only fields in their respective constructors. Inner types should not themselves declare default entrypoint, we enforce this for better modularity. Each top-level constructor will be treated as entrypoint even if it contains a complex datatype within, in such case that would be an entrypoint corresponding to intermediate node in or tree.

Comparing to EpdRecursive this gives you more control over where and how entrypoints will be derived.