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
Conversation
(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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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.