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