diff --git a/src/ast.rs b/src/ast.rs index 32a1aec..8d97a8f 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -20,7 +20,7 @@ use crate::value::{UIntValue, Value}; use crate::{impl_eq_hash, parse}; /// Map of witness names to their expected type, as declared in the program. -#[derive(Clone, Debug, Eq, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq, Default)] pub struct DeclaredWitnesses(HashMap); impl DeclaredWitnesses { diff --git a/src/lib.rs b/src/lib.rs index 30fd4d5..b33c76e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,6 +39,17 @@ pub struct CompiledProgram { debug_symbols: DebugSymbols, } +impl Default for CompiledProgram { + fn default() -> Self { + use simplicity::node::CoreConstructible; + Self { + simplicity: ProgNode::unit(&simplicity::types::Context::new()), + witness_types: DeclaredWitnesses::default(), + debug_symbols: DebugSymbols::default(), + } + } +} + impl CompiledProgram { /// Parse and compile a Simfony program from the given string. ///