Skip to content

Commit

Permalink
fix doc lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Aug 16, 2023
1 parent 4ff8fc6 commit 00d67d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions crates/primitives/src/transaction/eip4844.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl BlobTransaction {
/// `rlp(tx_type (0x03) || rlp([transaction_payload_body, blobs, commitments, proofs]))`
///
/// NOTE: The header will be a byte string header, not a list header.
pub fn encode_with_type_inner(&self, out: &mut dyn bytes::BufMut, with_header: bool) {
pub(crate) fn encode_with_type_inner(&self, out: &mut dyn bytes::BufMut, with_header: bool) {
// Calculate the length of:
// `tx_type || rlp([transaction_payload_body, blobs, commitments, proofs])`
//
Expand Down Expand Up @@ -296,7 +296,7 @@ impl BlobTransaction {
///
/// Note: this should be used only when implementing other RLP encoding methods, and does not
/// represent the full RLP encoding of the blob transaction.
pub fn encode_inner(&self, out: &mut dyn bytes::BufMut) {
pub(crate) fn encode_inner(&self, out: &mut dyn bytes::BufMut) {
// First we construct both required list headers.
//
// The `transaction_payload_body` length is the length of the fields, plus the length of
Expand Down Expand Up @@ -334,7 +334,7 @@ impl BlobTransaction {
///
/// If `with_header` is `true`, the length of the following will be calculated:
/// `rlp(tx_type (0x03) || rlp([transaction_payload_body, blobs, commitments, proofs]))`
pub fn payload_len_with_type(&self, with_header: bool) -> usize {
pub(crate) fn payload_len_with_type(&self, with_header: bool) -> usize {
if with_header {
// Construct a header and use that to calculate the total length
let wrapped_header = Header {
Expand All @@ -360,7 +360,7 @@ impl BlobTransaction {
///
/// Note: this should be used only when implementing other RLP encoding length methods, and
/// does not represent the full RLP encoding of the blob transaction.
pub fn payload_len(&self) -> usize {
pub(crate) fn payload_len(&self) -> usize {
// The `transaction_payload_body` length is the length of the fields, plus the length of
// its list header.
let tx_header = Header {
Expand All @@ -383,8 +383,8 @@ impl BlobTransaction {
/// `[chain_id, nonce, max_priority_fee_per_gas, ..., y_parity, r, s]`
///
/// Note: this should be used only when implementing other RLP decoding methods, and does not
/// represent the full RLP decoding of the [PooledTransactionResponse] type.
pub fn decode_inner(data: &mut &[u8]) -> Result<Self, DecodeError> {
/// represent the full RLP decoding of the `PooledTransactionsElement` type.
pub(crate) fn decode_inner(data: &mut &[u8]) -> Result<Self, DecodeError> {
// decode the _first_ list header for the rest of the transaction
let header = Header::decode(data)?;
if !header.list {
Expand Down Expand Up @@ -452,15 +452,15 @@ impl BlobTransactionSidecar {
/// - `blobs`
/// - `commitments`
/// - `proofs`
pub fn encode_inner(&self, out: &mut dyn bytes::BufMut) {
pub(crate) fn encode_inner(&self, out: &mut dyn bytes::BufMut) {
// Encode the blobs, commitments, and proofs
self.blobs.encode(out);
self.commitments.encode(out);
self.proofs.encode(out);
}

/// Outputs the RLP length of the [BlobTransactionSidecar] fields, without a RLP header.
pub fn fields_len(&self) -> usize {
pub(crate) fn fields_len(&self) -> usize {
self.blobs.len() + self.commitments.len() + self.proofs.len()
}

Expand All @@ -470,7 +470,7 @@ impl BlobTransactionSidecar {
/// - `blobs`
/// - `commitments`
/// - `proofs`
pub fn decode_inner(buf: &mut &[u8]) -> Result<Self, DecodeError> {
pub(crate) fn decode_inner(buf: &mut &[u8]) -> Result<Self, DecodeError> {
Ok(Self {
blobs: Decodable::decode(buf)?,
commitments: Decodable::decode(buf)?,
Expand Down
8 changes: 4 additions & 4 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ impl PooledTransactionsElement {
}

impl Encodable for PooledTransactionsElement {
/// Encodes an enveloped post EIP-4844 [PooledTransactionResponse].
/// Encodes an enveloped post EIP-4844 [PooledTransactionsElement].
fn encode(&self, out: &mut dyn bytes::BufMut) {
match self {
Self::Transaction(tx) => tx.encode(out),
Expand All @@ -1417,7 +1417,7 @@ impl Encodable for PooledTransactionsElement {
}

impl Decodable for PooledTransactionsElement {
/// Decodes an enveloped post EIP-4844 [PooledTransactionResponse].
/// Decodes an enveloped post EIP-4844 [PooledTransactionsElement].
///
/// CAUTION: this expects that `buf` is `[id, rlp(tx)]`
fn decode(buf: &mut &[u8]) -> Result<Self, DecodeError> {
Expand Down Expand Up @@ -1486,9 +1486,9 @@ impl Decodable for PooledTransactionsElement {
}

impl From<TransactionSigned> for PooledTransactionsElement {
/// Converts from a [TransactionSigned] to a [PooledTransactionResponse].
/// Converts from a [TransactionSigned] to a [PooledTransactionsElement].
///
/// NOTE: This will always return a [PooledTransactionResponse::Transaction] variant.
/// NOTE: This will always return a [PooledTransactionsElement::Transaction] variant.
fn from(tx: TransactionSigned) -> Self {
Self::Transaction(tx)
}
Expand Down

0 comments on commit 00d67d9

Please sign in to comment.