Skip to content

Commit 5c48516

Browse files
committed
call reduce0 from reduce1 and 2
1 parent 18b1b30 commit 5c48516

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/miniscript/decode.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> TerminalStack<Pk, Ctx> {
228228
let top = self.pop().unwrap();
229229
let wrapped_ms = wrap(Arc::new(top));
230230

231-
let ty = Type::type_check(&wrapped_ms)?;
232-
let ext = ExtData::type_check(&wrapped_ms)?;
233-
let ms = Miniscript { node: wrapped_ms, ty, ext, phantom: PhantomData };
234-
Ctx::check_global_validity(&ms)?;
235-
self.0.push(ms);
236-
Ok(())
231+
self.reduce0(wrapped_ms)
237232
}
238233

239234
///reduce, type check and push a 2-arg node
@@ -246,12 +241,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> TerminalStack<Pk, Ctx> {
246241

247242
let wrapped_ms = wrap(Arc::new(left), Arc::new(right));
248243

249-
let ty = Type::type_check(&wrapped_ms)?;
250-
let ext = ExtData::type_check(&wrapped_ms)?;
251-
let ms = Miniscript { node: wrapped_ms, ty, ext, phantom: PhantomData };
252-
Ctx::check_global_validity(&ms)?;
253-
self.0.push(ms);
254-
Ok(())
244+
self.reduce0(wrapped_ms)
255245
}
256246
}
257247

0 commit comments

Comments
 (0)