From: Matt Corallo Date: Fri, 18 Sep 2020 22:01:10 +0000 (-0400) Subject: derive(Debug) on Events X-Git-Tag: v0.0.12~22^2~4 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=e7678d42d9563a84e8c60f57237e5e80df98a4d4;p=rust-lightning derive(Debug) on Events We'd previously largely not turned on derive(Debug) on any of our structs, but not for good reason. Especially for Events objects, Debug can be a very useful for users to quickly print what they received from us without having to write out a large match. --- diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 1cc41b0f8..5599bfbb9 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -45,7 +45,7 @@ use ln::msgs::DecodeError; /// spend on-chain. The information needed to do this is provided in this enum, including the /// outpoint describing which txid and output index is available, the full output which exists at /// that txid/index, and any keys or other information required to sign. -#[derive(Clone, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum SpendableOutputDescriptor { /// An output to a script which was provided via KeysInterface, thus you should already know /// how to spend it. No keys are provided as rust-lightning was never given any keys - only the diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index 21b535408..60191b886 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -31,6 +31,7 @@ use std::time::Duration; /// Note that while Writeable and Readable are implemented for Event, you probably shouldn't use /// them directly as they don't round-trip exactly (for example FundingGenerationReady is never /// written as it makes no sense to respond to it after reconnecting to peers). +#[derive(Debug)] pub enum Event { /// Used to indicate that the client should generate a funding transaction with the given /// parameters and then call ChannelManager::funding_transaction_generated.