@@ -307,6 +307,9 @@ pub enum Error {
307307 BadDescriptor ,
308308 ///Forward-secp related errors
309309 Secp ( secp256k1:: Error ) ,
310+ #[ cfg( feature = "compiler" ) ]
311+ ///Compiler related errors
312+ CompilerError ( policy:: compiler:: CompilerError ) ,
310313 ///Interpreter related errors
311314 InterpreterError ( descriptor:: InterpreterError ) ,
312315 /// Bad Script Sig. As per standardness rules, only pushes are allowed in
@@ -395,6 +398,8 @@ impl fmt::Display for Error {
395398 Error :: BadDescriptor => f. write_str ( "could not create a descriptor" ) ,
396399 Error :: Secp ( ref e) => fmt:: Display :: fmt ( e, f) ,
397400 Error :: InterpreterError ( ref e) => fmt:: Display :: fmt ( e, f) ,
401+ #[ cfg( feature = "compiler" ) ]
402+ Error :: CompilerError ( ref e) => fmt:: Display :: fmt ( e, f) ,
398403 Error :: BadScriptSig => f. write_str ( "Script sig must only consist of pushes" ) ,
399404 Error :: NonEmptyWitness => f. write_str ( "Non empty witness for Pk/Pkh" ) ,
400405 Error :: NonEmptyScriptSig => f. write_str ( "Non empty script sig for segwit spend" ) ,
@@ -415,6 +420,14 @@ impl From<psbt::Error> for Error {
415420 }
416421}
417422
423+ #[ doc( hidden) ]
424+ #[ cfg( feature = "compiler" ) ]
425+ impl From < policy:: compiler:: CompilerError > for Error {
426+ fn from ( e : policy:: compiler:: CompilerError ) -> Error {
427+ Error :: CompilerError ( e)
428+ }
429+ }
430+
418431/// The size of an encoding of a number in Script
419432pub fn script_num_size ( n : usize ) -> usize {
420433 match n {
0 commit comments