conformance
Safe HaskellNone
LanguageGHC2021

Conformance.Story.Live

Description

Programs over the nine exits of the model: seven folds, a reject and a retract, and over the model's two batch questions: several requests folded in one transaction, and several rejected in one. Handles remain opaque to stories.

Synopsis

Documentation

data Edge Source #

Instances

Instances details
Bounded Edge Source # 
Instance details

Defined in Conformance.Story.Live

Methods

minBound :: Edge Source #

maxBound :: Edge Source #

Enum Edge Source # 
Instance details

Defined in Conformance.Story.Live

Methods

succ :: Edge -> Edge Source #

pred :: Edge -> Edge Source #

toEnum :: Int -> Edge Source #

fromEnum :: Edge -> Int Source #

enumFrom :: Edge -> [Edge] Source #

enumFromThen :: Edge -> Edge -> [Edge] Source #

enumFromTo :: Edge -> Edge -> [Edge] Source #

enumFromThenTo :: Edge -> Edge -> Edge -> [Edge] Source #

Show Edge Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> Edge -> ShowS Source #

show :: Edge -> String Source #

showList :: [Edge] -> ShowS Source #

Eq Edge Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: Edge -> Edge -> Bool Source #

(/=) :: Edge -> Edge -> Bool Source #

Ord Edge Source # 
Instance details

Defined in Conformance.Story.Live

Methods

compare :: Edge -> Edge -> Ordering Source #

(<) :: Edge -> Edge -> Bool Source #

(<=) :: Edge -> Edge -> Bool Source #

(>) :: Edge -> Edge -> Bool Source #

(>=) :: Edge -> Edge -> Bool Source #

max :: Edge -> Edge -> Edge Source #

min :: Edge -> Edge -> Edge Source #

edgeName :: Edge -> String Source #

data Exit Source #

How a request leaves the queue: folded by its own edge, rejected by a folder in a window its story names, or retracted by its owner.

Constructors

Fold 
Reject 
Retract 

Instances

Instances details
Bounded Exit Source # 
Instance details

Defined in Conformance.Story.Live

Methods

minBound :: Exit Source #

maxBound :: Exit Source #

Enum Exit Source # 
Instance details

Defined in Conformance.Story.Live

Methods

succ :: Exit -> Exit Source #

pred :: Exit -> Exit Source #

toEnum :: Int -> Exit Source #

fromEnum :: Exit -> Int Source #

enumFrom :: Exit -> [Exit] Source #

enumFromThen :: Exit -> Exit -> [Exit] Source #

enumFromTo :: Exit -> Exit -> [Exit] Source #

enumFromThenTo :: Exit -> Exit -> Exit -> [Exit] Source #

Show Exit Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> Exit -> ShowS Source #

show :: Exit -> String Source #

showList :: [Exit] -> ShowS Source #

Eq Exit Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: Exit -> Exit -> Bool Source #

(/=) :: Exit -> Exit -> Bool Source #

exitName :: Exit -> Edge -> String Source #

An exit's operation name: a fold is named by the edge it folds.

data EdgeRequest wal Source #

Constructors

EdgeRequest 

Fields

Instances

Instances details
Show wal => Show (EdgeRequest wal) Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> EdgeRequest wal -> ShowS Source #

show :: EdgeRequest wal -> String Source #

showList :: [EdgeRequest wal] -> ShowS Source #

Eq wal => Eq (EdgeRequest wal) Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: EdgeRequest wal -> EdgeRequest wal -> Bool Source #

(/=) :: EdgeRequest wal -> EdgeRequest wal -> Bool Source #

data Tamper Source #

A change to the submitted transaction the model's request does not make. OtherAddress sends the payment the exit owes to another address, and ShortByOne pays it one lovelace short; the ledger must refuse both, and the model must refuse them for the reason it gives. ExtraSigner adds one required signer the model does not require; the ledger accepts it, and the comparison must report the transaction's signers. Unsigned removes the owner's required signature from a retraction; its admission witness tells the model which signatures that transaction requires.

Instances

Instances details
Bounded Tamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

minBound :: Tamper Source #

maxBound :: Tamper Source #

Enum Tamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

succ :: Tamper -> Tamper Source #

pred :: Tamper -> Tamper Source #

toEnum :: Int -> Tamper Source #

fromEnum :: Tamper -> Int Source #

enumFrom :: Tamper -> [Tamper] Source #

enumFromThen :: Tamper -> Tamper -> [Tamper] Source #

enumFromTo :: Tamper -> Tamper -> [Tamper] Source #

enumFromThenTo :: Tamper -> Tamper -> Tamper -> [Tamper] Source #

Show Tamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> Tamper -> ShowS Source #

