dpp/tokens/token_payment_info/v1/v1_accessors.rs
1use crate::tokens::token_payment_info::v1::TokenShieldedPayment;
2
3/// Accessors for the shielded payment a `TokenPaymentInfo` may carry (format version 1 and up).
4pub trait TokenPaymentInfoAccessorsV1 {
5 /// The spend bundle paying the token cost out of the token's shielded pool, when the
6 /// payment is shielded (`V1`); `None` for a `V0` that pays from the identity's balance.
7 fn shielded_payment(&self) -> Option<&TokenShieldedPayment>;
8
9 /// Sets or clears the shielded payment. Setting one on a `V0` upgrades it to `V1`;
10 /// clearing a `V1`'s downgrades it to `V0`, so a payment info without a pool payment
11 /// always has the `V0` shape.
12 fn set_shielded_payment(&mut self, shielded_payment: Option<TokenShieldedPayment>);
13}