Skip to content

Commit

Permalink
Fix rustdoc warnings (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu authored Jul 14, 2024
1 parent 07c00eb commit 0616efc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
11 changes: 6 additions & 5 deletions crates/pallet-bitcoin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! # Bitcoin Pallet
//!
//! This pallet is designed to be minimalist, containing only one storage item for maintaining the state
//! of the UTXO (Unspent Transaction Output) set by processing the inputs and outputs of each Bitcoin
//! transaction wrapped in [`Call::transact`]. There is no verification logic within the
//! pallet, all validation work should be performed outside the runtime. This approach simplifies
//! off-runtime execution, allowing for easier syncing performance optimization.
//! This pallet is designed to be minimalist, containing only one storage item for maintaining
//! the state of the UTXO (Unspent Transaction Output) set by processing the inputs and outputs
//! of each Bitcoin transaction wrapped in [`Call::transact`]. There is no verification logic
//! within the pallet, all validation work should be performed outside the runtime. This approach
//! simplifies off-runtime execution, allowing for easier syncing performance optimization off
//! chain.

// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
Expand Down
20 changes: 20 additions & 0 deletions crates/sc-consensus-nakamoto/src/block_import.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
//! This module provides the implementation for importing Bitcoin blocks into Subcoin.
//!
//! Each Bitcoin block is converted into a Substrate block and imported into the database.
//! The Bitcoin header is included in the Substrate header as a `DigestItem`, each Bitcoin
//! transaction is wrapped into an unsigned extrinsic defined in pallet-bitcoin.
//!
//! Key components:
//!
//! - [`BitcoinBlockImporter`]
//! The main struct responsible for importing Bitcoin blocks and managing the import process.
//!
//! - [`BitcoinBlockImport`]
//! An async trait for importing Bitcoin blocks, which is implemented by [`BitcoinBlockImporter`].
//!
//! - [`ImportConfig`]
//! Configuration for block import, including network type, verification level, and execution options.
//!
//! - [`ImportStatus`]
//! An enum representing the result of an import operation, with variants for different import outcomes.

use crate::block_executor::{BlockExecutor, ExecuteBlockResult};
use crate::verification::{BlockVerification, BlockVerifier};
use bitcoin::hashes::Hash;
Expand Down
2 changes: 1 addition & 1 deletion crates/sc-consensus-nakamoto/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async fn block_import_process(

type BlockImportStatus = sc_consensus::BlockImportStatus<u32>;

/// Result of [`import_many_blocks`].
/// Result of `import_many_blocks`.
#[derive(Debug)]
pub struct ImportManyBlocksResult {
/// The number of blocks imported successfully.
Expand Down
4 changes: 4 additions & 0 deletions crates/subcoin-node/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! Subcoin Node Library.
//!
//! The main feature of this library is to start and run the node as a CLI application.

mod cli;
mod commands;
mod rpc;
Expand Down
2 changes: 1 addition & 1 deletion crates/subcoin-rpc/src/subcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
Block: BlockT + 'static,
Client: HeaderBackend<Block> + BlockBackend<Block> + AuxStore + 'static,
{
/// Constructs a new instance of [`Blockchain`].
/// Constructs a new instance of [`Subcoin`].
pub fn new(client: Arc<Client>, network_handle: NetworkHandle) -> Self {
Self {
client,
Expand Down
7 changes: 4 additions & 3 deletions crates/subcoin-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Subcoin runtime is a minimalistic Substrate runtime, it does not implement all the typical
//! runtime APIs the other runtimes would do.
//! Subcoin runtime is a minimalistic Substrate runtime consisting of frame-system and
//! pallet-bitcoin. It does not implement all the typical runtime APIs the normal runtimes
//! would do as many of them does not make sense in Subcoin.

#![cfg_attr(not(feature = "std"), no_std)]

Expand Down Expand Up @@ -255,7 +256,7 @@ mod types_common {
// circular dependency (self-referential generics).
pub type BlockOf<T, Extra = ()> = generic::Block<HeaderInner, ExtrinsicInner<T, Extra>>;

/// The opaque block type. This is the same [`BlockOf`], but it has
/// The opaque block type. This is the same `BlockOf`, but it has
/// [`sp_runtime::OpaqueExtrinsic`] as its final extrinsic type.
///
/// This should be provided to the client side as the extrinsic type.
Expand Down

0 comments on commit 0616efc

Please sign in to comment.