Skip to main content

drive/state_transition_action/shielded/unshield/v0/
mod.rs

1mod transformer;
2
3use crate::state_transition_action::shielded::ShieldedActionNote;
4use dpp::address_funds::PlatformAddress;
5use dpp::fee::Credits;
6
7/// Unshield transition action v0
8#[derive(Debug, Clone)]
9pub struct UnshieldTransitionActionV0 {
10    /// The address receiving unshielded funds
11    pub output_address: PlatformAddress,
12    /// Amount being unshielded
13    pub amount: Credits,
14    /// Notes from the orchard bundle actions
15    pub notes: Vec<ShieldedActionNote>,
16    /// The anchor used for verification
17    pub anchor: [u8; 32],
18    /// Shielded fee paid to proposers, carved out of `amount` (the recipient
19    /// receives `amount - fee_amount`). For an ordinary `Unshield` this equals
20    /// `compute_shielded_unshield_fee` (the base shielded minimum fee plus the
21    /// flat `AddBalanceToAddress` output-write storage cost). When
22    /// `chargeable_failure` is set (the `IdentityCreateFromShieldedPool`
23    /// fallback) it is instead the failure penalty.
24    pub fee_amount: Credits,
25    /// Current total balance of the shielded pool
26    pub current_total_balance: Credits,
27    /// `false` for an ordinary `Unshield`. `true` ONLY when this action is the
28    /// chargeable failure of an `IdentityCreateFromShieldedPool` (the spend is
29    /// finalized to `output_address` minus the penalty even though identity
30    /// creation failed). This flag is what authorizes the `PaidFromShieldedPool`
31    /// execution event to apply its ops despite the attached consensus errors —
32    /// so the apply-despite-errors invariant is type-enforced rather than only
33    /// comment-enforced. An ordinary `Unshield` must NEVER set it.
34    pub chargeable_failure: bool,
35}