@@ -257,6 +257,8 @@ pub enum CovenantExt<T: ExtParam> {
257
257
Csfs ( CheckSigFromStack < T > ) ,
258
258
/// Arith opcodes
259
259
Arith ( Arith ) ,
260
+ /// Cov opcodes
261
+ Introspect ( CovOps < T > ) ,
260
262
}
261
263
262
264
/// All known Extension parameters/arguments
@@ -393,6 +395,7 @@ macro_rules! all_arms_fn {
393
395
CovenantExt :: LegacyOutputsPref ( p) => <LegacyOutputsPref as $trt>:: $f( p, $( $args, ) * ) ,
394
396
CovenantExt :: Csfs ( csfs) => csfs. $f( $( $args, ) * ) ,
395
397
CovenantExt :: Arith ( e) => e. $f( $( $args, ) * ) ,
398
+ CovenantExt :: Introspect ( e) => e. $f( $( $args, ) * ) ,
396
399
}
397
400
} ;
398
401
}
@@ -409,7 +412,9 @@ macro_rules! try_from_arms {
409
412
Ok ( CovenantExt :: Csfs ( v) )
410
413
} else if let Ok ( v) = <Arith as $trt>:: $f( $( $args, ) * ) {
411
414
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 {
413
418
Err ( ( ) )
414
419
}
415
420
} ;
@@ -478,6 +483,7 @@ impl<T: ExtParam> fmt::Display for CovenantExt<T> {
478
483
CovenantExt :: LegacyOutputsPref ( p) => p. fmt ( f) ,
479
484
CovenantExt :: Csfs ( c) => c. fmt ( f) ,
480
485
CovenantExt :: Arith ( e) => e. fmt ( f) ,
486
+ CovenantExt :: Introspect ( e) => e. fmt ( f) ,
481
487
}
482
488
}
483
489
}
@@ -511,6 +517,11 @@ where
511
517
CovenantExt :: Arith ( e) => {
512
518
CovenantExt :: Arith ( TranslateExt :: < PExt , QExt , PArg , QArg > :: translate_ext ( e, t) ?)
513
519
}
520
+ CovenantExt :: Introspect ( e) => {
521
+ CovenantExt :: Introspect ( TranslateExt :: < PExt , QExt , PArg , QArg > :: translate_ext (
522
+ e, t,
523
+ ) ?)
524
+ }
514
525
} ;
515
526
Ok ( ext)
516
527
}
0 commit comments