Implement 'reify_constant' and rename reify to 'reify_data'

Both fullfill similar goal, but reify_constant sits one level above.
This commit is contained in:
KtorZ
2024-03-07 00:04:35 +01:00
parent 8ffa68d2f0
commit 59996850c1
2 changed files with 186 additions and 48 deletions

View File

@@ -794,8 +794,12 @@ impl PropertyTestResult<PlutusData> {
counterexample: match self.counterexample {
None => None,
Some(counterexample) => Some(
UntypedExpr::reify(data_types, counterexample, &self.test.fuzzer.type_info)
.expect("Failed to reify counterexample?"),
UntypedExpr::reify_data(
data_types,
counterexample,
&self.test.fuzzer.type_info,
)
.expect("Failed to reify counterexample?"),
),
},
iterations: self.iterations,
@@ -1073,7 +1077,7 @@ mod test {
let reify = move |counterexample| {
let data_type_refs = utils::indexmap::as_ref_values(&data_types);
let expr = UntypedExpr::reify(&data_type_refs, counterexample, &type_info)
let expr = UntypedExpr::reify_data(&data_type_refs, counterexample, &type_info)
.expect("Failed to reify value.");
Formatter::new().expr(&expr, false).to_pretty_string(70)
};