mod bytes;
mod parse;
use console::{
network::prelude::*,
program::{FinalizeType, Identifier},
};
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct MapKey<N: Network> {
name: Identifier<N>,
finalize_type: FinalizeType<N>,
}
impl<N: Network> MapKey<N> {
#[inline]
pub const fn name(&self) -> &Identifier<N> {
&self.name
}
#[inline]
pub const fn finalize_type(&self) -> &FinalizeType<N> {
&self.finalize_type
}
}
impl<N: Network> TypeName for MapKey<N> {
#[inline]
fn type_name() -> &'static str {
"key"
}
}
#[cfg(test)]
mod tests {
use super::*;
use console::network::Testnet3;
type CurrentNetwork = Testnet3;
#[test]
fn test_key_type_name() -> Result<()> {
assert_eq!(MapKey::<CurrentNetwork>::type_name(), "key");
Ok(())
}
}