| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data Edge
- edgeName :: Edge -> String
- data Exit
- exitName :: Exit -> Edge -> String
- data EdgeRequest wal = EdgeRequest {
- requestEdge :: Edge
- requestKey :: String
- requestWallet :: wal
- data Tamper
- tamperName :: Tamper -> String
- data BatchTamper = MintOnFirstKey
- batchTamperName :: BatchTamper -> String
- data RefundTamper
- = CrossedRefunds
- | ShortFirstRefund Integer
- | SplitFirstRefund Integer
- refundTamperName :: RefundTamper -> String
- refundShortfall :: RefundTamper -> Maybe Integer
- data Booking wal = Booking {
- bookingOwner :: wal
- bookingDeposit :: Integer
- data Placement
- placementName :: Placement -> String
- placementReading :: Placement -> String
- placementWindow :: Placement -> Integer -> Integer -> Integer -> (Integer, Maybe Integer)
- data LiveI reg wal step obs cmp result where
- 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)
- data Context reg wal = Context reg wal
- submit :: reg -> EdgeRequest wal -> Story reg wal step obs cmp step
- tamper :: Tamper -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step
- rejectWithin :: Placement -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step
- tamperRejectWithin :: Tamper -> Placement -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step
- retract :: reg -> EdgeRequest wal -> Story reg wal step obs cmp step
- tamperExit :: Tamper -> Exit -> reg -> EdgeRequest wal -> Story reg wal step obs cmp step
- foldBatch :: reg -> [EdgeRequest wal] -> Story reg wal step obs cmp cmp
- tamperFoldBatch :: BatchTamper -> reg -> [EdgeRequest wal] -> Story reg wal step obs cmp cmp
- rejectBatchWithin :: Placement -> reg -> [EdgeRequest wal] -> Story reg wal step obs cmp cmp
- rejectBookedBatchWithin :: Placement -> reg -> [(EdgeRequest wal, Booking wal)] -> Story reg wal step obs cmp cmp
- tamperRejectBookedBatchWithin :: RefundTamper -> Placement -> reg -> [(EdgeRequest wal, Booking wal)] -> Story reg wal step obs cmp cmp
- observe :: step -> Story reg wal step obs cmp obs
- compareWithModel :: step -> obs -> Story reg wal step obs cmp cmp
- renderLive :: Story String String String String String res -> String
- validateLive :: Story String String String String String res -> Either String ()
- data Instruction = Instruction {
- instructionKind :: InstructionKind
- instructionTamper :: Maybe String
- data InstructionKind
- liveInstructions :: Story String String String String String res -> [Instruction]
Documentation
Constructors
| InsertAbsent | |
| InsertActive | |
| UpdateActive | |
| UpdateTerminal | |
| DeleteAbsent | |
| DeleteActive | |
| WitnessTerminal |
Instances
| Bounded Edge Source # | |
Defined in Conformance.Story.Live | |
| Enum Edge Source # | |
| Show Edge Source # | |
Defined in Conformance.Story.Live | |
| Eq Edge Source # | |
Defined in Conformance.Story.Live | |
| Ord Edge Source # | |
Defined in Conformance.Story.Live | |
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.
Instances
| Bounded Exit Source # | |
Defined in Conformance.Story.Live | |
| Enum Exit Source # | |
| Show Exit Source # | |
Defined in Conformance.Story.Live | |
| Eq Exit Source # | |
Defined in Conformance.Story.Live | |
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
| Show wal => Show (EdgeRequest wal) Source # | |
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 # | |
Defined in Conformance.Story.Live Methods (==) :: EdgeRequest wal -> EdgeRequest wal -> Bool Source # (/=) :: EdgeRequest wal -> EdgeRequest wal -> Bool 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.
Constructors
| OtherAddress | |
| ShortByOne | |
| ExtraSigner | |
| OtherReference | |
| StateSpent | |
| Unsigned | |
| BeforePhase2 | |
| AfterPhase2 |
Instances
| Bounded Tamper Source # | |
Defined in Conformance.Story.Live | |
| Enum Tamper Source # | |
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 # | |
Defined in Conformance.Story.Live | |
| Eq Tamper Source # | |
Defined in Conformance.Story.Live | |
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
| Bounded BatchTamper Source # | |
Defined in Conformance.Story.Live | |
| Enum BatchTamper Source # | |
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 # | |
Defined in Conformance.Story.Live Methods showsPrec :: Int -> BatchTamper -> ShowS Source # show :: BatchTamper -> String Source # showList :: [BatchTamper] -> ShowS Source # | |
| Eq BatchTamper Source # | |
Defined in Conformance.Story.Live Methods (==) :: BatchTamper -> BatchTamper -> Bool Source # (/=) :: BatchTamper -> BatchTamper -> Bool Source # | |
batchTamperName :: BatchTamper -> String 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
| Show RefundTamper Source # | |
Defined in Conformance.Story.Live Methods showsPrec :: Int -> RefundTamper -> ShowS Source # show :: RefundTamper -> String Source # showList :: [RefundTamper] -> ShowS Source # | |
| Eq RefundTamper Source # | |
Defined in Conformance.Story.Live Methods (==) :: RefundTamper -> RefundTamper -> Bool Source # (/=) :: RefundTamper -> RefundTamper -> Bool Source # | |
refundTamperName :: RefundTamper -> String Source #
refundShortfall :: RefundTamper -> Maybe Integer Source #
The lovelace a refund tamper takes from the first refund, if any.
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
| Show wal => Show (Booking wal) Source # | |
Defined in Conformance.Story.Live | |
| Eq wal => Eq (Booking wal) Source # | |
Defined in Conformance.Story.Live | |
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.
Constructors
| InProcessingWindow | |
| InRetractionWindow | |
| AfterTheWindows |
Instances
| Bounded Placement Source # | |
Defined in Conformance.Story.Live | |
| Enum Placement Source # | |
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 # | |
Defined in Conformance.Story.Live | |
| Eq Placement Source # | |
Defined in Conformance.Story.Live | |
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 |
submit :: 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.
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
| Show Instruction Source # | |
Defined in Conformance.Story.Live Methods showsPrec :: Int -> Instruction -> ShowS Source # show :: Instruction -> String Source # showList :: [Instruction] -> ShowS Source # | |
| Eq Instruction Source # | |
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
| Show InstructionKind Source # | |
Defined in Conformance.Story.Live Methods showsPrec :: Int -> InstructionKind -> ShowS Source # show :: InstructionKind -> String Source # showList :: [InstructionKind] -> ShowS Source # | |
| Eq InstructionKind Source # | |
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.