File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
cardano-api/gen/Test/Gen/Cardano/Api Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,15 @@ genSimpleScriptWithoutEmptyAnys = genRandomSimpleScript False
240240genSimpleScript :: Gen SimpleScript
241241genSimpleScript = genRandomSimpleScript True
242242
243+ -- | We include a @hasEmptyAnys@ parameter to control whether we allow empty
244+ -- 'RequireAnyOf' constructors. This is because an empty 'RequireAnyOf',
245+ -- same as a 'RequireMOf' with less than M elements, is not satisfiable.
246+ -- In the function @satisfyScript@ in the "Test.Cardano.Api.TxBody" module,
247+ -- we look for a set of witnesses that satisfy a script, and we can't do it
248+ -- if the script consists of an empty 'RequireAnyOf' constructor.
249+ -- Note that this is not the only way to make an unsatisfiable script,
250+ -- but this is the one that affects the @satisfyScript@ function, because
251+ -- it is only concerned with the witnesses, and not with the times.
243252genRandomSimpleScript :: Bool -> Gen SimpleScript
244253genRandomSimpleScript hasEmptyAnys =
245254 genTerm
You can’t perform that action at this time.
0 commit comments