cleveland-0.3.0: Testing framework for Morley.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cleveland.Lorentz.Ticketer

Description

Contract that facilitates tickets emission.

Synopsis

Documentation

ticketerContract' :: (NiceComparable td, NiceParameterFull (View_ (payload, (Natural, td)) callbackArg), NiceParameter callbackArg) => ([payload, Ticket td] :-> '[callbackArg]) -> Contract (View_ (payload, (Natural, td)) callbackArg) () () Source #

A contract that emits the desired tickets.

It has one entrypoint - a View_ where you supply ticket data and tokens amount, and a callback contract that should receive an argument with the ticket.

You also have to supply a lambda that attaches a payload to the ticket, since tickets are usually attached to some other data.

ticketerContract :: (NiceComparable td, callbackArg ~ (payload, Ticket td), NiceParameterFull (View_ (payload, (Natural, td)) callbackArg), NiceParameter callbackArg) => Contract (View_ (payload, (Natural, td)) callbackArg) () () Source #

A simpler version of 'ticketerContract'' where the target contract will always receive a pair of payload and ticket.

callViaTicketer Source #

Arguments

:: forall targetArg payload td targetAddr ticketerParam ticketerAddr m. (HasCallStack, MonadTransfer m, ticketerParam ~ View_ (payload, (Natural, td)) targetArg, ToL1TAddress ticketerParam () ticketerAddr, ToContractRef targetArg targetAddr, NiceParameterFull ticketerParam) 
=> ticketerAddr

Address of ticketer contract

-> Natural

Desired ticket amount

-> td

Desired ticket data

-> targetAddr

Contract to call indirectly

-> payload

Main argument passed to the ticketer

-> m () 

Run a contract indirectly via calling the given ticketer contract.

The target contract will receive a ticket and some payload. The exact structure of the passed argument is determined by the ticketer contract.