Skip to content

Commit dcbef52

Browse files
committed
Merge #652: Drop the Property trait entirely
e971e77 types: remove error path from sub-fragment parameter to threshold() (Andrew Poelstra) d4dc226 types: make a ton of constructors const (Andrew Poelstra) fdea7f6 types: drop `Property` trait entirely (Andrew Poelstra) b25023d compiler: remove a bunch of unused error paths (Andrew Poelstra) eb854aa compiler: stop using Property trait in CompilerExtData (Andrew Poelstra) 602fd29 types: remove all Result returns for ExtData (Andrew Poelstra) b6c3ca8 types: don't implement Property for ExtData. (Andrew Poelstra) 87294ff types: don't implement Property for Malleability (Andrew Poelstra) dd0978d types: don't implement Property for Correctness (Andrew Poelstra) 9620380 clippy: fix a couple nits (Andrew Poelstra) 3c1c896 blanket_traits: remove crate:: in a bunch of places (Andrew Poelstra) 9280609 blanket_traits: add some more bounds (Andrew Poelstra) Pull request description: Something of a followup to #649, which specifically removes the `type_check` method from `Property`. Basically, this whole trait is confused. Originally it was supposed to express "a recursively defined property of a Miniscript" which could be defined by a couple constructors and then automatically computed for any Miniscript. In fact, the trait required a separate constructor for every single Miniscript fragment so nothing was "automatic" except sometimes reusing code between the different hash fragments and between `older`/`after`. Furthermore, every implementor of this trait had slightly different requirements, meaning that there were `unreachable!()`s throughout the code, functions that were never called (e.g. `Type::from_sha256` passing through to `Correctness::from_sha256` and `Malleability::from_sha256` when all three of those types implemented the function by calling `from_hash`, which *also* was defined by `Type::from_hash` calling `Correctness::from_hash` and `Malleability::from_hash`. So much boilerplate) and many instances of methods being implemented but ignoring arguments, or (worse) being generic over `Pk`/`Ctx` and ignoring those types entirely, or returning `Result` but always returing the `Ok` variant. So basically, there was no value in being generic over the trait and the trait wasn't even a generalization of any of the types that implemented it. **Adding to this** having the trait prevents us from having constfns in our type checking code, which sucks because we have a lot of common fixed fragments. It also prevents us from returning different error types from different parts of the typechecker, which is my specific goal in removing the trait. This PR has a lot of commits but most of them are mechanical and/or small. ACKs for top commit: sanket1729: ACK e971e77. Looks a lot cleaner. Thanks for these changes. It's nice that we no longer have the artificial error paths because the parent trait had the definition to encompass all possible implementations. Tree-SHA512: 38c254caf938e5c3f84c1f0007e0bfc93180e678aef3968cb8f16ad1544722a0f7cfda2c014056446f0091b198edb12c91c0424df64f68c31f5d316fac28425c
2 parents 95b9337 + e971e77 commit dcbef52

15 files changed

+651
-677
lines changed

src/blanket_traits.rs

+29-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//! automatically implemented if you satisfy all the bounds.
1313
//!
1414
15-
use core::fmt;
1615
use core::str::FromStr;
16+
use core::{fmt, hash};
1717

1818
use crate::MiniscriptKey;
1919

