radix_engine/blueprints/resource/
proof_common.rs

1use crate::internal_prelude::*;
2
3#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, ScryptoSbor)]
4pub enum LocalRef {
5    Bucket(Reference),
6    Vault(Reference),
7}
8
9impl LocalRef {
10    pub fn as_node_id(&self) -> &NodeId {
11        match self {
12            LocalRef::Bucket(id) => id.as_node_id(),
13            LocalRef::Vault(id) => id.as_node_id(),
14        }
15    }
16}
17
18#[derive(Debug, Clone, PartialEq, Eq, ScryptoSbor)]
19pub enum ProofError {
20    /// Can't generate zero-amount or empty non-fungible set proofs.
21    EmptyProofNotAllowed,
22}
23
24#[derive(Debug, Copy, Clone, PartialEq, Eq, ScryptoSbor)]
25pub struct ProofMoveableSubstate {
26    /// Whether movement of this proof is restricted.
27    pub restricted: bool,
28}
29
30impl ProofMoveableSubstate {
31    pub fn change_to_restricted(&mut self) {
32        self.restricted = true;
33    }
34}