Skip to content

Commit b39b707

Browse files
committed
plan: make LoggerAssetProvider constructible
It looks like we have an example AssetProvider that is intended to be used for testing/debugging. It looks useful but evidently has never been used because it was impossible to construct. Recent versions of rust nightly notice this and output a warning about this, which is causing CI to fail, so we need to fix it. My solution is to make the inner `Assets` public (and also a reference, since there is no need to take ownership) so that people can easily construct and deconstruct the type.
1 parent 9e1b3cd commit b39b707

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub trait AssetProvider<Pk: MiniscriptKey> {
108108

109109
/// Wrapper around [`Assets`] that logs every query and value returned
110110
#[cfg(feature = "std")]
111-
pub struct LoggerAssetProvider(Assets);
111+
pub struct LoggerAssetProvider<'a>(pub &'a Assets);
112112

113113
#[cfg(feature = "std")]
114114
macro_rules! impl_log_method {
@@ -123,7 +123,7 @@ macro_rules! impl_log_method {
123123
}
124124

125125
#[cfg(feature = "std")]
126-
impl AssetProvider<DefiniteDescriptorKey> for LoggerAssetProvider {
126+
impl<'a> AssetProvider<DefiniteDescriptorKey> for LoggerAssetProvider<'a> {
127127
impl_log_method!(provider_lookup_ecdsa_sig, pk: &DefiniteDescriptorKey, -> bool);
128128
impl_log_method!(provider_lookup_tap_key_spend_sig, pk: &DefiniteDescriptorKey, -> Option<usize>);
129129
impl_log_method!(provider_lookup_tap_leaf_script_sig, pk: &DefiniteDescriptorKey, leaf_hash: &TapLeafHash, -> Option<usize>);

0 commit comments

Comments
 (0)