radix_common/constants/
system_execution.rs

1use crate::constants::SYSTEM_EXECUTION_RESOURCE;
2use crate::data::scrypto::model::NonFungibleLocalId;
3use crate::types::*;
4
5/// For definition @see SYSTEM_EXECUTION_RESOURCE
6#[derive(Debug, Clone, Copy)]
7pub enum SystemExecution {
8    Protocol = 0,
9    Validator = 1,
10}
11
12impl SystemExecution {
13    pub fn proof(self) -> NonFungibleGlobalId {
14        self.into()
15    }
16}
17
18impl Into<NonFungibleGlobalId> for SystemExecution {
19    fn into(self) -> NonFungibleGlobalId {
20        NonFungibleGlobalId::new(
21            SYSTEM_EXECUTION_RESOURCE,
22            NonFungibleLocalId::integer(self as u64),
23        )
24    }
25}