]> Untitled Git - bdk/commitdiff
[verify] Add documentation
authorAlekos Filini <alekos.filini@gmail.com>
Fri, 18 Jun 2021 11:16:58 +0000 (13:16 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Thu, 1 Jul 2021 14:36:56 +0000 (16:36 +0200)
src/wallet/verify.rs

index 2d5c193ceab0d0f6e167224189c3c327756742fe..c5acf5262e1d38e24136ccd5cf6f3da4477f9717 100644 (file)
@@ -9,6 +9,8 @@
 // You may not use this file except in accordance with one or both of these
 // licenses.
 
+//! Verify transactions against the consensus rules
+
 use std::collections::HashMap;
 use std::fmt;
 
@@ -68,13 +70,20 @@ pub fn verify_tx<D: Database, B: Blockchain>(
     Ok(())
 }
 
+/// Error during validation of a tx agains the consensus rules
 #[derive(Debug)]
 pub enum VerifyError {
+    /// The transaction being spent is not available in the database or the blockchain client
     MissingInputTx(Txid),
+    /// The transaction being spent doesn't have the requested output
     InvalidInput(OutPoint),
 
+    /// Consensus error
     Consensus(bitcoinconsensus::Error),
 
+    /// Generic error
+    ///
+    /// It has to be wrapped in a `Box` since `Error` has a variant that contains this enum
     Global(Box<Error>),
 }