mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-20 15:10:32 +00:00
polish
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
|
||||
use crate::impl_to_bytes;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Bus {
|
||||
@@ -13,8 +15,4 @@ pub struct Bus {
|
||||
pub available_rewards: u64,
|
||||
}
|
||||
|
||||
impl Bus {
|
||||
pub fn to_bytes(&self) -> &[u8] {
|
||||
bytemuck::bytes_of(self)
|
||||
}
|
||||
}
|
||||
impl_to_bytes!(Bus);
|
||||
|
||||
@@ -3,6 +3,8 @@ use std::mem::transmute;
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use solana_program::keccak::{Hash as KeccakHash, HASH_BYTES};
|
||||
|
||||
use crate::impl_to_bytes;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
pub struct Hash(pub [u8; HASH_BYTES]);
|
||||
@@ -20,3 +22,5 @@ impl From<Hash> for KeccakHash {
|
||||
unsafe { transmute(value) }
|
||||
}
|
||||
}
|
||||
|
||||
impl_to_bytes!(Hash);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use solana_program::pubkey::Pubkey;
|
||||
|
||||
use crate::impl_to_bytes;
|
||||
|
||||
use super::Hash;
|
||||
|
||||
#[repr(C)]
|
||||
@@ -25,8 +27,4 @@ pub struct Proof {
|
||||
pub total_rewards: u64,
|
||||
}
|
||||
|
||||
impl Proof {
|
||||
pub fn to_bytes(&self) -> &[u8] {
|
||||
bytemuck::bytes_of(self)
|
||||
}
|
||||
}
|
||||
impl_to_bytes!(Proof);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use solana_program::pubkey::Pubkey;
|
||||
|
||||
use crate::impl_to_bytes;
|
||||
|
||||
use super::Hash;
|
||||
|
||||
#[repr(C)]
|
||||
@@ -25,8 +27,4 @@ pub struct Treasury {
|
||||
pub total_claimed_rewards: u64,
|
||||
}
|
||||
|
||||
impl Treasury {
|
||||
pub fn to_bytes(&self) -> &[u8] {
|
||||
bytemuck::bytes_of(self)
|
||||
}
|
||||
}
|
||||
impl_to_bytes!(Treasury);
|
||||
|
||||
Reference in New Issue
Block a user