You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These unit tests were written with the help of Claude 4 (it wrong the
tests and I just fixed its miniscript syntax by adding s wrappers).
If you want to try reordering this commit to two commits back (where it
will fail), you need to tweak it a bit because the data structures were
rearranged. This diff will work.
diff --git a/src/miniscript/mod.rs b/src/miniscript/mod.rs
index 2435e50f..cb0b3530 100644
--- a/src/miniscript/mod.rs
+++ b/src/miniscript/mod.rs
@@ -1892,8 +1892,8 @@ mod tests {
// With the fix, or_d dissatisfaction should not have the extra +1
// Both branches have exec_stack_count of 1, so dissat should be max(1,1) = 1, not 2
- if let Some(dissat_data) = ms.ext.dissat_data {
- assert_eq!(dissat_data.max_exec_stack_count, 1);
+ if let Some(dissat_data) = ms.ext.exec_stack_elem_count_dissat{
+ assert_eq!(dissat_data, 1);
} else {
panic!("Expected dissat_data to be Some");
}
@@ -1908,8 +1908,8 @@ mod tests {
// Each pk has exec_stack_count of 1
// With the fix, threshold should take max(1,1,1) = 1, not sum 1+1+1 = 3
- if let Some(sat_data) = ms.ext.sat_data {
- assert_eq!(sat_data.max_exec_stack_count, 1);
+ if let Some(sat_data) = ms.ext.exec_stack_elem_count_sat{
+ assert_eq!(sat_data, 1);
} else {
panic!("Expected sat_data to be Some");
}
@@ -1920,8 +1920,8 @@ mod tests {
// and_v has exec_stack_count of 2, pk has 1
// With the fix: max(2,1) = 2, old code would sum to 3
- if let Some(sat_data) = complex_ms.ext.sat_data {
- assert_eq!(sat_data.max_exec_stack_count, 2);
+ if let Some(sat_data) = complex_ms.ext.exec_stack_elem_count_sat{
+ assert_eq!(sat_data, 2);
} else {
panic!("Expected sat_data to be Some");
}
0 commit comments