From: Matt Corallo Date: Fri, 2 Oct 2020 01:34:26 +0000 (-0400) Subject: Move a struct in bindings up to define it before it is used X-Git-Tag: v0.0.12~7^2~9 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=2342550af5325fb7a16b232fe56c4f1cbce1c295;hp=6df3aa76c300979ff34847830e4caaa787511825;p=rust-lightning 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. --- diff --git a/lightning/src/chain/mod.rs b/lightning/src/chain/mod.rs index f7ddedef..af3fbea4 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. ///