ouroboros-consensus-0.28.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Test.Util.Serialisation.TxWireSize

Synopsis

Documentation

prop_txWireSize Source #

Arguments

∷ (SerialiseNodeToNode blk (GenTx blk), TxLimits blk) 
⇒ (GenTx blk → Maybe String)

show tx bytes

CodecConfig blk 
WithVersion (BlockNodeToNodeVersion blk) (GenTx blk) 
Property 

Verify that txWriteSize is very close to the real tx size.

The txWireSize doesn't take into account if HFC is enabled or not. If it is enabled, the wireTxSize for `GenTx (HardForkBlock xs)` will agree with the encoded size, but if it is disabled it will overestimate the value by HFC envelope (at most 3 bytes, 2 for forcible future)

prop_txWireSize_txSubmission ∷ (SerialiseNodeToNode blk (GenTx blk), TxLimits blk) ⇒ CodecConfig blk → WithVersion (BlockNodeToNodeVersion blk) (GenTx blk) → Property Source #

Verify that txWriteSize agrees with the encoded GenTx size up to config_MX_TX_SIZE_DISCREPANCY allowed by `tx-submission` mini-protocol.

NOTE: txs which do not satisfy this property will terminate connections.