derive(Debug) on Events
authorMatt Corallo <git@bluematt.me>
Fri, 18 Sep 2020 22:01:10 +0000 (18:01 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 18 Sep 2020 22:29:48 +0000 (18:29 -0400)
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.

lightning/src/chain/keysinterface.rs
lightning/src/util/events.rs

index 1cc41b0f8fa6882f498997eb2840f6ac605f9bdc..5599bfbb9fd763e88c58dd475735ace5a86a0079 100644 (file)
@@ -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
index 21b535408b07e255e29e8b86c6e3fe42d14c9a05..60191b886d59222bf7b2310e2f80264942cce70c 100644 (file)
@@ -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.