Cesar Rodas 5 сар өмнө
parent
commit
4f44990cdf

+ 3 - 0
crates/cdk-signatory/src/db_signatory.rs

@@ -1,3 +1,6 @@
+//! Main Signatory implementation
+//!
+//! It is named db_signatory because it uses a database to maintain state.
 use std::collections::HashMap;
 use std::sync::Arc;
 

+ 2 - 0
crates/cdk-signatory/src/embedded.rs

@@ -45,6 +45,8 @@ impl Drop for Service {
 }
 
 impl Service {
+    /// Takes a signatory and spawns it into a Tokio task, isolating its implementation with the
+    /// main thread, communicating with it through messages
     pub fn new(handler: Arc<dyn Signatory + Send + Sync>) -> Self {
         let (tx, rx) = mpsc::channel(10_000);
         let runner = Some(tokio::spawn(Self::runner(rx, handler)));

+ 2 - 0
crates/cdk-signatory/src/lib.rs

@@ -5,6 +5,8 @@
 //!
 //! Even if it is embedded in the same process, the keys are not accessible from the outside of this
 //! module, all communication is done through the Signatory trait and the signatory manager.
+#![deny(missing_docs)]
+#![deny(warnings)]
 
 #[cfg(feature = "grpc")]
 mod proto;

+ 7 - 0
crates/cdk-signatory/src/signatory.rs

@@ -63,10 +63,15 @@ pub struct SignatoryKeysets {
 /// This struct is used to represent a keyset and its info, pretty much all the information but the
 /// private key, that will never leave the signatory
 pub struct SignatoryKeySet {
+    /// The keyset Id
     pub id: Id,
+    /// The Currency Unit
     pub unit: CurrencyUnit,
+    /// Whether to set it as active or not
     pub active: bool,
+    /// The list of public keys
     pub keys: Keys,
+    /// Information about the fee per public key
     pub input_fee_ppk: u64,
 }
 
@@ -123,6 +128,8 @@ impl From<&(MintKeySetInfo, MintKeySet)> for SignatoryKeySet {
 #[async_trait::async_trait]
 /// Signatory trait
 pub trait Signatory {
+    /// The Signatory implementation name. This may be exposed, so being as discreet as possible is
+    /// advised.
     fn name(&self) -> String;
 
     /// Blind sign a message.

+ 2 - 2
crates/cdk/src/mint/mod.rs

@@ -53,8 +53,8 @@ pub use verification::Verification;
 pub struct Mint {
     /// Signatory backend.
     ///
-    /// It is mainly implemented in the cdk-signatory crate, and it can be embedded in the mint or
-    /// it can be a gRPC client to a remote signatory server.
+    /// It is implemented in the cdk-signatory crate, and it can be embedded in the mint or it can
+    /// be a gRPC client to a remote signatory server.
     pub signatory: Arc<dyn Signatory + Send + Sync>,
     /// Mint Storage backend
     pub localstore: Arc<dyn MintDatabase<database::Error> + Send + Sync>,