-
Notifications
You must be signed in to change notification settings - Fork 11
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
Usage oriented test-suite #324
base: main
Are you sure you want to change the base?
Conversation
- Yes/no validators - A validator that checks the datum type of its continuing output - InlineDatumSpec uses the latter validator - Some simple traces: Paying to wallets and scripts with different datum formats
And some traces, among which some behave curiously
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.
Thanks, @gabrielhdt, this is already a big improvement! I left a few comments, but I think we're close to getting this merged.
tests/Cooked/Behaviour/Validators.hs
Outdated
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 really like this module! Can we have a few scripts (and tests) about staking as well?
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.
Maybe this module should not live in the Behaviour
hierarchy. We might want to use these validators also in unit tests for tweaks (if only to have some script to direct paysScript
s to).
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'm not sure we can test anything about staking here, it may be the case that some additional fields in the skeleton are needed
dd05002
to
aa76840
Compare
Replace walletToScript by walletToScriptHowDatum
- Created a new 'Other' module where to put validators that are not Unit - Moved validators from DoubleSatSpec to the Validators module
Use UTxO when we talk about resulting outputs of a transaction, *submit* a transaction and *produce* an output or UTxO
Co-authored-by: carlhammann <102371507+carlhammann@users.noreply.github.com>
What is this all about
This PR provide a test suite designed around nominal use cases of Cooked. It ought to contain
Changes
tests/Cooked/Unit
tests/Cooked/Behaviour
.Cooked.Behaviour.Validators
contains a collection of validators with unit datum and redeemersCooked.Behaviour.Elementary
contains some standard-ish traces.Questionable behaviours revealed so far
TxSkelRedeemerForScript
whenTxSkelRedeemerForReferenceScript
yields the following confusing error messageThe problem with validators checking fees
Because the fee of a transaction is available in its context (see the datatype for contexts), one may write validators that succeed upon some condition over the fee. However, because the value of the fee depends on the complexity of the validator, the latter has to be run to compute the former. This leads to a fixpoint algorithm:
Therefore, the validator is run in several contexts which differ at least by their fee value. In particular, validators are always run at least once with$f_0$ so one cannot write a validator that succeeds if and only if the transaction it is run in has fees strictly smaller than $f_0$ .
See issue #341.