gmsol_programs/utils/timelock.rs
1#[cfg(feature = "gmsol-utils")]
2mod utils {
3 use gmsol_utils::{
4 fixed_str::bytes_to_fixed_str,
5 impl_flags,
6 instruction::{InstructionFlag, MAX_IX_FLAGS},
7 };
8
9 use crate::gmsol_timelock::{accounts::Executor, types::InstructionFlagContainer};
10
11 impl Executor {
12 /// Get role name.
13 pub fn role_name(&self) -> crate::Result<&str> {
14 bytes_to_fixed_str(&self.role_name).map_err(crate::Error::custom)
15 }
16 }
17
18 impl_flags!(InstructionFlag, MAX_IX_FLAGS, u8);
19}