plutus-tx-1.60.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.Test.Golden

Synopsis

TH CodGen

goldenCodeGen :: TestName -> Q [Dec] -> ExpQ #

Like goldenCodeGen but strips TH-generated unique name suffixes to produce deterministic output. See Note [Stripping TH-generated unique suffixes in golden tests]

Compilation testing

goldenPir :: (TestNested #

Prints uniques. This should be used sparingly: a simple change to a script or a compiler pass may change all uniques, making it difficult to see the actual change if all uniques are printed. It is nonetheless useful sometimes.

goldenPirBy :: (Doc ann #

Pretty-print compiled code size

Given a UPLC program, there are two quantification of "size": AST Size and Flat Size. AST Size measures AST nodes of the given UPLC program. Flat Size measures the number of bytes when the given program serialized into bytestring using binary flat encoding format.

Cost of storing smart contract onchain is partially determined by the Flat size. So it is useful to have Flat size measurement in case we adopt new or introduce optimizations to the flat encoding format.