consensus-test
Safe HaskellNone
LanguageHaskell2010

Test.Consensus.Mempool.Util

Synopsis

Documentation

applyTxToLedgerLedgerConfig TestBlockLedgerState TestBlock ValuesMKTestTxExcept TestTxError (LedgerState TestBlock ValuesMK) Source #

Apply a transaction to the ledger

We don't have blocks in this test, but transactions only. In this function we pretend the transaction is a block, apply it to the UTxO, and then update the tip of the ledger state, incrementing the slot number and faking a hash.

genLargeInvalidTxTheMeasureGen TestTx Source #

Generate an invalid tx that is larger than the given measure.

genTxs Source #

Arguments

Int

The number of transactions to generate

LedgerState TestBlock ValuesMK 
Gen ([(TestTx, Bool)], LedgerState TestBlock ValuesMK) 

Generate a number of valid and invalid transactions and apply the valid transactions to the given LedgerState. The transactions along with a Bool indicating whether its valid (True) or invalid (False) and the resulting LedgerState are returned.

genValidTxLedgerState TestBlock ValuesMKGen (TestTx, LedgerState TestBlock ValuesMK) Source #

Generate a valid transaction (but ignoring any per-tx size limits, see Note [Transaction size limit]).

genValidTxs Source #

Arguments

Int

The number of valid transactions to generate

LedgerState TestBlock ValuesMK 
Gen ([TestTx], LedgerState TestBlock ValuesMK) 

Generate a number of valid transactions and apply these to the given LedgerState. The transactions and the resulting LedgerState are returned.

mkTestLedgerConfigMockConfigLedgerConfig TestBlock Source #

Test config

(We don't really care about these values here)