Skip to content

Commit

Permalink
fix: Broken import after renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Jan 22, 2025
1 parent cdb3708 commit 976c130
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 46 deletions.
2 changes: 1 addition & 1 deletion crates/miden-objects/src/account/account_id/id_anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
// ACCOUNT ID ANCHOR
// ================================================================================================

/// The anchor of an [`AccountId`](crate::accounts::AccountId). See the type's documentation for
/// The anchor of an [`AccountId`](crate::account::AccountId). See the type's documentation for
/// details on anchors.
///
/// This type is recommended to be created from a reference to a [`BlockHeader`] via the `TryFrom`
Expand Down
4 changes: 2 additions & 2 deletions crates/miden-objects/src/account/account_id/id_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::{
/// The serialization formats of [`AccountIdPrefix`] and [`AccountId`][id] are compatible. In
/// particular, a prefix can be deserialized from the serialized bytes of a full id.
///
/// [id]: crate::accounts::AccountId
/// [id]: crate::account::AccountId
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum AccountIdPrefix {
V0(AccountIdPrefixV0),
Expand Down Expand Up @@ -56,7 +56,7 @@ impl AccountIdPrefix {
///
/// If debug_assertions are enabled (e.g. in debug mode), this function panics if the given
/// felt is invalid according to the constraints in the
/// [`AccountId`](crate::accounts::AccountId) documentation.
/// [`AccountId`](crate::account::AccountId) documentation.
pub fn new_unchecked(prefix: Felt) -> Self {
// The prefix contains the metadata.
// If we add more versions in the future, we may need to generalize this.
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/account/account_id/id_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::errors::AccountIdError;

const VERSION_0_NUMBER: u8 = 0;

/// The version of an [`AccountId`](crate::accounts::AccountId).
/// The version of an [`AccountId`](crate::account::AccountId).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u8)]
pub enum AccountIdVersion {
Expand Down
6 changes: 3 additions & 3 deletions crates/miden-objects/src/account/account_id/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use vm_processor::{DeserializationError, Digest};

use crate::{errors::AccountIdError, AccountError, ACCOUNT_TREE_DEPTH};

/// The identifier of an [`Account`](crate::accounts::Account).
/// The identifier of an [`Account`](crate::account::Account).
///
/// This enum is a wrapper around concrete versions of IDs. The following documents version 0.
///
Expand Down Expand Up @@ -89,8 +89,8 @@ use crate::{errors::AccountIdError, AccountError, ACCOUNT_TREE_DEPTH};
/// than [`u16::MAX`] so that at least one of the upper 16 bits is always zero. This ensures that
/// the entire suffix is valid even if the remaining bits of the felt are one.
/// - The lower 8 bits of the suffix may be overwritten when the ID is encoded in other layouts such
/// as the [`NoteMetadata`](crate::notes::NoteMetadata). In such cases, it can happen that all
/// bits of the encoded suffix would be one, so having the epoch constraint is important.
/// as the [`NoteMetadata`](crate::note::NoteMetadata). In such cases, it can happen that all bits
/// of the encoded suffix would be one, so having the epoch constraint is important.
/// - The ID is dependent on the hash of an epoch block. This is a block whose number is a multiple
/// of 2^[`BlockNumber::EPOCH_LENGTH_EXPONENT`][epoch_len_exp], e.g. `0`, `65536`, `131072`, ...
/// These are the first blocks of epoch 0, 1, 2, ... We call this dependence _anchoring_ because
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/account/account_id/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{
// ACCOUNT ID VERSION 0
// ================================================================================================

/// Version 0 of the [`Account`](crate::accounts::Account) identifier.
/// Version 0 of the [`Account`](crate::account::Account) identifier.
///
/// See the [`AccountId`](super::AccountId) type's documentation for details.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
Expand Down
32 changes: 16 additions & 16 deletions crates/miden-objects/src/account/account_id/v0/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use crate::{
// ACCOUNT ID PREFIX VERSION 0
// ================================================================================================

/// The prefix of an [`AccountIdV0`](crate::accounts::AccountIdV0), i.e. its first field element.
/// The prefix of an [`AccountIdV0`](crate::account::AccountIdV0), i.e. its first field element.
///
/// See the [`AccountId`](crate::accounts::AccountId)'s documentation for details.
/// See the [`AccountId`](crate::account::AccountId)'s documentation for details.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct AccountIdPrefixV0 {
prefix: Felt,
Expand All @@ -37,7 +37,7 @@ impl AccountIdPrefixV0 {
// CONSTRUCTORS
// --------------------------------------------------------------------------------------------

/// See [`AccountIdPrefix::new_unchecked`](crate::accounts::AccountIdPrefix::new_unchecked) for
/// See [`AccountIdPrefix::new_unchecked`](crate::account::AccountIdPrefix::new_unchecked) for
/// details.
pub fn new_unchecked(prefix: Felt) -> Self {
// Panic on invalid felts in debug mode.
Expand All @@ -49,7 +49,7 @@ impl AccountIdPrefixV0 {
AccountIdPrefixV0 { prefix }
}

/// See [`AccountIdPrefix::new`](crate::accounts::AccountIdPrefix::new) for details.
/// See [`AccountIdPrefix::new`](crate::account::AccountIdPrefix::new) for details.
pub fn new(prefix: Felt) -> Result<Self, AccountIdError> {
validate_prefix(prefix)?;

Expand All @@ -59,52 +59,52 @@ impl AccountIdPrefixV0 {
// PUBLIC ACCESSORS
// --------------------------------------------------------------------------------------------

/// See [`AccountIdPrefix::as_felt`](crate::accounts::AccountIdPrefix::as_felt) for details.
/// See [`AccountIdPrefix::as_felt`](crate::account::AccountIdPrefix::as_felt) for details.
pub const fn as_felt(&self) -> Felt {
self.prefix
}

/// See [`AccountIdPrefix::as_u64`](crate::accounts::AccountIdPrefix::as_u64) for details.
/// See [`AccountIdPrefix::as_u64`](crate::account::AccountIdPrefix::as_u64) for details.
pub const fn as_u64(&self) -> u64 {
self.prefix.as_int()
}

/// See [`AccountIdPrefix::account_type`](crate::accounts::AccountIdPrefix::account_type) for
/// See [`AccountIdPrefix::account_type`](crate::account::AccountIdPrefix::account_type) for
/// details.
pub const fn account_type(&self) -> AccountType {
v0::extract_type(self.prefix.as_int())
}

/// See [`AccountIdPrefix::is_faucet`](crate::accounts::AccountIdPrefix::is_faucet) for details.
/// See [`AccountIdPrefix::is_faucet`](crate::account::AccountIdPrefix::is_faucet) for details.
pub fn is_faucet(&self) -> bool {
self.account_type().is_faucet()
}

/// See [`AccountIdPrefix::is_regular_account`](crate::accounts::AccountIdPrefix::is_regular_account) for
/// See [`AccountIdPrefix::is_regular_account`](crate::account::AccountIdPrefix::is_regular_account) for
/// details.
pub fn is_regular_account(&self) -> bool {
self.account_type().is_regular_account()
}

/// See [`AccountIdPrefix::storage_mode`](crate::accounts::AccountIdPrefix::storage_mode) for
/// See [`AccountIdPrefix::storage_mode`](crate::account::AccountIdPrefix::storage_mode) for
/// details.
pub fn storage_mode(&self) -> AccountStorageMode {
v0::extract_storage_mode(self.prefix.as_int())
.expect("account ID prefix should have been constructed with a valid storage mode")
}

/// See [`AccountIdPrefix::is_public`](crate::accounts::AccountIdPrefix::is_public) for details.
/// See [`AccountIdPrefix::is_public`](crate::account::AccountIdPrefix::is_public) for details.
pub fn is_public(&self) -> bool {
self.storage_mode() == AccountStorageMode::Public
}

/// See [`AccountIdPrefix::version`](crate::accounts::AccountIdPrefix::version) for details.
/// See [`AccountIdPrefix::version`](crate::account::AccountIdPrefix::version) for details.
pub fn version(&self) -> AccountIdVersion {
v0::extract_version(self.prefix.as_int())
.expect("account ID prefix should have been constructed with a valid version")
}

/// See [`AccountIdPrefix::to_hex`](crate::accounts::AccountIdPrefix::to_hex) for details.
/// See [`AccountIdPrefix::to_hex`](crate::account::AccountIdPrefix::to_hex) for details.
pub fn to_hex(self) -> String {
format!("0x{:016x}", self.prefix.as_int())
}
Expand Down Expand Up @@ -140,7 +140,7 @@ impl TryFrom<[u8; 8]> for AccountIdPrefixV0 {
type Error = AccountIdError;

/// See [`TryFrom<[u8; 8]> for
/// AccountIdPrefix`](crate::accounts::AccountIdPrefix#impl-TryFrom<%5Bu8;+8%
/// AccountIdPrefix`](crate::account::AccountIdPrefix#impl-TryFrom<%5Bu8;+8%
/// 5D>-for-AccountIdPrefix) for details.
fn try_from(mut value: [u8; 8]) -> Result<Self, Self::Error> {
// Felt::try_from expects little-endian order.
Expand All @@ -156,7 +156,7 @@ impl TryFrom<u64> for AccountIdPrefixV0 {
type Error = AccountIdError;

/// See [`TryFrom<u64> for
/// AccountIdPrefix`](crate::accounts::AccountIdPrefix#impl-TryFrom<u64>-for-AccountIdPrefix)
/// AccountIdPrefix`](crate::account::AccountIdPrefix#impl-TryFrom<u64>-for-AccountIdPrefix)
/// for details.
fn try_from(value: u64) -> Result<Self, Self::Error> {
let element = Felt::try_from(value.to_le_bytes().as_slice())
Expand All @@ -169,7 +169,7 @@ impl TryFrom<Felt> for AccountIdPrefixV0 {
type Error = AccountIdError;

/// See [`TryFrom<Felt> for
/// AccountIdPrefix`](crate::accounts::AccountIdPrefix#impl-TryFrom<Felt>-for-AccountIdPrefix)
/// AccountIdPrefix`](crate::account::AccountIdPrefix#impl-TryFrom<Felt>-for-AccountIdPrefix)
/// for details.
fn try_from(element: Felt) -> Result<Self, Self::Error> {
Self::new(element)
Expand Down
5 changes: 2 additions & 3 deletions crates/miden-objects/src/account/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,9 @@ impl AccountBuilder {
/// - The init seed is not set.
/// - Any of the components does not support the set account type.
/// - The number of procedures in all merged components is 0 or exceeds
/// [`AccountCode::MAX_NUM_PROCEDURES`](crate::accounts::AccountCode::MAX_NUM_PROCEDURES).
/// [`AccountCode::MAX_NUM_PROCEDURES`](crate::account::AccountCode::MAX_NUM_PROCEDURES).
/// - Two or more libraries export a procedure with the same MAST root.
/// - The number of [`StorageSlot`](crate::accounts::StorageSlot)s of all components exceeds
/// 255.
/// - The number of [`StorageSlot`](crate::account::StorageSlot)s of all components exceeds 255.
/// - [`MastForest::merge`](vm_processor::MastForest::merge) fails on the given components.
/// - If duplicate assets were added to the builder (only under the `testing` feature).
/// - If the vault is not empty on new accounts (only under the `testing` feature).
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/account/code/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl AccountCode {
/// - The number of procedures in all merged libraries is 0 or exceeds
/// [`AccountCode::MAX_NUM_PROCEDURES`].
/// - Two or more libraries export a procedure with the same MAST root.
/// - The number of [`StorageSlot`](crate::accounts::StorageSlot)s of a component or of all
/// - The number of [`StorageSlot`](crate::account::StorageSlot)s of a component or of all
/// components exceeds 255.
/// - [`MastForest::merge`] fails on all libraries.
pub(super) fn from_components_unchecked(
Expand Down
8 changes: 4 additions & 4 deletions crates/miden-objects/src/account/component/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use crate::{
/// An [`AccountComponent`] defines a [`Library`] of code and the initial value and types of
/// the [`StorageSlot`]s it accesses.
///
/// One or more components can be used to built [`AccountCode`](crate::accounts::AccountCode) and
/// [`AccountStorage`](crate::accounts::AccountStorage).
/// One or more components can be used to built [`AccountCode`](crate::account::AccountCode) and
/// [`AccountStorage`](crate::account::AccountStorage).
///
/// Each component is independent of other components and can only access its own storage slots.
/// Each component defines its own storage layout starting at index 0 up to the length of the
Expand All @@ -44,7 +44,7 @@ impl AccountComponent {
/// `storage_slots`.
///
/// All procedures exported from the provided code will become members of the account's public
/// interface when added to an [`AccountCode`](crate::accounts::AccountCode).
/// interface when added to an [`AccountCode`](crate::account::AccountCode).
///
/// # Errors
///
Expand All @@ -70,7 +70,7 @@ impl AccountComponent {
/// using the specified `assembler` and with the given `storage_slots`.
///
/// All procedures exported from the provided code will become members of the account's public
/// interface when added to an [`AccountCode`](crate::accounts::AccountCode).
/// interface when added to an [`AccountCode`](crate::account::AccountCode).
///
/// # Errors
///
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/account/component/template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Deserializable for AccountComponentTemplate {
/// ```
/// # use semver::Version;
/// # use std::collections::BTreeSet;
/// # use miden_objects::{testing::account_code::CODE, accounts::{
/// # use miden_objects::{testing::account_code::CODE, account::{
/// # AccountComponent, AccountComponentMetadata, InitStorageData, StorageEntry,
/// # StoragePlaceholder, StorageValue,
/// # AccountComponentTemplate, FeltRepresentation, WordRepresentation},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use alloc::collections::BTreeMap;
use super::{StoragePlaceholder, StorageValue};

/// Represents the data required to initialize storage entries when instantiating an
/// [AccountComponent](crate::accounts::AccountComponent) from a
/// [template](crate::accounts::AccountComponentTemplate).
/// [AccountComponent](crate::account::AccountComponent) from a
/// [template](crate::account::AccountComponentTemplate).
#[derive(Clone, Debug, Default)]
pub struct InitStorageData {
/// A mapping of storage placeholder names to their corresponding storage values.
Expand Down
4 changes: 2 additions & 2 deletions crates/miden-objects/src/asset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub use vault::AssetVault;
/// - non-ZERO for a non-fungible asset.
///
/// Element 3 of both asset types is an [`AccountIdPrefix`] or equivalently, the prefix of an
/// [`AccountId`](crate::accounts::AccountId), which can be used to distinguish assets
/// [`AccountId`](crate::account::AccountId), which can be used to distinguish assets
/// based on [`AccountIdPrefix::account_type`].
///
/// For element 3 of the vault keys of assets, the bit at index 5 (referred to as the
Expand Down Expand Up @@ -120,7 +120,7 @@ impl Asset {

/// Returns the prefix of the faucet ID which issued this asset.
///
/// To get the full [`AccountId`](crate::accounts::AccountId) of a fungible asset the asset
/// To get the full [`AccountId`](crate::account::AccountId) of a fungible asset the asset
/// must be matched on.
pub fn faucet_id_prefix(&self) -> AccountIdPrefix {
match self {
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/note/execution_hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl NoteExecutionHint {
/// significant bits set to `0`.
///
/// The payload is guaranteed to contain at least one `0` bit to make encoding it into
/// [`NoteMetadata`](crate::notes::NoteMetadata) safely possible.
/// [`NoteMetadata`](crate::note::NoteMetadata) safely possible.
pub fn into_parts(&self) -> (u8, u32) {
match self {
NoteExecutionHint::None => (Self::NONE_TAG, 0),
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/note/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use assembly::Assembler;
use rand::Rng;

use crate::{
accounts::AccountId,
account::AccountId,
assembly::ProgramAst,
assets::Asset,
notes::{
Expand Down
4 changes: 2 additions & 2 deletions crates/miden-objects/src/testing/account_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ pub const BASIC_WALLET_CODE: &str = "
// ================================================================================================

/// Creates a mock [`Library`] which can be used to assemble programs and as a library to create a
/// mock [`AccountCode`](crate::accounts::AccountCode) interface. Transaction and note scripts that
/// mock [`AccountCode`](crate::account::AccountCode) interface. Transaction and note scripts that
/// make use of this interface should be assembled with this.
///
/// This component supports all [`AccountType`](crate::accounts::AccountType)s for testing purposes.
/// This component supports all [`AccountType`](crate::account::AccountType)s for testing purposes.
pub struct AccountMockComponent {
library: Library,
storage_slots: Vec<StorageSlot>,
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/testing/account_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub const fn account_id(
/// # Example
///
/// ```
/// # use miden_objects::accounts::{AccountType, AccountStorageMode, AccountId};
/// # use miden_objects::account::{AccountType, AccountStorageMode, AccountId};
/// # use miden_objects::testing::account_id::{AccountIdBuilder};
///
/// let mut rng = rand::thread_rng();
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/transaction/outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl OutputNote {

/// Value that represents under which condition a note can be consumed.
///
/// See [crate::notes::NoteRecipient] for more details.
/// See [crate::note::NoteRecipient] for more details.
pub fn recipient_digest(&self) -> Option<Digest> {
match self {
OutputNote::Full(note) => Some(note.recipient().digest()),
Expand Down
4 changes: 2 additions & 2 deletions crates/miden-tx/src/testing/mock_chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl PendingObjects {
/// ## Create mock objects and build a transaction context
/// ```no_run
/// # use miden_tx::testing::{Auth, MockChain, TransactionContextBuilder};
/// # use miden_objects::{assets::FungibleAsset, Felt, notes::NoteType};
/// # use miden_objects::{asset::FungibleAsset, Felt, note::NoteType};
/// let mut mock_chain = MockChain::new();
/// let faucet = mock_chain.add_new_faucet(Auth::BasicAuth, "USDT", 100_000); // Create a USDT faucet
/// let asset = faucet.mint(1000);
Expand All @@ -235,7 +235,7 @@ impl PendingObjects {
///
/// ```
/// # use miden_tx::testing::{Auth, MockChain, TransactionContextBuilder};
/// # use miden_objects::{assets::FungibleAsset, Felt, transaction::TransactionScript};
/// # use miden_objects::{asset::FungibleAsset, Felt, transaction::TransactionScript};
/// # use miden_lib::transaction::TransactionKernel;
/// let mut mock_chain = MockChain::new();
/// let sender = mock_chain.add_existing_wallet(Auth::BasicAuth, vec![FungibleAsset::mock(256)]); // Add a wallet with assets
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-tx/src/testing/tx_context/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub type MockAuthenticator = BasicAuthenticator<ChaCha20Rng>;
/// Create a new account and execute code:
/// ```
/// # use miden_tx::testing::TransactionContextBuilder;
/// # use miden_objects::{accounts::AccountBuilder,Felt, FieldElement};
/// # use miden_objects::{account::AccountBuilder,Felt, FieldElement};
/// let tx_context = TransactionContextBuilder::with_standard_account(Felt::ONE).build();
///
/// let code = "
Expand Down

0 comments on commit 976c130

Please sign in to comment.