Skip to content

Commit 779b9ac

Browse files
authored
docs: missing types (#1100)
1 parent e8c8d30 commit 779b9ac

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

crates/miden-objects/src/account/account_id/account_type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub(super) const NON_FUNGIBLE_FAUCET: u8 = 0b11;
1313
pub(super) const REGULAR_ACCOUNT_IMMUTABLE_CODE: u8 = 0b00;
1414
pub(super) const REGULAR_ACCOUNT_UPDATABLE_CODE: u8 = 0b01;
1515

16+
/// Represents the different account types recognized by the protocol.
1617
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
1718
#[repr(u8)]
1819
pub enum AccountType {

crates/miden-objects/src/account/account_id/storage_mode.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ use crate::errors::AccountIdError;
99
pub(super) const PUBLIC: u8 = 0b00;
1010
pub(super) const PRIVATE: u8 = 0b10;
1111

12+
/// Describes where the state of the account is stored.
1213
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1314
#[repr(u8)]
1415
pub enum AccountStorageMode {
16+
/// The account's full state is stored on-chain.
1517
Public = PUBLIC,
18+
/// The account's state is stored off-chain, and only a commitment to it is stored on-chain.
1619
Private = PRIVATE,
1720
}
1821

crates/miden-objects/src/account/delta/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ impl AccountDelta {
9696
}
9797
}
9898

99+
/// Describes the details of an account state transition resulting from applying a transaction to
100+
/// the account.
99101
#[derive(Clone, Debug, PartialEq, Eq)]
100102
pub enum AccountUpdateDetails {
101103
/// Account is private (no on-chain state change).

crates/miden-objects/src/account/storage/slot/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ pub use r#type::StorageSlotType;
1212
// STORAGE SLOT
1313
// ================================================================================================
1414

15-
/// An object that represents the type of a storage slot.
15+
/// An object representing the contents of an account's storage slot.
16+
///
17+
/// An account storage slot can be of two types:
18+
/// - A simple value which contains a single word (4 field elements or ~32 bytes).
19+
/// - A key value map where both keys and values are words. The capacity of such storage slot is
20+
/// theoretically unlimited.
1621
#[derive(Debug, Clone, PartialEq, Eq)]
1722
pub enum StorageSlot {
1823
Value(Word),

0 commit comments

Comments
 (0)