mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 07:26:51 +00:00
new macros
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use drillx::Solution;
|
||||
use num_enum::TryFromPrimitive;
|
||||
use ore_utils::{impl_instruction_from_bytes, impl_to_bytes};
|
||||
use ore_utils::instruction;
|
||||
use solana_program::{
|
||||
instruction::{AccountMeta, Instruction},
|
||||
pubkey::Pubkey,
|
||||
@@ -82,19 +82,12 @@ pub struct UpgradeArgs {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
impl_to_bytes!(InitializeArgs);
|
||||
impl_to_bytes!(OpenArgs);
|
||||
impl_to_bytes!(MineArgs);
|
||||
impl_to_bytes!(ClaimArgs);
|
||||
impl_to_bytes!(StakeArgs);
|
||||
impl_to_bytes!(UpgradeArgs);
|
||||
|
||||
impl_instruction_from_bytes!(InitializeArgs);
|
||||
impl_instruction_from_bytes!(OpenArgs);
|
||||
impl_instruction_from_bytes!(MineArgs);
|
||||
impl_instruction_from_bytes!(ClaimArgs);
|
||||
impl_instruction_from_bytes!(StakeArgs);
|
||||
impl_instruction_from_bytes!(UpgradeArgs);
|
||||
instruction!(InitializeArgs);
|
||||
instruction!(OpenArgs);
|
||||
instruction!(MineArgs);
|
||||
instruction!(ClaimArgs);
|
||||
instruction!(StakeArgs);
|
||||
instruction!(UpgradeArgs);
|
||||
|
||||
/// Builds an auth instruction.
|
||||
pub fn auth(proof: Pubkey) -> Instruction {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
|
||||
use ore_utils::{account, Discriminator};
|
||||
|
||||
use super::AccountDiscriminator;
|
||||
|
||||
@@ -28,5 +28,4 @@ impl Discriminator for Bus {
|
||||
}
|
||||
}
|
||||
|
||||
impl_to_bytes!(Bus);
|
||||
impl_account_from_bytes!(Bus);
|
||||
account!(Bus);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
|
||||
use ore_utils::{account, Discriminator};
|
||||
|
||||
use super::AccountDiscriminator;
|
||||
|
||||
@@ -26,5 +26,4 @@ impl Discriminator for Config {
|
||||
}
|
||||
}
|
||||
|
||||
impl_to_bytes!(Config);
|
||||
impl_account_from_bytes!(Config);
|
||||
account!(Config);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
|
||||
use ore_utils::{account, Discriminator};
|
||||
use solana_program::pubkey::Pubkey;
|
||||
|
||||
use super::AccountDiscriminator;
|
||||
@@ -43,5 +43,4 @@ impl Discriminator for Proof {
|
||||
}
|
||||
}
|
||||
|
||||
impl_to_bytes!(Proof);
|
||||
impl_account_from_bytes!(Proof);
|
||||
account!(Proof);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
|
||||
use ore_utils::{account, Discriminator};
|
||||
|
||||
use super::AccountDiscriminator;
|
||||
|
||||
@@ -15,5 +15,4 @@ impl Discriminator for Treasury {
|
||||
}
|
||||
}
|
||||
|
||||
impl_to_bytes!(Treasury);
|
||||
impl_account_from_bytes!(Treasury);
|
||||
account!(Treasury);
|
||||
|
||||
Reference in New Issue
Block a user