Skip to content

Commit dc502f4

Browse files
committed
Merge #697: plan: make LoggerAssetProvider constructible
c79639d clippy: fix doc indentation (Andrew Poelstra) b39b707 plan: make LoggerAssetProvider constructible (Andrew Poelstra) Pull request description: 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. ACKs for top commit: tcharding: ACK c79639d sanket1729: ACK c79639d Tree-SHA512: c19e00c88f79edd7b99632470b556385a36ba59112d8015222321581f87d0110f155fc725bfc05187201fc7a3845998427887852d09bda0e20354570de4b7e8e
2 parents 9e1b3cd + c79639d commit dc502f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl<E> TranslateErr<E> {
344344
/// - SegwitV0 does not allow uncompressed keys and x_only keys
345345
/// - Tapscript does not allow uncompressed keys
346346
/// - Translating into multi-path descriptors should have same number of path
347-
/// for all the keys in the descriptor
347+
/// for all the keys in the descriptor
348348
///
349349
/// # Panics
350350
///

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)