show :: Tamper -> String Source #

showList :: [Tamper] -> ShowS Source #

Eq Tamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: Tamper -> Tamper -> Bool Source #

(/=) :: Tamper -> Tamper -> Bool Source #

tamperName :: Tamper -> String Source #

data BatchTamper Source #

A change to the transaction of a fold batch. MintOnFirstKey mints every token the batch delivers at the key of its first request, the deliveries carrying it: the same quantity of each kind, at the wrong keys.

Constructors

MintOnFirstKey 

Instances

Instances details
Bounded BatchTamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

minBound :: BatchTamper Source #

maxBound :: BatchTamper Source #

Enum BatchTamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

succ :: BatchTamper -> BatchTamper Source #

pred :: BatchTamper -> BatchTamper Source #

toEnum :: Int -> BatchTamper Source #

fromEnum :: BatchTamper -> Int Source #

enumFrom :: BatchTamper -> [BatchTamper] Source #

enumFromThen :: BatchTamper -> BatchTamper -> [BatchTamper] Source #

enumFromTo :: BatchTamper -> BatchTamper -> [BatchTamper] Source #

enumFromThenTo :: BatchTamper -> BatchTamper -> BatchTamper -> [BatchTamper] Source #

Show BatchTamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> BatchTamper -> ShowS Source #

show :: BatchTamper -> String Source #

showList :: [BatchTamper] -> ShowS Source #

Eq BatchTamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: BatchTamper -> BatchTamper -> Bool Source #

(/=) :: BatchTamper -> BatchTamper -> Bool Source #

data RefundTamper Source #

A change to the refunds of a reject batch, in the transaction's input order. CrossedRefunds pays each request's owner, at its refund's position, what the next request's owner is owed. ShortFirstRefund pays the first request's owner the given lovelace short, the rest going to the transaction's change. SplitFirstRefund pays it short at its refund's position too, with two ada more in another output at the same owner's key.

Constructors

CrossedRefunds 
ShortFirstRefund Integer 
SplitFirstRefund Integer 

Instances

Instances details
Show RefundTamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> RefundTamper -> ShowS Source #

show :: RefundTamper -> String Source #

showList :: [RefundTamper] -> ShowS Source #

Eq RefundTamper Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: RefundTamper -> RefundTamper -> Bool Source #

(/=) :: RefundTamper -> RefundTamper -> Bool Source #

refundShortfall :: RefundTamper -> Maybe Integer Source #

The lovelace a refund tamper takes from the first refund, if any.

data Booking wal Source #

Who books a request and what it holds beyond the processing tip. A request without a booking is booked by the runner's own wallet with the default deposit.

Constructors

Booking 

Fields

Instances

Instances details
Show wal => Show (Booking wal) Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> Booking wal -> ShowS Source #

show :: Booking wal -> String Source #

showList :: [Booking wal] -> ShowS Source #

Eq wal => Eq (Booking wal) Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: Booking wal -> Booking wal -> Bool Source #

(/=) :: Booking wal -> Booking wal -> Bool Source #

data Placement Source #

Where a reject is placed: a fact about the submitted transaction, not a tamper. The model gives a reject no admission, so its answer does not depend on it; the chain is asked in the window the story names.

Instances

Instances details
Bounded Placement Source # 
Instance details

Defined in Conformance.Story.Live

Methods

minBound :: Placement Source #

maxBound :: Placement Source #

Enum Placement Source # 
Instance details

Defined in Conformance.Story.Live

Methods

succ :: Placement -> Placement Source #

pred :: Placement -> Placement Source #

toEnum :: Int -> Placement Source #

fromEnum :: Placement -> Int Source #

enumFrom :: Placement -> [Placement] Source #

enumFromThen :: Placement -> Placement -> [Placement] Source #

enumFromTo :: Placement -> Placement -> [Placement] Source #

enumFromThenTo :: Placement -> Placement -> Placement -> [Placement] Source #

Show Placement Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> Placement -> ShowS Source #

show :: Placement -> String Source #

showList :: [Placement] -> ShowS Source #

Eq Placement Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: Placement -> Placement -> Bool Source #

(/=) :: Placement -> Placement -> Bool Source #

placementName :: Placement -> String Source #

The placement as the run log names it.

placementReading :: Placement -> String Source #

The placement as the book reads it.

placementWindow :: Placement -> Integer -> Integer -> Integer -> (Integer, Maybe Integer) Source #

The window a placement names, in POSIX milliseconds, for a request submitted at submittedAt under a registry's processing and retraction times: from its start to its excluded end, open-ended after the windows.

data LiveI reg wal step obs cmp result where Source #

Constructors

