miden-node-proto 0.16.0

Miden node message definitions (Store, Block Producer and RPC)
Documentation
pub mod account;
pub mod block;
pub mod digest;
pub mod encryption;
pub mod merkle;
pub mod note;
pub mod nullifier;
pub mod proof_request;
pub mod transaction;

use miden_node_tracing::{RecordAttribute, Value};

impl RecordAttribute for crate::generated::rpc::FinalityLevel {
    const FIELD_NAMES: &'static [&'static str] = &["finality_level"];

    fn record_attribute(&self) -> impl Value + '_ {
        self.as_str_name()
    }
}

// UTILITIES
// ================================================================================================

pub fn convert<T, From, To>(from: T) -> impl Iterator<Item = To>
where
    T: IntoIterator<Item = From>,
    From: Into<To>,
{
    from.into_iter().map(Into::into)
}

pub fn try_convert<T, E, From, To>(from: T) -> impl Iterator<Item = Result<To, E>>
where
    T: IntoIterator<Item = From>,
    From: TryInto<To, Error = E>,
{
    from.into_iter().map(TryInto::try_into)
}