Skip to content

Commit

Permalink
chore(rooch-types): improve struct documentation
Browse files Browse the repository at this point in the history
Clarified struct purpose by aligning doc comments with existing definitions. This enhances code readability and aligns with Rust's documentation conventions.
  • Loading branch information
popcnt1 committed Jan 13, 2025
1 parent ed98b06 commit aa74dff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/rooch-types/src/da/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use moveos_types::h256;
use moveos_types::h256::{sha2_256_of, H256};
use serde::{Deserialize, Serialize};

#[derive(Eq, PartialEq, Hash, Deserialize, Serialize, Clone, Debug)]
/// The tx order range of the block.
#[derive(Eq, PartialEq, Hash, Deserialize, Serialize, Clone, Debug)]
pub struct BlockRange {
/// The Rooch block number for DA, each batch maps to a block
pub block_number: u128,
Expand All @@ -25,8 +25,8 @@ impl BlockRange {
}
}

#[derive(Eq, PartialEq, Hash, Deserialize, Serialize, Clone, Debug)]
/// The state of the block submission.
#[derive(Eq, PartialEq, Hash, Deserialize, Serialize, Clone, Debug)]
pub struct BlockSubmitState {
/// tx order range of the block
pub block_range: BlockRange,
Expand Down Expand Up @@ -67,8 +67,8 @@ impl BlockSubmitState {
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
/// Meta of DA batch
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct DABatchMeta {
/// tx order range of the block
pub block_range: BlockRange,
Expand Down Expand Up @@ -100,8 +100,8 @@ pub struct SignedDABatchMeta {
pub signature: Vec<u8>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
/// A batch is a collection of transactions. It is the unit of data flow in DA Stream
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct DABatch {
/// The metadata of the batch
pub meta: DABatchMeta,
Expand Down

0 comments on commit aa74dff

Please sign in to comment.