Skip to content

Commit

Permalink
docs: missing types (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
igamigo authored Jan 24, 2025
1 parent e8c8d30 commit 779b9ac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub(super) const NON_FUNGIBLE_FAUCET: u8 = 0b11;
pub(super) const REGULAR_ACCOUNT_IMMUTABLE_CODE: u8 = 0b00;
pub(super) const REGULAR_ACCOUNT_UPDATABLE_CODE: u8 = 0b01;

/// Represents the different account types recognized by the protocol.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u8)]
pub enum AccountType {
Expand Down
3 changes: 3 additions & 0 deletions crates/miden-objects/src/account/account_id/storage_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ use crate::errors::AccountIdError;
pub(super) const PUBLIC: u8 = 0b00;
pub(super) const PRIVATE: u8 = 0b10;

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

Expand Down
2 changes: 2 additions & 0 deletions crates/miden-objects/src/account/delta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ impl AccountDelta {
}
}

/// Describes the details of an account state transition resulting from applying a transaction to
/// the account.
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum AccountUpdateDetails {
/// Account is private (no on-chain state change).
Expand Down
7 changes: 6 additions & 1 deletion crates/miden-objects/src/account/storage/slot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ pub use r#type::StorageSlotType;
// STORAGE SLOT
// ================================================================================================

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

0 comments on commit 779b9ac

Please sign in to comment.