miden-protocol 0.16.0-alpha.4

Core components of the Miden protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::account::{AccountPatch, AccountUpdateDetails};

impl AccountUpdateDetails {
    /// Returns the [`AccountPatch`] contained in this update.
    ///
    /// # Panics
    ///
    /// Panics if the update is not [`AccountUpdateDetails::Public`].
    #[track_caller]
    pub fn unwrap_public(&self) -> &AccountPatch {
        match self {
            AccountUpdateDetails::Private => panic!("expected public, got private"),
            AccountUpdateDetails::Public(patch) => patch,
        }
    }
}