Rework generate_raw to avoid need to intern in prop tests

Also, this commit makes `apply_term` automatically re-intern the
  program since it isn't safe to apply any term onto a UPLC program. In
  particular, terms that introduce new let-bindings (via lambdas) will
  mess with the already generated DeBruijn indices.

  The problem doesn't occur for pure constant terms like Data. So we
  still have a safe and fast version 'apply_data' when needed.
This commit is contained in:
KtorZ
2024-03-03 19:24:35 +01:00
parent 1134b8d7d0
commit 30841fe000
9 changed files with 127 additions and 120 deletions

View File

@@ -49,7 +49,7 @@ fn assert_uplc(source_code: &str, expected: Term<Name>, should_fail: bool) {
match &script.2 {
TestType::Func(Function { body: func, .. }) => {
let program = generator.generate_raw(func, &script.1);
let program = generator.generate_raw(func, &[], &script.1);
let debruijn_program: Program<DeBruijn> = program.try_into().unwrap();