Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Language.Marlowe.Runtime.Indexer.Types
Synopsis
- data MarloweBlock = MarloweBlock {
- blockHeader :: BlockHeader
- transactions :: NonEmpty MarloweTransaction
- data MarloweTransaction
- = CreateTransaction MarloweCreateTransaction
- | ApplyInputsTransaction MarloweApplyInputsTransaction
- | WithdrawTransaction MarloweWithdrawTransaction
- | InvalidCreateTransaction ContractId ExtractCreationError
- | InvalidApplyInputsTransaction TxId (Set TxOutRef) ExtractMarloweTransactionError
- data MarloweCreateTransaction = MarloweCreateTransaction {
- txId :: TxId
- newContracts :: Map TxIx SomeCreateStep
- data MarloweApplyInputsTransaction = forall v.MarloweApplyInputsTransaction {
- marloweVersion :: MarloweVersion v
- marloweInput :: UnspentContractOutput
- marloweTransaction :: Transaction v
- data MarloweWithdrawTransaction = MarloweWithdrawTransaction {
- consumedPayouts :: Map ContractId (Set TxOutRef)
- consumingTx :: TxId
- data MarloweUTxO = MarloweUTxO {
- unspentContractOutputs :: Map ContractId UnspentContractOutput
- unspentPayoutOutputs :: Map ContractId (Set TxOutRef)
- data UnspentContractOutput = UnspentContractOutput {
- marloweVersion :: SomeMarloweVersion
- txOutRef :: TxOutRef
- marloweAddress :: Address
- payoutValidatorHash :: ScriptHash
- extractMarloweBlock :: SystemStart -> EraHistory CardanoMode -> Set ScriptHash -> BlockHeader -> Set Transaction -> MarloweUTxO -> Maybe (MarloweUTxO, MarloweBlock)
- retrySilentUntilAllSilent :: (Witherable t, MonadWriter [w] m) => t a -> (a -> m ()) -> m ()
- extractCreateTx :: Set ScriptHash -> Transaction -> WriterT [MarloweTransaction] (State MarloweUTxO) ()
- createStepToUnspentContractOutput :: SomeCreateStep -> UnspentContractOutput
- extractContractId :: Set ScriptHash -> TxOutRef -> TransactionOutput -> Maybe ContractId
- extractApplyInputsTx :: SystemStart -> EraHistory CardanoMode -> BlockHeader -> Transaction -> WriterT [MarloweTransaction] (State MarloweUTxO) ()
- extractWithdrawTx :: Transaction -> WriterT [MarloweTransaction] (State MarloweUTxO) ()
- hoistMaybe :: Applicative m => Maybe a -> MaybeT m a
Documentation
data MarloweBlock Source #
Constructors
MarloweBlock | |
Fields
|
Instances
Generic MarloweBlock Source # | |
Defined in Language.Marlowe.Runtime.Indexer.Types Methods from :: MarloweBlock -> Rep MarloweBlock x Source # to :: Rep MarloweBlock x -> MarloweBlock Source # | |
Show MarloweBlock Source # | |
Defined in Language.Marlowe.Runtime.Indexer.Types | |
Eq MarloweBlock Source # | |
Defined in Language.Marlowe.Runtime.Indexer.Types Methods (==) :: MarloweBlock -> MarloweBlock -> Bool Source # (/=) :: MarloweBlock -> MarloweBlock -> Bool Source # | |
type Rep MarloweBlock Source # | |
Defined in Language.Marlowe.Runtime.Indexer.Types type Rep MarloweBlock = D1 ('MetaData "MarloweBlock" "Language.Marlowe.Runtime.Indexer.Types" "marlowe-runtime-0.0.5-JktrJhpUQi4IpTDTYokofB-indexer" 'False) (C1 ('MetaCons "MarloweBlock" 'PrefixI 'True) (S1 ('MetaSel ('Just "blockHeader") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BlockHeader) :*: S1 ('MetaSel ('Just "transactions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty MarloweTransaction)))) |
data MarloweTransaction Source #
Constructors
CreateTransaction MarloweCreateTransaction | |
ApplyInputsTransaction MarloweApplyInputsTransaction | |
WithdrawTransaction MarloweWithdrawTransaction | |
InvalidCreateTransaction ContractId ExtractCreationError | |
InvalidApplyInputsTransaction TxId (Set TxOutRef) ExtractMarloweTransactionError |
Instances
data MarloweCreateTransaction Source #
Constructors
MarloweCreateTransaction | |
Fields
|
Instances
data MarloweApplyInputsTransaction Source #
Constructors
forall v. MarloweApplyInputsTransaction | |
Fields
|
Instances
data MarloweWithdrawTransaction Source #
Constructors
MarloweWithdrawTransaction | |
Fields
|
Instances
data MarloweUTxO Source #
The global Marlowe UTxO set
Constructors
MarloweUTxO | |
Fields
|
Instances
data UnspentContractOutput Source #
Information about an unspent contract transaction output.
Constructors
UnspentContractOutput | |
Fields
|
Instances
Arguments
:: SystemStart | |
-> EraHistory CardanoMode | |
-> Set ScriptHash | All known Marlowe script hashes. |
-> BlockHeader | The BlockHeader of the block. |
-> Set Transaction | The set of transactions in the block. |
-> MarloweUTxO | The current MarloweUTxO |
-> Maybe (MarloweUTxO, MarloweBlock) |
retrySilentUntilAllSilent :: (Witherable t, MonadWriter [w] m) => t a -> (a -> m ()) -> m () Source #
Arguments
:: Set ScriptHash | All known Marlowe script hashes. |
-> Transaction | |
-> WriterT [MarloweTransaction] (State MarloweUTxO) () |
Extracts a MarloweCreateTransaction from a Chain transaction. A single transaction can create multiple Marlowe contracts, and this function returns a map of outputs that it failed to extract as well as the map of contracts it successfully extracted.
createStepToUnspentContractOutput :: SomeCreateStep -> UnspentContractOutput Source #
Arguments
:: Set ScriptHash | All known Marlowe script hashes. |
-> TxOutRef | The txOutRef of the transaction output. |
-> TransactionOutput | The transaction output. |
-> Maybe ContractId |
Extracts a ContractId from a transaction output if it is a Marlowe contract output.
Arguments
:: SystemStart | |
-> EraHistory CardanoMode | |
-> BlockHeader | |
-> Transaction | The transaction to extract an apply inputs tx from. |
-> WriterT [MarloweTransaction] (State MarloweUTxO) () |
Extracts an apply inputs transaction from a chain transaction. Returns nothing if the transaction does not apply an input to any unspent contract output.
extractWithdrawTx :: Transaction -> WriterT [MarloweTransaction] (State MarloweUTxO) () Source #
Extracts a withdraw transaction from a chain transaction. Returns nothing if the transaction does not withdraw contract payouts. Removes payouts from the Marlowe UTxO.
hoistMaybe :: Applicative m => Maybe a -> MaybeT m a Source #