File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -771,7 +771,7 @@ impl Descriptor<DescriptorPublicKey> {
771
771
let descriptor = Descriptor :: < String > :: from_str ( s) ?;
772
772
let descriptor = descriptor
773
773
. translate_pk ( & mut keymap_pk)
774
- . map_err ( |e| e . expect_translator_err ( "No Outer context errors" ) ) ?;
774
+ . map_err ( TranslateErr :: flatten ) ?;
775
775
776
776
Ok ( ( descriptor, keymap_pk. 0 ) )
777
777
}
Original file line number Diff line number Diff line change @@ -364,6 +364,17 @@ impl<E> TranslateErr<E> {
364
364
}
365
365
}
366
366
367
+ impl TranslateErr < Error > {
368
+ /// If we are doing a translation where our "outer error" is the generic
369
+ /// Miniscript error, eliminate the `TranslateErr` type which is just noise.
370
+ pub fn flatten ( self ) -> Error {
371
+ match self {
372
+ Self :: TranslatorErr ( e) => e,
373
+ Self :: OuterError ( e) => e,
374
+ }
375
+ }
376
+ }
377
+
367
378
impl < E > From < E > for TranslateErr < E > {
368
379
fn from ( v : E ) -> Self { Self :: TranslatorErr ( v) }
369
380
}
You can’t perform that action at this time.
0 commit comments