mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-16 15:10:20 +00:00
cleanup
This commit is contained in:
13
src/utils.rs
13
src/utils.rs
@@ -1,3 +1,4 @@
|
||||
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
||||
use solana_program::{
|
||||
account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey, rent::Rent,
|
||||
sysvar::Sysvar,
|
||||
@@ -32,6 +33,18 @@ pub fn create_pda<'a, 'info>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[repr(u8)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
|
||||
pub enum AccountDiscriminator {
|
||||
Bus = 100,
|
||||
Proof = 101,
|
||||
Treasury = 102,
|
||||
}
|
||||
|
||||
pub trait Discriminator {
|
||||
fn discriminator() -> AccountDiscriminator;
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! impl_to_bytes {
|
||||
($struct_name:ident) => {
|
||||
|
||||
Reference in New Issue
Block a user