Submit :: forall reg wal step obs cmp. Exit -> reg -> EdgeRequest wal -> LiveI reg wal step obs cmp step 
Tamper :: forall reg wal step obs cmp. Tamper -> Exit -> reg -> EdgeRequest wal -> LiveI reg wal step obs cmp step 
RejectWithin :: forall reg wal step obs cmp. Placement -> Maybe Tamper -> reg -> EdgeRequest wal -> LiveI reg wal step obs cmp step 
Observe :: forall step reg wal obs cmp. step -> LiveI reg wal step obs cmp obs 
Compare :: forall step obs reg wal cmp. step -> obs -> LiveI reg wal step obs cmp cmp 
FoldBatch :: forall reg wal step obs cmp. Maybe BatchTamper -> reg -> [EdgeRequest wal] -> LiveI reg wal step obs cmp cmp 
RejectBatchWithin :: forall reg wal step obs cmp. Placement -> Maybe RefundTamper -> reg -> [(EdgeRequest wal, Maybe (Booking wal))] -> LiveI reg wal step obs cmp cmp 

type Story reg wal step obs cmp = Story (LiveI reg wal step obs cmp) Source #

data Context reg wal Source #

Constructors

Context reg wal 

submit :: reg -> EdgeRequest wal -> Story reg wal step obs cmp step Source #

tamper :: Tamper -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step Source #

rejectWithin :: Placement -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step Source #

A folder rejects the request in the window the placement names.

tamperRejectWithin :: Tamper -> Placement -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step Source #

A folder rejects the request in that window, through a tampered transaction.

retract :: reg -> EdgeRequest wal -> Story reg wal step obs cmp step Source #

The request's owner retracts it.

tamperExit :: Tamper -> Exit -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step Source #

The request leaves by this exit through a transaction changed by the tamper.

foldBatch :: reg -> [EdgeRequest wal] -> Story reg wal step obs cmp cmp Source #

Fold these requests in one transaction, each on its own edge, and ask the model the same batch: its foldBatch question. The batch is submitted and asked as one instruction; its answer is what the model and the chain each said.

tamperFoldBatch :: BatchTamper -> reg -> [EdgeRequest wal] -> Story reg wal step obs cmp cmp Source #

Fold these requests in one transaction changed by the batch tamper, and ask the model the same batch, each request claiming what that transaction mints at its key.

rejectBatchWithin :: Placement -> reg -> [EdgeRequest wal] -> Story reg wal step obs cmp cmp Source #

A folder rejects these requests in one transaction, in the window the placement names, and the model is asked the same batch: its rejectBatch question.

rejectBookedBatchWithin :: Placement -> reg -> [(EdgeRequest wal, Booking wal)] -> Story reg wal step obs cmp cmp Source #

A folder rejects these requests in one transaction, in the window the placement names, each booked by the owner and with the deposit its booking names, and the model is asked the same batch.

tamperRejectBookedBatchWithin :: RefundTamper -> Placement -> reg -> [(EdgeRequest wal, Booking wal)] -> Story reg wal step obs cmp cmp Source #

A folder rejects these booked requests in one transaction changed by the refund tamper, and the model is asked the same batch, judged on the refunds that transaction pays.

observe :: step -> Story reg wal step obs cmp obs Source #

compareWithModel :: step -> obs -> Story reg wal step obs cmp cmp Source #

renderLive :: Story String String String String String res -> String Source #

validateLive :: Story String String String String String res -> Either String () Source #

Check instruction order over the same program with display-only handles, before a runner can submit a transaction.

data Instruction Source #

One instruction of a program, with the tamper it carries, if any.

Constructors

Instruction 

Fields

Instances

Instances details
Show Instruction Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> Instruction -> ShowS Source #

show :: Instruction -> String Source #

showList :: [Instruction] -> ShowS Source #

Eq Instruction Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: Instruction -> Instruction -> Bool Source #

(/=) :: Instruction -> Instruction -> Bool Source #

data InstructionKind Source #

What one instruction of a program is.

Instances

Instances details
Show InstructionKind Source # 
Instance details

Defined in Conformance.Story.Live

Methods

showsPrec :: Int -> InstructionKind -> ShowS Source #

show :: InstructionKind -> String Source #

showList :: [InstructionKind] -> ShowS Source #

Eq InstructionKind Source # 
Instance details

Defined in Conformance.Story.Live

Methods

(==) :: InstructionKind -> InstructionKind -> Bool Source #

(/=) :: InstructionKind -> InstructionKind -> Bool Source #

liveInstructions :: Story String String String String String res -> [Instruction] Source #

Every instruction of a program over display handles, in order, theorem clauses included. The walk feeds each instruction the result the book's renderer feeds it, so it meets the instructions the book prints.