@@ -28,19 +28,43 @@ pub trait FromStrKey:
2828
> + FromStr<Err = Self::_FromStrErr>
2929
{
3030
/// Dummy type. Do not use.
31-
type _Sha256: FromStr<Err = Self::_Sha256FromStrErr>;
31+
type _Sha256: FromStr<Err = Self::_Sha256FromStrErr>
32+
+ Clone
33+
+ Eq
34+
+ Ord
35+
+ fmt::Display
36+
+ fmt::Debug
37+
+ hash::Hash;
3238
/// Dummy type. Do not use.
3339
type _Sha256FromStrErr: fmt::Debug + fmt::Display;
3440
/// Dummy type. Do not use.
35-
type _Hash256: FromStr<Err = Self::_Hash256FromStrErr>;
41+
type _Hash256: FromStr<Err = Self::_Hash256FromStrErr>
42+
+ Clone
43+
+ Eq
44+
+ Ord
45+
+ fmt::Display
46+
+ fmt::Debug
47+
+ hash::Hash;
3648
/// Dummy type. Do not use.
3749
type _Hash256FromStrErr: fmt::Debug + fmt::Display;
3850
/// Dummy type. Do not use.
39-
type _Ripemd160: FromStr<Err = Self::_Ripemd160FromStrErr>;
51+
type _Ripemd160: FromStr<Err = Self::_Ripemd160FromStrErr>
52+
+ Clone
53+
+ Eq
54+
+ Ord
55+
+ fmt::Display
56+
+ fmt::Debug
57+
+ hash::Hash;
4058
/// Dummy type. Do not use.
4159
type _Ripemd160FromStrErr: fmt::Debug + fmt::Display;
4260
/// Dummy type. Do not use.
43-
type _Hash160: FromStr<Err = Self::_Hash160FromStrErr>;
61+
type _Hash160: FromStr<Err = Self::_Hash160FromStrErr>
62+
+ Clone
63+
+ Eq
64+
+ Ord
65+
+ fmt::Display
66+
+ fmt::Debug
67+
+ hash::Hash;
4468
/// Dummy type. Do not use.
4569
type _Hash160FromStrErr: fmt::Debug + fmt::Display;
4670
/// Dummy type. Do not use.

src/descriptor/bare.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use crate::policy::{semantic, Liftable};
2222
use crate::prelude::*;
2323
use crate::util::{varint_len, witness_to_scriptsig};
2424
use crate::{
25-
BareCtx, Error, ForEachKey, Miniscript, MiniscriptKey, Satisfier, ToPublicKey, TranslateErr,
26-
TranslatePk, Translator,
25+
BareCtx, Error, ForEachKey, FromStrKey, Miniscript, MiniscriptKey, Satisfier, ToPublicKey,
26+
TranslateErr, TranslatePk, Translator,
2727
};
2828

2929
/// Create a Bare Descriptor. That is descriptor that is
@@ -166,15 +166,15 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Bare<Pk> {
166166
fn lift(&self) -> Result<semantic::Policy<Pk>, Error> { self.ms.lift() }
167167
}
168168

169-
impl<Pk: crate::FromStrKey> FromTree for Bare<Pk> {
169+
impl<Pk: FromStrKey> FromTree for Bare<Pk> {
170170
fn from_tree(top: &expression::Tree) -> Result<Self, Error> {
171171
let sub = Miniscript::<Pk, BareCtx>::from_tree(top)?;
172172
BareCtx::top_level_checks(&sub)?;
173173
Bare::new(sub)
174174
}
175175
}
176176

177-
impl<Pk: crate::FromStrKey> core::str::FromStr for Bare<Pk> {
177+
impl<Pk: FromStrKey> core::str::FromStr for Bare<Pk> {
178178
type Err = Error;
179179
fn from_str(s: &str) -> Result<Self, Self::Err> {
180180
let desc_str = verify_checksum(s)?;
@@ -364,7 +364,7 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Pkh<Pk> {
364364
}
365365
}
366366

367-
impl<Pk: crate::FromStrKey> FromTree for Pkh<Pk> {
367+
impl<Pk: FromStrKey> FromTree for Pkh<Pk> {
368368
fn from_tree(top: &expression::Tree) -> Result<Self, Error> {
369369
if top.name == "pkh" && top.args.len() == 1 {
370370
Ok(Pkh::new(expression::terminal(&top.args[0], |pk| Pk::from_str(pk))?)?)
@@ -378,7 +378,7 @@ impl<Pk: crate::FromStrKey> FromTree for Pkh<Pk> {
378378
}
379379
}
380380

381-
impl<Pk: crate::FromStrKey> core::str::FromStr for Pkh<Pk> {
381+
impl<Pk: FromStrKey> core::str::FromStr for Pkh<Pk> {
382382
type Err = Error;
383383
fn from_str(s: &str) -> Result<Self, Self::Err> {
384384
let desc_str = verify_checksum(s)?;

src/descriptor/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use crate::miniscript::{satisfy, Legacy, Miniscript, Segwitv0};
2525
use crate::plan::{AssetProvider, Plan};
2626
use crate::prelude::*;
2727
use crate::{
28-
expression, hash256, BareCtx, Error, ForEachKey, MiniscriptKey, Satisfier, ToPublicKey,
29-
TranslateErr, TranslatePk, Translator,
28+
expression, hash256, BareCtx, Error, ForEachKey, FromStrKey, MiniscriptKey, Satisfier,
29+
ToPublicKey, TranslateErr, TranslatePk, Translator,
3030
};
3131

3232
mod bare;
@@ -918,7 +918,7 @@ impl Descriptor<DefiniteDescriptorKey> {
918918
}
919919
}
920920

921-
impl<Pk: crate::FromStrKey> crate::expression::FromTree for Descriptor<Pk> {
921+
impl<Pk: FromStrKey> crate::expression::FromTree for Descriptor<Pk> {
922922
/// Parse an expression tree into a descriptor.
923923
fn from_tree(top: &expression::Tree) -> Result<Descriptor<Pk>, Error> {
924924
Ok(match (top.name, top.args.len() as u32) {
@@ -932,7 +932,7 @@ impl<Pk: crate::FromStrKey> crate::expression::FromTree for Descriptor<Pk> {
932932
}
933933
}
934934

935-
impl<Pk: crate::FromStrKey> FromStr for Descriptor<Pk> {
935+
impl<Pk: FromStrKey> FromStr for Descriptor<Pk> {
936936
type Err = Error;
937937
fn from_str(s: &str) -> Result<Descriptor<Pk>, Error> {
938938
// tr tree parsing has special code

src/descriptor/segwitv0.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use crate::policy::{semantic, Liftable};
2020
use crate::prelude::*;
2121
use crate::util::varint_len;
2222
use crate::{
23-
Error, ForEachKey, Miniscript, MiniscriptKey, Satisfier, Segwitv0, ToPublicKey, TranslateErr,
24-
TranslatePk, Translator,
23+
Error, ForEachKey, FromStrKey, Miniscript, MiniscriptKey, Satisfier, Segwitv0, ToPublicKey,
24+
TranslateErr, TranslatePk, Translator,
2525
};
2626
/// A Segwitv0 wsh descriptor
2727
#[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
@@ -231,7 +231,7 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Wsh<Pk> {
231231
}
232232
}
233233

234-
impl<Pk: crate::FromStrKey> crate::expression::FromTree for Wsh<Pk> {
234+
impl<Pk: FromStrKey> crate::expression::FromTree for Wsh<Pk> {
235235
fn from_tree(top: &expression::Tree) -> Result<Self, Error> {
236236
if top.name == "wsh" && top.args.len() == 1 {
237237
let top = &top.args[0];
@@ -269,7 +269,7 @@ impl<Pk: MiniscriptKey> fmt::Display for Wsh<Pk> {
269269
}
270270
}
271271

272-
impl<Pk: crate::FromStrKey> core::str::FromStr for Wsh<Pk> {
272+
impl<Pk: FromStrKey> core::str::FromStr for Wsh<Pk> {
273273
type Err = Error;
274274
fn from_str(s: &str) -> Result<Self, Self::Err> {
275275
let desc_str = verify_checksum(s)?;
@@ -473,7 +473,7 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Wpkh<Pk> {
473473
}
474474
}
475475

476-
impl<Pk: crate::FromStrKey> crate::expression::FromTree for Wpkh<Pk> {
476+
impl<Pk: FromStrKey> crate::expression::FromTree for Wpkh<Pk> {
477477
fn from_tree(top: &expression::Tree) -> Result<Self, Error> {
478478
if top.name == "wpkh" && top.args.len() == 1 {
479479
Ok(Wpkh::new(expression::terminal(&top.args[0], |pk| Pk::from_str(pk))?)?)
@@ -487,7 +487,7 @@ impl<Pk: crate::FromStrKey> crate::expression::FromTree for Wpkh<Pk> {
487487
}
488488
}
489489

490-
impl<Pk: crate::FromStrKey> core::str::FromStr for Wpkh<Pk> {
490+
impl<Pk: FromStrKey> core::str::FromStr for Wpkh<Pk> {
491491
type Err = Error;
492492
fn from_str(s: &str) -> Result<Self, Self::Err> {
493493
let desc_str = verify_checksum(s)?;

src/descriptor/sh.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use crate::policy::{semantic, Liftable};
2424
use crate::prelude::*;
2525
use crate::util::{varint_len, witness_to_scriptsig};
2626
use crate::{
27-
push_opcode_size, Error, ForEachKey, Legacy, Miniscript, MiniscriptKey, Satisfier, Segwitv0,
28-
ToPublicKey, TranslateErr, TranslatePk, Translator,
27+
push_opcode_size, Error, ForEachKey, FromStrKey, Legacy, Miniscript, MiniscriptKey, Satisfier,
28+
Segwitv0, ToPublicKey, TranslateErr, TranslatePk, Translator,
2929
};
3030

3131
/// A Legacy p2sh Descriptor
@@ -81,7 +81,7 @@ impl<Pk: MiniscriptKey> fmt::Display for Sh<Pk> {
8181
}
8282
}
8383

84-
impl<Pk: crate::FromStrKey> crate::expression::FromTree for Sh<Pk> {
84+
impl<Pk: FromStrKey> crate::expression::FromTree for Sh<Pk> {
8585
fn from_tree(top: &expression::Tree) -> Result<Self, Error> {
8686
if top.name == "sh" && top.args.len() == 1 {
8787
let top = &top.args[0];
@@ -106,7 +106,7 @@ impl<Pk: crate::FromStrKey> crate::expression::FromTree for Sh<Pk> {
106106
}
107107
}
108108

109-
impl<Pk: crate::FromStrKey> core::str::FromStr for Sh<Pk> {
109+
impl<Pk: FromStrKey> core::str::FromStr for Sh<Pk> {
110110
type Err = Error;
111111
fn from_str(s: &str) -> Result<Self, Self::Err> {
112112
let desc_str = verify_checksum(s)?;

src/descriptor/tr.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use crate::policy::Liftable;
2323
use crate::prelude::*;
2424
use crate::util::{varint_len, witness_size};
2525
use crate::{
26-
errstr, Error, ForEachKey, MiniscriptKey, Satisfier, ScriptContext, Tap, ToPublicKey,
27-
TranslateErr, TranslatePk, Translator,
26+
errstr, Error, ForEachKey, FromStrKey, MiniscriptKey, Satisfier, ScriptContext, Tap,
27+
ToPublicKey, TranslateErr, TranslatePk, Translator,
2828
};
2929

3030
/// A Taproot Tree representation.
@@ -467,7 +467,7 @@ where
467467
}
468468

469469
#[rustfmt::skip]
470-
impl<Pk: crate::FromStrKey> Tr<Pk> {
470+
impl<Pk: FromStrKey> Tr<Pk> {
471471
// Helper function to parse taproot script path
472472
fn parse_tr_script_spend(tree: &expression::Tree,) -> Result<TapTree<Pk>, Error> {
473473
match tree {
@@ -488,7 +488,7 @@ impl<Pk: crate::FromStrKey> Tr<Pk> {
488488
}
489489
}
490490

491-
impl<Pk: crate::FromStrKey> crate::expression::FromTree for Tr<Pk> {
491+
impl<Pk: FromStrKey> crate::expression::FromTree for Tr<Pk> {
492492
fn from_tree(top: &expression::Tree) -> Result<Self, Error> {
493493
if top.name == "tr" {
494494
match top.args.len() {
@@ -530,7 +530,7 @@ impl<Pk: crate::FromStrKey> crate::expression::FromTree for Tr<Pk> {
530530
}
531531
}
532532

533-
impl<Pk: crate::FromStrKey> core::str::FromStr for Tr<Pk> {
533+
impl<Pk: FromStrKey> core::str::FromStr for Tr<Pk> {
534534
type Err = Error;
535535
fn from_str(s: &str) -> Result<Self, Self::Err> {
536536
let desc_str = verify_checksum(s)?;

src/miniscript/astelem.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ use crate::miniscript::{types, ScriptContext};
1919
use crate::prelude::*;
2020
use crate::util::MsKeyBuilder;
2121
use crate::{
22-
errstr, expression, AbsLockTime, Error, Miniscript, MiniscriptKey, Terminal, ToPublicKey,
22+
errstr, expression, AbsLockTime, Error, FromStrKey, Miniscript, MiniscriptKey, Terminal,
23+
ToPublicKey,
2324
};
2425

2526
impl<Pk: MiniscriptKey, Ctx: ScriptContext> Terminal<Pk, Ctx> {
@@ -240,15 +241,13 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> fmt::Display for Terminal<Pk, Ctx> {
240241
}
241242
}
242243

243-
impl<Pk: crate::FromStrKey, Ctx: ScriptContext> crate::expression::FromTree
244-
for Arc<Terminal<Pk, Ctx>>
245-
{
244+
impl<Pk: FromStrKey, Ctx: ScriptContext> crate::expression::FromTree for Arc<Terminal<Pk, Ctx>> {
246245
fn from_tree(top: &expression::Tree) -> Result<Arc<Terminal<Pk, Ctx>>, Error> {
247246
Ok(Arc::new(expression::FromTree::from_tree(top)?))
248247
}
249248
}
250249

251-
impl<Pk: crate::FromStrKey, Ctx: ScriptContext> crate::expression::FromTree for Terminal<Pk, Ctx> {
250+
impl<Pk: FromStrKey, Ctx: ScriptContext> crate::expression::FromTree for Terminal<Pk, Ctx> {
252251
fn from_tree(top: &expression::Tree) -> Result<Terminal<Pk, Ctx>, Error> {
253252
let (frag_name, frag_wrap) = super::split_expression_name(top.name)?;
254253
let unwrapped = match (frag_name, top.args.len()) {

src/miniscript/mod.rs

+17-20
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ use crate::miniscript::decode::Terminal;
4545
use crate::miniscript::types::extra_props::ExtData;
4646
use crate::miniscript::types::Type;
4747
use crate::{
48-
expression, plan, Error, ForEachKey, MiniscriptKey, ToPublicKey, TranslatePk, Translator,
48+
expression, plan, Error, ForEachKey, FromStrKey, MiniscriptKey, ToPublicKey, TranslatePk,
49+
Translator,
4950
};
5051
#[cfg(test)]
5152
mod ms_tests;
@@ -617,7 +618,7 @@ where
617618
Ok(ms)
618619
}
619620

620-
impl<Pk: crate::FromStrKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
621+
impl<Pk: FromStrKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
621622
/// Attempt to parse an insane(scripts don't clear sanity checks)
622623
/// from string into a Miniscript representation.
623624
/// Use this to parse scripts with repeated pubkeys, timelock mixing, malleable
@@ -648,17 +649,13 @@ impl<Pk: crate::FromStrKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
648649
}
649650
}
650651

651-
impl<Pk: crate::FromStrKey, Ctx: ScriptContext> crate::expression::FromTree
652-
for Arc<Miniscript<Pk, Ctx>>
653-
{
652+
impl<Pk: FromStrKey, Ctx: ScriptContext> crate::expression::FromTree for Arc<Miniscript<Pk, Ctx>> {
654653
fn from_tree(top: &expression::Tree) -> Result<Arc<Miniscript<Pk, Ctx>>, Error> {
655654
Ok(Arc::new(expression::FromTree::from_tree(top)?))
656655
}
657656
}
658657

659-
impl<Pk: crate::FromStrKey, Ctx: ScriptContext> crate::expression::FromTree
660-
for Miniscript<Pk, Ctx>
661-
{
658+
impl<Pk: FromStrKey, Ctx: ScriptContext> crate::expression::FromTree for Miniscript<Pk, Ctx> {
662659
/// Parse an expression tree into a Miniscript. As a general rule, this
663660
/// should not be called directly; rather go through the descriptor API.
664661
fn from_tree(top: &expression::Tree) -> Result<Miniscript<Pk, Ctx>, Error> {
@@ -667,7 +664,7 @@ impl<Pk: crate::FromStrKey, Ctx: ScriptContext> crate::expression::FromTree
667664
}
668665
}
669666

670-
impl<Pk: crate::FromStrKey, Ctx: ScriptContext> str::FromStr for Miniscript<Pk, Ctx> {
667+
impl<Pk: FromStrKey, Ctx: ScriptContext> str::FromStr for Miniscript<Pk, Ctx> {
671668
type Err = Error;
672669
/// Parse a Miniscript from string and perform sanity checks
673670
/// See [Miniscript::from_str_insane] to parse scripts from string that
@@ -705,7 +702,7 @@ mod tests {
705702
use sync::Arc;
706703

707704
use super::{Miniscript, ScriptContext, Segwitv0, Tap};
708-
use crate::miniscript::types::{self, ExtData, Property, Type};
705+
use crate::miniscript::types::{self, ExtData, Type};
709706
use crate::miniscript::Terminal;
710707
use crate::policy::Liftable;
711708
use crate::prelude::*;
@@ -893,17 +890,17 @@ mod tests {
893890

894891
let pk_node = Terminal::Check(Arc::new(Miniscript {
895892
node: Terminal::PkK(String::from("")),
896-
ty: Type::from_pk_k::<Segwitv0>(),
897-
ext: types::extra_props::ExtData::from_pk_k::<Segwitv0>(),
893+
ty: Type::pk_k(),
894+
ext: types::extra_props::ExtData::pk_k::<Segwitv0>(),
898895
phantom: PhantomData,
899896
}));
900897
let pkk_ms: Miniscript<String, Segwitv0> = Miniscript::from_ast(pk_node).unwrap();
901898
dummy_string_rtt(pkk_ms, "[B/onduesm]c:[K/onduesm]pk_k(\"\")", "pk()");
902899

903900
let pkh_node = Terminal::Check(Arc::new(Miniscript {
904901
node: Terminal::PkH(String::from("")),
905-
ty: Type::from_pk_h::<Segwitv0>(),
906-
ext: types::extra_props::ExtData::from_pk_h::<Segwitv0>(),
902+
ty: Type::pk_h(),
903+
ext: types::extra_props::ExtData::pk_h::<Segwitv0>(),
907904
phantom: PhantomData,
908905
}));
909906
let pkh_ms: Miniscript<String, Segwitv0> = Miniscript::from_ast(pkh_node).unwrap();
@@ -923,8 +920,8 @@ mod tests {
923920

924921
let pkk_node = Terminal::Check(Arc::new(Miniscript {
925922
node: Terminal::PkK(pk),
926-
ty: Type::from_pk_k::<Segwitv0>(),
927-
ext: types::extra_props::ExtData::from_pk_k::<Segwitv0>(),
923+
ty: Type::pk_k(),
924+
ext: types::extra_props::ExtData::pk_k::<Segwitv0>(),
928925
phantom: PhantomData,
929926
}));
930927
let pkk_ms: Segwitv0Script = Miniscript::from_ast(pkk_node).unwrap();
@@ -938,12 +935,12 @@ mod tests {
938935
let pkh_ms: Segwitv0Script = Miniscript {
939936
node: Terminal::Check(Arc::new(Miniscript {
940937
node: Terminal::RawPkH(hash),
941-
ty: Type::from_pk_h::<Segwitv0>(),
942-
ext: types::extra_props::ExtData::from_pk_h::<Segwitv0>(),
938+
ty: Type::pk_h(),
939+
ext: types::extra_props::ExtData::pk_h::<Segwitv0>(),
943940
phantom: PhantomData,
944941
})),
945-
ty: Type::cast_check(Type::from_pk_h::<Segwitv0>()).unwrap(),
946-
ext: ExtData::cast_check(ExtData::from_pk_h::<Segwitv0>()).unwrap(),
942+
ty: Type::cast_check(Type::pk_h()).unwrap(),
943+
ext: ExtData::cast_check(ExtData::pk_h::<Segwitv0>()),
947944
phantom: PhantomData,
948945
};
949946

0 commit comments

Comments
 (0)