initialize

This commit is contained in:
Hardhat Chad
2024-02-13 17:36:36 +00:00
parent cb30817447
commit 68bb762e5c
14 changed files with 565 additions and 440 deletions

20
src/state/bus.rs Normal file
View File

@@ -0,0 +1,20 @@
use bytemuck::{Pod, Zeroable};
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Bus {
/// The bump of the bus account PDA.
pub bump: u32,
/// The ID of the bus account.
pub id: u32,
/// The quantity of rewards this bus can issue in the current epoch epoch.
pub available_rewards: u64,
}
impl Bus {
pub fn to_bytes(&self) -> &[u8] {
bytemuck::bytes_of(self)
}
}