hpl_toolkit/utils/
types.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use anchor_lang::prelude::*;

#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq)]
pub enum AddOrRemove<T: AnchorSerialize + AnchorDeserialize + Clone + PartialEq> {
    Add(T),
    Remove(T),
}

#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq)]
pub enum DataOrHash<T: AnchorSerialize + AnchorDeserialize + Clone + PartialEq> {
    Data(T),
    Hash([u8; 32]),
}