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

Mary minimal property tests #2088

Merged
merged 2 commits into from Jan 11, 2021
Merged

Mary minimal property tests #2088

merged 2 commits into from Jan 11, 2021

Conversation

JaredCorduan
Copy link
Contributor

This PR adds the minimal property tests for the Mary era to the nightly tests. I've added them to the nightly tests since they take about 12 minutes to run (locally for me) and I am worried that they might be flaky (despite a good bit of effort to make them solid).

Transactions in Mary will now sometimes mint from three different token bundles. Each token bundle handles asset names differently: one always uses the same asset name, one chooses from five asset names, and one (nearly) always uses new asset names. Each bundle has a trivial policy (meaning no signature required), which made hooking this up easier. Note that we do have unit tests demonstrating that using the minting field triggers the correct authorization checks.

I had some difficulty with fee calculation in the generators. If I generate too many tokens we start doing things like generating negative fees. I had to add a constant in the fee calculation that I honestly do not understand yet (I'll make a comment in this PR at the spot).

I also fixed a small problem with the ruffle function.

Jared Corduan added 2 commits January 8, 2021 08:12
(fixes an occasional problem in the trace generation)
@@ -368,6 +373,7 @@ genNextDelta
draftSize =
sum
[ 5 :: Integer, -- safety net in case the coin or a list prefix rolls over into a larger encoding
12 :: Integer, -- TODO the size calculation somehow needs extra buffer when minting tokens
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not understand why this was needed, but this turned out to be the smallest change that I could make to get the fee calculation to cover the minimal fee.

Copy link
Contributor

@uroboros uroboros left a comment

Choose a reason for hiding this comment

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

nice! thanks @JaredCorduan - I'm having a look at improving runtimes for a subsequent PR

genTxBody slot ins outs cert wdrl fee upd meta = do
validityInterval <- genValidityInterval slot
let mint = error "TODO @uroboros mint some Mary era tokens"
mint <- genMint
let outs' = addTokensToFirstOutput (mint) outs
Copy link
Contributor

Choose a reason for hiding this comment

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

(mint)

genTxBody slot ins outs cert wdrl fee upd meta = do
validityInterval <- genValidityInterval slot
let mint = error "TODO @uroboros mint some Mary era tokens"
mint <- genMint
Copy link
Contributor

Choose a reason for hiding this comment

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

we can wrap genMint with a genMintWithScripts that produces the policy scripts present in it's generated token bundles

@uroboros uroboros merged commit 57c2514 into master Jan 11, 2021
@iohk-bors iohk-bors bot deleted the jc/mary-minimal-property-tests branch January 11, 2021 10:25
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.

None yet

2 participants