radix_engine_interface/blueprints/
hooks.rs

1use crate::internal_prelude::*;
2use crate::types::BlueprintId;
3use radix_common::types::GlobalAddressReservation;
4use radix_common::types::NodeId;
5
6#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor)]
7pub struct OnVirtualizeInput {
8    pub variant_id: u8,
9    pub rid: [u8; NodeId::RID_LENGTH],
10    pub address_reservation: GlobalAddressReservation,
11}
12
13pub type OnVirtualizeOutput = ();
14
15#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor)]
16pub struct OnDropInput {}
17
18pub type OnDropOutput = ();
19
20// TODO: expose generic information, but fully-detailed actor? and then remove `is_to_barrier`.
21#[derive(Debug, Clone, Eq, PartialEq, ScryptoSbor)]
22pub struct OnMoveInput {
23    /// True if the node moves from caller to callee, otherwise false.
24    pub is_moving_down: bool,
25
26    /// True if the destination actor is a barrier, otherwise false.
27    pub is_to_barrier: bool,
28
29    /// The destination blueprint id.
30    pub destination_blueprint_id: Option<BlueprintId>,
31}
32
33pub type OnMoveOutput = ();