From e7678d42d9563a84e8c60f57237e5e80df98a4d4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 18 Sep 2020 18:01:10 -0400 Subject: [PATCH] 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. --- lightning/src/chain/keysinterface.rs | 2 +- lightning/src/util/events.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 1cc41b0f..5599bfbb 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 21b53540..60191b88 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. -- 2.30.2