Safe Haskell | None |
---|---|
Language | Haskell2010 |
Transaction validation using 'cardano-ledger-specs'
Synopsis
- type EmulatorBlock = [ Validated ( Tx EmulatorEra )]
- data EmulatedLedgerState = EmulatedLedgerState { }
- newtype Coin = Coin { }
- newtype SlotNo = SlotNo { }
- type EmulatorEra = BabbageEra StandardCrypto
- type CardanoLedgerError = Either ValidationErrorInPhase ToCardanoError
- initialState :: Params -> EmulatedLedgerState
- hasValidationErrors :: Params -> SlotNo -> UTxO EmulatorEra -> Tx BabbageEra -> Either ValidationErrorInPhase ValidationSuccess
- makeTransactionBody :: Params -> UTxO EmulatorEra -> CardanoBuildTx -> Either CardanoLedgerError ( TxBody BabbageEra )
- validateCardanoTx :: Params -> Slot -> UTxO EmulatorEra -> CardanoTx -> Either ValidationErrorInPhase ValidationSuccess
- makeBlock :: EmulatedLedgerState -> EmulatedLedgerState
- setSlot :: SlotNo -> EmulatedLedgerState -> EmulatedLedgerState
- nextSlot :: EmulatedLedgerState -> EmulatedLedgerState
- newtype UTxO era = UTxO { }
- setUtxo :: UTxO EmulatorEra -> EmulatedLedgerState -> EmulatedLedgerState
- ledgerEnv :: Lens' EmulatedLedgerState ( MempoolEnv EmulatorEra )
- memPoolState :: Lens' EmulatedLedgerState ( MempoolState EmulatorEra )
- currentBlock :: Lens' EmulatedLedgerState EmulatorBlock
- previousBlocks :: Lens' EmulatedLedgerState [ EmulatorBlock ]
- emulatorGlobals :: Params -> Globals
Documentation
type EmulatorBlock = [ Validated ( Tx EmulatorEra )] Source #
data EmulatedLedgerState Source #
State of the ledger with configuration, mempool, and the blockchain.
Instances
The amount of value held by a transaction output.
Instances
The 0-based index for the Ourboros time slot.
Instances
type EmulatorEra = BabbageEra StandardCrypto Source #
The default era for the emulator
type CardanoLedgerError = Either ValidationErrorInPhase ToCardanoError Source #
initialState :: Params -> EmulatedLedgerState Source #
Initial ledger state for a distribution
hasValidationErrors :: Params -> SlotNo -> UTxO EmulatorEra -> Tx BabbageEra -> Either ValidationErrorInPhase ValidationSuccess Source #
makeTransactionBody :: Params -> UTxO EmulatorEra -> CardanoBuildTx -> Either CardanoLedgerError ( TxBody BabbageEra ) Source #
validateCardanoTx :: Params -> Slot -> UTxO EmulatorEra -> CardanoTx -> Either ValidationErrorInPhase ValidationSuccess Source #
Modifying the state
makeBlock :: EmulatedLedgerState -> EmulatedLedgerState Source #
Make a block with all transactions that have been validated in the current block, add the block to the blockchain, and empty the current block.
setSlot :: SlotNo -> EmulatedLedgerState -> EmulatedLedgerState Source #
Set the slot number
nextSlot :: EmulatedLedgerState -> EmulatedLedgerState Source #
Increase the slot number by one
The unspent transaction outputs.
Instances
setUtxo :: UTxO EmulatorEra -> EmulatedLedgerState -> EmulatedLedgerState Source #
Set the utxo