Skip to content

Commit

Permalink
fix: Fix clippy issues (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblique authored Jul 25, 2024
1 parent 986fa55 commit ac8b216
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion node/src/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl P2p {
}

/// Creates and starts a new mocked p2p handler.
#[cfg(test)]
#[cfg(any(test, feature = "test-utils"))]
pub fn mocked() -> (Self, crate::test_utils::MockP2pHandle) {
let (cmd_tx, cmd_rx) = mpsc::channel(16);
let (peer_tracker_tx, peer_tracker_rx) = watch::channel(PeerTrackerInfo::default());
Expand Down
10 changes: 6 additions & 4 deletions types/src/nmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,19 @@ pub type Proof = nmt_rs::simple_merkle::proof::Proof<NamespacedSha2Hasher>;
/// followed by 28 bytes specifying concrete ID of the namespace.
///
/// Currently there are two versions of namespaces:
///
/// - version `0` - the one allowing for the custom namespace ids. It requires an id to start
/// with 18 `0x00` bytes followed by a user specified suffix (except reserved ones, see below).
/// with 18 `0x00` bytes followed by a user specified suffix (except reserved ones, see below).
/// - version `255` - for secondary reserved namespaces. It requires an id to start with 27
/// `0xff` bytes followed by a single byte indicating the id.
/// `0xff` bytes followed by a single byte indicating the id.
///
/// Some namespaces are reserved for the block creation purposes and cannot be used
/// when submitting the blobs to celestia. Those fall into one of the two categories:
///
/// - primary reserved namespaces - those use version `0` and have id lower or equal to `0xff`
/// so they are always placed in blocks before user-submitted data.
/// so they are always placed in blocks before user-submitted data.
/// - secondary reserved namespaces - those use version `0xff` so they are always placed after
/// user-submitted data.
/// user-submitted data.
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)]
pub struct Namespace(nmt_rs::NamespaceId<NS_SIZE>);

Expand Down
2 changes: 1 addition & 1 deletion types/src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Sample {
///
/// - `row_index`/`column_index` falls outside the provided [`ExtendedDataSquare`].
/// - [`ExtendedDataSquare`] is incorrect (either data shares don't have their namespace
/// prefixed, or [`Share`]s aren't namespace ordered)
/// prefixed, or [`Share`]s aren't namespace ordered)
/// - Block height is zero
///
/// # Example
Expand Down
3 changes: 2 additions & 1 deletion types/src/share/info_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ use crate::{Error, Result};
/// The part of [`Share`] containing the `version` and `sequence_start` information.
///
/// [`InfoByte`] is a single byte with the following structure:
///
/// - the first 7 bits are reserved for version information in big endian form
/// - last bit is a `sequence_start` flag. If it's set then this [`Share`] is
/// a first of a sequence, otherwise it's a continuation share.
/// a first of a sequence, otherwise it's a continuation share.
///
/// [`Share`]: crate::Share
#[repr(transparent)]
Expand Down

0 comments on commit ac8b216

Please sign in to comment.