Skip to content

Commit 2a17311

Browse files
committed
spelling
1 parent 99eb7da commit 2a17311

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

scripts/setup/solana.dic

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ RPC
6464
ed25519
6565
performant
6666
syscall/S
67-
bitmask
67+
bitmask
68+
pinocchio
69+
mainnet

sdk/pinocchio/src/sysvars/slot_hashes/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Efficient, zero-copy access to SlotHashes sysvar data.
1+
//! Efficient, zero-copy access to `SlotHashes` sysvar data.
22
33
pub mod raw;
44
#[doc(inline)]
@@ -59,7 +59,7 @@ pub struct SlotHashEntry {
5959
// Fail compilation if `SlotHashEntry` is not byte-aligned.
6060
const _: [(); 1] = [(); mem::align_of::<SlotHashEntry>()];
6161

62-
/// SlotHashes provides read-only, zero-copy access to SlotHashes sysvar bytes.
62+
/// `SlotHashes` provides read-only, zero-copy access to `SlotHashes` sysvar bytes.
6363
pub struct SlotHashes<T: Deref<Target = [u8]>> {
6464
data: T,
6565
}
@@ -93,7 +93,7 @@ pub(crate) unsafe fn read_entry_count_from_bytes_unchecked(data: &[u8]) -> usize
9393
u64::from_le_bytes(*(data.as_ptr() as *const [u8; NUM_ENTRIES_SIZE])) as usize
9494
}
9595

