Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3211: Speed up `TransactionSpec.signTransaction`. r=jonathanknowles a=jonathanknowles ## Issue Number ADP-1485 ## Summary This PR: - adjusts `checkSubsetOf` to use set-based lookups instead of repeated list traversals. - adjusts `signTransaction` properties to only test 10 examples per property, rather than 100. This results in a substantial reduction in total time required to run the `signTransaction` tests: ``` Before: 530 ± 10 seconds (over 4 runs) After: 48 ± 2 seconds (over 4 runs) ``` ## Additional Improvements This PR also: - introduces function `spec_forAllEras` to eliminate some repetition in the `signTransaction` spec . - makes the output of `signTransaction` property tests more readable, so that the name of each property is written once as a section header, rather than being repeated for every single era. (The individual eras are still as subsections.) ```hs Cardano.Wallet.Shelley.Transaction Sign transaction signTransaction adds reward account witness when necessary ByronEra +++ OK, passed 10 tests (100% feature not supported in ByronEra). ShelleyEra (2144ms) +++ OK, passed 10 tests. AllegraEra (2143ms) +++ OK, passed 10 tests. MaryEra (2142ms) +++ OK, passed 10 tests. AlonzoEra (2142ms) +++ OK, passed 10 tests. signTransaction adds extra key witnesses when necessary ByronEra +++ OK, passed 10 tests (100% feature not supported in ByronEra). ShelleyEra +++ OK, passed 10 tests (100% feature not supported in ShelleyEra). AllegraEra +++ OK, passed 10 tests (100% feature not supported in AllegraEra). MaryEra +++ OK, passed 10 tests (100% feature not supported in MaryEra). AlonzoEra (686ms) +++ OK, passed 10 tests. ``` Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
- Loading branch information