Move a struct in bindings up to define it before it is used
authorMatt Corallo <git@bluematt.me>
Fri, 2 Oct 2020 01:34:26 +0000 (21:34 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 21 Oct 2020 18:50:22 +0000 (14:50 -0400)
This is a limitations in the bindings crate, but not one that's
going to be fixed right now.

lightning/src/chain/mod.rs

index f7ddedef3a3e99b45f3fe8d35399fdce49b6c976..af3fbea44f84856d4d7b4aada676db3a52513f96 100644 (file)
@@ -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<TxOut, AccessError>;
-}
-
 /// 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<TxOut, AccessError>;
+}
+
 /// The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
 /// blocks are connected and disconnected.
 ///