From 2342550af5325fb7a16b232fe56c4f1cbce1c295 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 1 Oct 2020 21:34:26 -0400 Subject: [PATCH] Move a struct in bindings up to define it before it is used This is a limitations in the bindings crate, but not one that's going to be fixed right now. --- lightning/src/chain/mod.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lightning/src/chain/mod.rs b/lightning/src/chain/mod.rs index f7ddedef3..af3fbea44 100644 --- a/lightning/src/chain/mod.rs +++ b/lightning/src/chain/mod.rs @@ -23,17 +23,6 @@ pub mod channelmonitor; pub mod transaction; pub mod keysinterface; -/// The `Access` trait defines behavior for accessing chain data and state, such as blocks and -/// UTXOs. -pub trait Access: Send + Sync { - /// Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. - /// Returns an error if `genesis_hash` is for a different chain or if such a transaction output - /// is unknown. - /// - /// [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id - fn get_utxo(&self, genesis_hash: &BlockHash, short_channel_id: u64) -> Result; -} - /// An error when accessing the chain via [`Access`]. /// /// [`Access`]: trait.Access.html @@ -46,6 +35,17 @@ pub enum AccessError { UnknownTx, } +/// The `Access` trait defines behavior for accessing chain data and state, such as blocks and +/// UTXOs. +pub trait Access: Send + Sync { + /// Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + /// Returns an error if `genesis_hash` is for a different chain or if such a transaction output + /// is unknown. + /// + /// [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + fn get_utxo(&self, genesis_hash: &BlockHash, short_channel_id: u64) -> Result; +} + /// The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as /// blocks are connected and disconnected. /// -- 2.39.5