@@ -33,15 +33,17 @@ use crate::{DefiniteDescriptorKey, DescriptorPublicKey, Error, MiniscriptKey, To
33
33
34
34
/// Trait describing a present/missing lookup table for constructing witness templates
35
35
///
36
- /// This trait mirrors the [`Satisfier`] trait with the difference that instead of returning the
37
- /// item if it's present, it only returns a boolean to indicate its presence.
36
+ /// This trait mirrors the [`Satisfier`] trait, with the difference that most methods just return a
37
+ /// boolean indicating the item presence. The methods looking up keys return the key
38
+ /// length, the methods looking up public key hashes return the public key, and a few other methods
39
+ /// need to return the item itself.
38
40
///
39
41
/// This trait is automatically implemented for every type that is also a satisfier, and simply
40
42
/// proxies the queries to the satisfier and returns whether an item is available or not.
41
43
///
42
- /// All the methods have a default implementation that returns `false`.
44
+ /// All the methods have a default implementation that returns `false` or `None` .
43
45
pub trait AssetProvider < Pk : MiniscriptKey > {
44
- /// Given a public key, look up an ECDSA signature with that key
46
+ /// Given a public key, look up an ECDSA signature with that key, return whether we found it
45
47
fn provider_lookup_ecdsa_sig ( & self , _: & Pk ) -> bool {
46
48
false
47
49
}
@@ -51,7 +53,7 @@ pub trait AssetProvider<Pk: MiniscriptKey> {
51
53
None
52
54
}
53
55
54
- /// Given a public key and a associated leaf hash, look up an schnorr signature with that key
56
+ /// Given a public key and a associated leaf hash, look up a schnorr signature with that key
55
57
/// and return its size
56
58
fn provider_lookup_tap_leaf_script_sig ( & self , _: & Pk , _: & TapLeafHash ) -> Option < usize > {
57
59
None
@@ -95,22 +97,22 @@ pub trait AssetProvider<Pk: MiniscriptKey> {
95
97
None
96
98
}
97
99
98
- /// Given a SHA256 hash, look up its preimage
100
+ /// Given a SHA256 hash, look up its preimage, return whether we found it
99
101
fn provider_lookup_sha256 ( & self , _: & Pk :: Sha256 ) -> bool {
100
102
false
101
103
}
102
104
103
- /// Given a HASH256 hash, look up its preimage
105
+ /// Given a HASH256 hash, look up its preimage, return whether we found it
104
106
fn provider_lookup_hash256 ( & self , _: & Pk :: Hash256 ) -> bool {
105
107
false
106
108
}
107
109
108
- /// Given a RIPEMD160 hash, look up its preimage
110
+ /// Given a RIPEMD160 hash, look up its preimage, return whether we found it
109
111
fn provider_lookup_ripemd160 ( & self , _: & Pk :: Ripemd160 ) -> bool {
110
112
false
111
113
}
112
114
113
- /// Given a HASH160 hash, look up its preimage
115
+ /// Given a HASH160 hash, look up its preimage, return whether we found it
114
116
fn provider_lookup_hash160 ( & self , _: & Pk :: Hash160 ) -> bool {
115
117
false
116
118
}
0 commit comments