Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value serialisation fixes #2039

Merged
merged 4 commits into from
Dec 4, 2020
Merged

Value serialisation fixes #2039

merged 4 commits into from
Dec 4, 2020

Conversation

nc6
Copy link
Contributor

@nc6 nc6 commented Dec 3, 2020

This PR does a few things:

  • Speeds up the generation of values for the serialisation tests (time for roundtripAnn TxBody in Mary goes from ~10s to ~1s)
  • Add some shrinkers for values
  • Fixes an issue where integers encoded as UInt64 would not decode as coins.

Copy link
Contributor

@mrBliss mrBliss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the magic trick that speeds things up?


-- ============================================================
-- EraIndex parameterized generators for each type family

genTxBody :: EraIndex e -> Gen(TxBody e)
genTxBody :: EraIndex e -> Gen (TxBody e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😌

@nc6 nc6 force-pushed the nc/value-serialisation branch 2 times, most recently from 84ef213 to bfd1d89 Compare December 3, 2020 14:57
Split in a separate commit.
Rather than using prune, we instead use `valueFromList` to construct
these directly.

Also add some shrinkers for values.
Also print out the offending token on a failed parse.
These used some custom generators, which generated invalid values.
@nc6 nc6 merged commit 581767d into master Dec 4, 2020
@iohk-bors iohk-bors bot deleted the nc/value-serialisation branch December 4, 2020 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants