Skip to content

Commit 6bf9d2c

Browse files
committed
Consider Introspect operations in all Covenants
1 parent 995bb33 commit 6bf9d2c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/extensions/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ pub enum CovenantExt<T: ExtParam> {
257257
Csfs(CheckSigFromStack<T>),
258258
/// Arith opcodes
259259
Arith(Arith),
260+
/// Cov opcodes
261+
Introspect(CovOps<T>),
260262
}
261263

262264
/// All known Extension parameters/arguments
@@ -393,6 +395,7 @@ macro_rules! all_arms_fn {
393395
CovenantExt::LegacyOutputsPref(p) => <LegacyOutputsPref as $trt>::$f(p, $($args, )*),
394396
CovenantExt::Csfs(csfs) => csfs.$f($($args, )*),
395397
CovenantExt::Arith(e) => e.$f($($args, )*),
398+
CovenantExt::Introspect(e) => e.$f($($args, )*),
396399
}
397400
};
398401
}
@@ -409,7 +412,9 @@ macro_rules! try_from_arms {
409412
Ok(CovenantExt::Csfs(v))
410413
} else if let Ok(v) = <Arith as $trt>::$f($($args, )*) {
411414
Ok(CovenantExt::Arith(v))
412-
} else {
415+
} else if let Ok(v) = <CovOps<$ext_arg> as $trt>::$f($($args, )*) {
416+
Ok(CovenantExt::Introspect(v))
417+
}else {
413418
Err(())
414419
}
415420
};
@@ -478,6 +483,7 @@ impl<T: ExtParam> fmt::Display for CovenantExt<T> {
478483
CovenantExt::LegacyOutputsPref(p) => p.fmt(f),
479484
CovenantExt::Csfs(c) => c.fmt(f),
480485
CovenantExt::Arith(e) => e.fmt(f),
486+
CovenantExt::Introspect(e) => e.fmt(f),
481487
}
482488
}
483489
}
@@ -511,6 +517,11 @@ where
511517
CovenantExt::Arith(e) => {
512518
CovenantExt::Arith(TranslateExt::<PExt, QExt, PArg, QArg>::translate_ext(e, t)?)
513519
}
520+
CovenantExt::Introspect(e) => {
521+
CovenantExt::Introspect(TranslateExt::<PExt, QExt, PArg, QArg>::translate_ext(
522+
e, t,
523+
)?)
524+
}
514525
};
515526
Ok(ext)
516527
}

0 commit comments

Comments
 (0)