diff --git a/CHANGELOG.md b/CHANGELOG.md index a08df1dc5..910ef417d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ - Introduce `AccountIdError` and make account ID byte representations (`u128`, `[u8; 15]`) consistent (#1055). - Refactor `AccountId` and `AccountIdPrefix` into version wrappers (#1058). - Remove multi-threaded account seed generation due to single-threaded generation being faster (#1061). +- Made `AccountIdError` public (#1067). +- Made `BasicFungibleFaucet::MAX_DECIMALS` public (#1063). - [BREAKING] Removed `miden-tx-prover` crate and created `miden-proving-service` and `miden-remote-provers` (#1047). ## 0.6.2 (2024-11-20) diff --git a/miden-lib/src/accounts/faucets/mod.rs b/miden-lib/src/accounts/faucets/mod.rs index e763cf8fe..e8045aad1 100644 --- a/miden-lib/src/accounts/faucets/mod.rs +++ b/miden-lib/src/accounts/faucets/mod.rs @@ -3,7 +3,7 @@ use miden_objects::{ Account, AccountBuilder, AccountComponent, AccountIdAnchor, AccountStorageMode, AccountType, StorageSlot, }, - assets::TokenSymbol, + assets::{FungibleAsset, TokenSymbol}, AccountError, Felt, FieldElement, Word, }; @@ -33,8 +33,9 @@ pub struct BasicFungibleFaucet { impl BasicFungibleFaucet { // CONSTANTS // -------------------------------------------------------------------------------------------- - const MAX_MAX_SUPPLY: u64 = (1 << 63) - 1; - const MAX_DECIMALS: u8 = 12; + + /// The maximum number of decimals supported by the component. + pub const MAX_DECIMALS: u8 = 12; // CONSTRUCTORS // -------------------------------------------------------------------------------------------- @@ -47,10 +48,10 @@ impl BasicFungibleFaucet { actual: decimals, max: Self::MAX_DECIMALS, }); - } else if max_supply.as_int() > Self::MAX_MAX_SUPPLY { + } else if max_supply.as_int() > FungibleAsset::MAX_AMOUNT { return Err(AccountError::FungibleFaucetMaxSupplyTooLarge { actual: max_supply.as_int(), - max: Self::MAX_MAX_SUPPLY, + max: FungibleAsset::MAX_AMOUNT, }); } diff --git a/objects/src/lib.rs b/objects/src/lib.rs index 12682c709..a848d227b 100644 --- a/objects/src/lib.rs +++ b/objects/src/lib.rs @@ -25,9 +25,9 @@ mod errors; pub use block::BlockHeader; pub use constants::*; pub use errors::{ - AccountDeltaError, AccountError, AssetError, AssetVaultError, BlockError, ChainMmrError, - NoteError, ProvenTransactionError, TransactionInputError, TransactionOutputError, - TransactionScriptError, + AccountDeltaError, AccountError, AccountIdError, AssetError, AssetVaultError, BlockError, + ChainMmrError, NoteError, ProvenTransactionError, TransactionInputError, + TransactionOutputError, TransactionScriptError, }; pub use miden_crypto::hash::rpo::{Rpo256 as Hasher, RpoDigest as Digest}; pub use vm_core::{Felt, FieldElement, StarkField, Word, EMPTY_WORD, ONE, WORD_SIZE, ZERO};