You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.expect("fungible asset should only allow amounts that fit into a felt"),
The FungibleAsset::amount API should return AssetAmount instead of u64 so users can take advantage of the guarantees of AssetAmount. This should have a lot of ripple effects to also convert other APIs that deal with asset amounts to use AssetAmount.
We have recently introduced
AssetAmount, but we're not using it to its full extent yet. A couple of improvements we can make:impl From<AssetAmount> for Feltso users can infallibly do this conversion without having toexpect.protocol/crates/miden-protocol/src/asset/fungible.rs
Lines 153 to 156 in c46871a
FungibleAsset::amountAPI should returnAssetAmountinstead of u64 so users can take advantage of the guarantees ofAssetAmount. This should have a lot of ripple effects to also convert other APIs that deal with asset amounts to useAssetAmount.PswapNote::create_args(account_fill: u64, note_fill: u64)which deals with asset amounts.PswapNote::calculate_output_amount(offered_total: u64, requested_total: u64, fill_amount: u64) -> u64can useAssetAmount.These are just examples. We should explore the codebase to see where similar patterns can be improved / simplified.