fix utils import

This commit is contained in:
Hardhat Chad
2024-08-24 13:59:28 +00:00
parent a6062bc6a7
commit 6cae0d773b
11 changed files with 15 additions and 24 deletions

6
Cargo.lock generated
View File

@@ -1286,7 +1286,7 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
[[package]]
name = "ore-api"
version = "2.1.2"
version = "2.1.3"
dependencies = [
"array-const-fn-init",
"bytemuck",
@@ -1304,7 +1304,7 @@ dependencies = [
[[package]]
name = "ore-program"
version = "2.1.2"
version = "2.1.3"
dependencies = [
"drillx",
"mpl-token-metadata",
@@ -1318,7 +1318,7 @@ dependencies = [
[[package]]
name = "ore-utils"
version = "2.1.2"
version = "2.1.3"
dependencies = [
"bytemuck",
"solana-program",

View File

@@ -3,7 +3,7 @@ resolver = "2"
members = ["api", "program", "utils"]
[workspace.package]
version = "2.1.2"
version = "2.1.3"
edition = "2021"
license = "Apache-2.0"
homepage = "https://ore.supply"
@@ -19,8 +19,8 @@ const-crypto = "0.1.0"
drillx = { version = "2.0.0", features = ["solana"] }
mpl-token-metadata = "4.1.2"
num_enum = "0.7.2"
ore-api = { path = "api", version = "2.1.0" }
ore-utils = { path = "utils", features = ["spl"], version = "2.1.0" }
ore-api = { path = "api", version = "2.1.3" }
ore-utils = { path = "utils", features = ["spl"], version = "2.1.3" }
solana-program = "^1.18"
spl-token = { version = "^4", features = ["no-entrypoint"] }
spl-associated-token-account = { version = "^2.3", features = [ "no-entrypoint" ] }

View File

@@ -1,6 +1,5 @@
use bytemuck::{Pod, Zeroable};
use crate::utils::impl_to_bytes;
use ore_utils::impl_to_bytes;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]

View File

@@ -1,16 +1,14 @@
use bytemuck::{Pod, Zeroable};
use drillx::Solution;
use num_enum::TryFromPrimitive;
use ore_utils::{impl_instruction_from_bytes, impl_to_bytes};
use solana_program::{
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
system_program, sysvar,
};
use crate::{
consts::*,
utils::{impl_instruction_from_bytes, impl_to_bytes},
};
use crate::consts::*;
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]

View File

@@ -5,8 +5,6 @@ pub mod instruction;
pub mod loaders;
pub mod state;
pub(crate) use ore_utils as utils;
use solana_program::declare_id;
declare_id!("oreV2ZymfyeXgNgBdqMkumTqqAprVqgBWQfoYkrtKWQ");

View File

@@ -1,9 +1,9 @@
use ore_utils::{loaders::*, AccountDeserialize, Discriminator};
use solana_program::{account_info::AccountInfo, program_error::ProgramError, pubkey::Pubkey};
use crate::{
consts::*,
state::{Bus, Config, Proof, Treasury},
utils::{loaders::*, AccountDeserialize, Discriminator},
};
/// Errors if:

View File

@@ -1,6 +1,5 @@
use bytemuck::{Pod, Zeroable};
use crate::utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use super::AccountDiscriminator;

View File

@@ -1,6 +1,5 @@
use bytemuck::{Pod, Zeroable};
use crate::utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use super::AccountDiscriminator;

View File

@@ -1,8 +1,7 @@
use bytemuck::{Pod, Zeroable};
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use solana_program::pubkey::Pubkey;
use crate::utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use super::AccountDiscriminator;
/// Proof accounts track a miner's current hash, claimable rewards, and lifetime stats.

View File

@@ -1,6 +1,5 @@
use bytemuck::{Pod, Zeroable};
use crate::utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use ore_utils::{impl_account_from_bytes, impl_to_bytes, Discriminator};
use super::AccountDiscriminator;

View File

@@ -98,7 +98,7 @@ macro_rules! impl_to_bytes {
#[macro_export]
macro_rules! impl_account_from_bytes {
($struct_name:ident) => {
impl crate::utils::AccountDeserialize for $struct_name {
impl $crate::AccountDeserialize for $struct_name {
fn try_from_bytes(
data: &[u8],
) -> Result<&Self, solana_program::program_error::ProgramError> {