96-
/// Validates SlotHashes data format.
96+
/// Validates `SlotHashes` data format.
9797
///
9898
/// The function checks:
9999
/// 1. The buffer is large enough to contain the entry count.
@@ -152,7 +152,7 @@ impl<T: Deref<Target = [u8]>> SlotHashes<T> {
152152
///
153153
/// This function is unsafe because it does not validate the data size or format.
154154
/// The caller must ensure:
155-
/// 1. The underlying byte slice in `data` represents valid SlotHashes data
155+
/// 1. The underlying byte slice in `data` represents valid `SlotHashes` data
156156
/// (length prefix + entries, where entries are sorted in descending order by slot).
157157
/// 2. The data slice has at least `NUM_ENTRIES_SIZE + (declared_entries * ENTRY_SIZE)` bytes.
158158
/// 3. The first 8 bytes contain a valid entry count in little-endian format.
@@ -272,7 +272,7 @@ impl<'a> SlotHashes<Ref<'a, [u8]>> {
272272
/// The returned instance is valid for the lifetime of the borrow.
273273
///
274274
/// # Errors
275-
/// - `ProgramError::InvalidArgument` if the account key doesn't match the SlotHashes sysvar ID
275+
/// - `ProgramError::InvalidArgument` if the account key doesn't match the `SlotHashes` sysvar ID
276276
/// - `ProgramError::AccountBorrowFailed` if the account data is already mutably borrowed
277277
#[inline(always)]
278278
pub fn from_account_info(account_info: &'a AccountInfo) -> Result<Self, ProgramError> {
@@ -289,7 +289,7 @@ impl<'a> SlotHashes<Ref<'a, [u8]>> {
289289

290290
#[cfg(feature = "std")]
291291
impl SlotHashes<Box<[u8]>> {
292-
/// Fills the provided buffer with the full SlotHashes sysvar data.
292+
/// Fills the provided buffer with the full `SlotHashes` sysvar data.
293293
///
294294
/// # Safety
295295
/// The caller must ensure the buffer pointer is valid for MAX_SIZE bytes.
@@ -321,7 +321,7 @@ impl SlotHashes<Box<[u8]>> {
321321
Ok(buf.into_boxed_slice())
322322
}
323323

324-
/// Fetches the SlotHashes sysvar data directly via syscall. This copies
324+
/// Fetches the `SlotHashes` sysvar data directly via syscall. This copies
325325
/// the full sysvar data (`MAX_SIZE` bytes).
326326
#[inline(always)]
327327
pub fn fetch() -> Result<Self, ProgramError> {

sdk/pinocchio/src/sysvars/slot_hashes/raw.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
//! Raw / caller-supplied buffer helpers for the SlotHashes sysvar.
1+
//! Raw / caller-supplied buffer helpers for the `SlotHashes` sysvar.
22
//!
33
//! This sub-module exposes lightweight functions that let a program copy
4-
//! SlotHashes data directly into an arbitrary buffer **without** constructing
4+
//! `SlotHashes` data directly into an arbitrary buffer **without** constructing
55
//! a `SlotHashes<T>` view. Use these when you only need a byte snapshot or
66
//! when including the sysvar account is infeasible.
77
#![allow(clippy::inline_always)]
88

99
use super::*;
1010

11-
/// Validates that a buffer is properly sized for SlotHashes data.
11+
/// Validates that a buffer is properly sized for `SlotHashes` data.
1212
///
1313
/// Checks that the buffer length is 8 + (N × 40) for some N ≤ 512.
1414
/// Unlike the `SlotHashes` constructor, this function does not require
@@ -34,9 +34,9 @@ pub(crate) fn validate_buffer_size(buffer_len: usize) -> Result<(), ProgramError
3434
Ok(())
3535
}
3636

37-
/// Validates offset parameters for fetching SlotHashes data.
37+
/// Validates offset parameters for fetching `SlotHashes` data.
3838
///
39-
/// * `offset` – Byte offset within the SlotHashes sysvar data.
39+
/// * `offset` – Byte offset within the `SlotHashes` sysvar data.
4040
/// * `buffer_len` – Length of the destination buffer.
4141
#[inline(always)]
4242
pub fn validate_fetch_offset(offset: usize, buffer_len: usize) -> Result<(), ProgramError> {
@@ -53,7 +53,7 @@ pub fn validate_fetch_offset(offset: usize, buffer_len: usize) -> Result<(), Pro
5353
Ok(())
5454
}
5555

56-
/// Copies SlotHashes sysvar bytes into `buffer`, performing validation.
56+
/// Copies `SlotHashes` sysvar bytes into `buffer`, performing validation.
5757
///
5858
/// Returns the number of entries present in the sysvar.
5959
#[inline(always)]
@@ -77,10 +77,10 @@ pub fn fetch_into(buffer: &mut [u8], offset: usize) -> Result<usize, ProgramErro
7777
Ok(num_entries)
7878
}
7979

80-
/// Copies SlotHashes sysvar bytes into `buffer` **without** validation.
80+
/// Copies `SlotHashes` sysvar bytes into `buffer` **without** validation.
8181
///
8282
/// The caller is responsible for ensuring that:
83-
/// 1. `buffer` is large enough for the requested `offset`+`buffer.len()` range and
83+
/// 1. `buffer` is large enough for the requested `offset` + `buffer.len()` range and
8484
/// properly laid out (see `validate_buffer_size` and `validate_fetch_offset`).
8585
/// 2. The memory behind `buffer` is writable for its full length.
8686
///

sdk/pinocchio/src/sysvars/slot_hashes/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Shared helpers for SlotHashes sysvar tests.
1+
//! Shared helpers for `SlotHashes` sysvar tests.
22
//! This module is compiled only when `cfg(test)` is active so `std` can be used
33
//! freely while production code remains `#![no_std]`.
44
@@ -84,7 +84,7 @@ pub fn generate_mock_entries(
8484
entries
8585
}
8686

87-
/// Build a `Vec<u8>` the size of the *golden* SlotHashes sysvar (20 488 bytes)
87+
/// Build a `Vec<u8>` the size of the *golden* `SlotHashes` sysvar (20 488 bytes)
8888
/// containing the supplied `entries` and with the `declared_len` header.
8989
pub fn build_slot_hashes_bytes(declared_len: u64, entries: &[(u64, Hash)]) -> Vec<u8> {
9090
let mut data = std::vec![0u8; MAX_SIZE];

0 commit comments

Comments
 (0)