solalumin-state 0.1.0-alpha.1

Supporting library for Solalumin structures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub trait SchemaEvent: borsh::BorshSerialize + borsh::BorshDeserialize + borsh::BorshSchema {
    fn generate_schema(self) -> Vec<u8>;
    fn data(&self) -> Vec<u8>;
}

pub trait SchemaEventAnchor: borsh::BorshSchema {
    fn generate_schema(self) -> Vec<u8>;
}

/// 8 byte unique identifier for a type.
pub trait Discriminator {
    const DISCRIMINATOR: [u8; 8];
    fn discriminator() -> [u8; 8] {
        Self::DISCRIMINATOR
    }
}