diff --git a/src/miniscript/mod.rs b/src/miniscript/mod.rs index 2bbfc4822..65c2da9f6 100644 --- a/src/miniscript/mod.rs +++ b/src/miniscript/mod.rs @@ -163,7 +163,7 @@ mod private { pub fn from_ast(t: Terminal) -> Result, Error> { let res = Miniscript { ty: Type::type_check(&t)?, - ext: ExtData::type_check(&t)?, + ext: ExtData::type_check(&t), node: t, phantom: PhantomData, }; diff --git a/src/miniscript/types/extra_props.rs b/src/miniscript/types/extra_props.rs index 4f4a92840..3db46b89f 100644 --- a/src/miniscript/types/extra_props.rs +++ b/src/miniscript/types/extra_props.rs @@ -6,7 +6,7 @@ use core::cmp; use core::iter::once; -use super::{Error, ScriptContext}; +use super::ScriptContext; use crate::miniscript::context::SigType; use crate::prelude::*; use crate::{script_num_size, AbsLockTime, MiniscriptKey, RelLockTime, Terminal}; @@ -924,7 +924,7 @@ impl ExtData { /// Compute the type of a fragment assuming all the children of /// Miniscript have been computed already. - pub fn type_check(fragment: &Terminal) -> Result + pub fn type_check(fragment: &Terminal) -> Self where Ctx: ScriptContext, Pk: MiniscriptKey, @@ -990,7 +990,7 @@ impl ExtData { } }; ret.sanity_checks(); - Ok(ret) + ret } } diff --git a/src/policy/compiler.rs b/src/policy/compiler.rs index cf6d5bc9d..2d97b6886 100644 --- a/src/policy/compiler.rs +++ b/src/policy/compiler.rs @@ -540,7 +540,7 @@ impl AstElemExt { //Types and ExtData are already cached and stored in children. So, we can //type_check without cache. For Compiler extra data, we supply a cache. let ty = types::Type::type_check(&ast)?; - let ext = types::ExtData::type_check(&ast)?; + let ext = types::ExtData::type_check(&ast); let comp_ext_data = CompilerExtData::type_check_with_child(&ast, lookup_ext); Ok(AstElemExt { ms: Arc::new(Miniscript::from_components_unchecked(ast, ty, ext)), @@ -563,7 +563,7 @@ impl AstElemExt { //Types and ExtData are already cached and stored in children. So, we can //type_check without cache. For Compiler extra data, we supply a cache. let ty = types::Type::type_check(&ast)?; - let ext = types::ExtData::type_check(&ast)?; + let ext = types::ExtData::type_check(&ast); let comp_ext_data = CompilerExtData::type_check_with_child(&ast, lookup_ext); Ok(AstElemExt { ms: Arc::new(Miniscript::from_components_unchecked(ast, ty, ext)),