miden-standards 0.17.0

Standards of the Miden protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use miden_protocol::account::AccountId;

use crate::account::fees::{BasicConstantFeePolicy, FeePolicyManager};

impl FeePolicyManager {
    /// Returns a minimal single-policy manager charging fees in `fee_faucet_id`'s asset, for tests
    /// that need a manager to construct an account but do not exercise the fee flow itself.
    ///
    /// Its active policy is an empty [`BasicConstantFeePolicy`], which aborts fee estimation for
    /// any note script root; tests that consume notes need a policy with a fee schedule
    /// instead.
    pub fn mock(fee_faucet_id: AccountId) -> Self {
        FeePolicyManager::builder()
            .fee_faucet_id(fee_faucet_id)
            .active_fee_policy(BasicConstantFeePolicy::new().into())
            .build()
    }
}