mazzaroth_rs/external/
account.rs1#[cfg(not(feature = "host-mock"))]
4use super::externs::_is_owner;
5
6#[cfg(feature = "host-mock")]
7pub static mut OWNER: bool = false;
8
9#[cfg(not(feature = "host-mock"))]
26pub fn is_owner(key: Vec<u8>) -> bool {
27 unsafe { _is_owner(key.as_ptr(), key.len()) }
28}
29
30#[cfg(feature = "host-mock")]
31pub fn is_owner(_key: Vec<u8>) -> bool {
32 unsafe { OWNER }
33}
34
35#[cfg(test)]
36#[cfg(feature = "host-mock")]
37mod tests {
38 use super::*;
39
40 #[test]
41 fn test_is_owner_true() {
42 unsafe {
43 OWNER = true;
44 }
45 assert_eq!(is_owner(vec![]), true);
46 }
47}