From c32d0df3f7c98d9190780d5019ab0cc45bca1dca Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Tue, 15 Oct 2024 21:14:16 +0400 Subject: [PATCH] avoid solana-program in inline-spl (#3178) --- Cargo.lock | 2 +- inline-spl/Cargo.toml | 4 +++- inline-spl/src/associated_token_account.rs | 4 ++-- inline-spl/src/token.rs | 8 ++++---- inline-spl/src/token_2022.rs | 2 +- programs/sbf/Cargo.lock | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 057209c5eb032f..73bd1a01af5205 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6846,7 +6846,7 @@ name = "solana-inline-spl" version = "2.1.0" dependencies = [ "bytemuck", - "solana-program", + "solana-pubkey", ] [[package]] diff --git a/inline-spl/Cargo.toml b/inline-spl/Cargo.toml index 82aa5907ce0aa2..132e10f07ab533 100644 --- a/inline-spl/Cargo.toml +++ b/inline-spl/Cargo.toml @@ -11,7 +11,9 @@ edition = { workspace = true } [dependencies] bytemuck = { workspace = true } -solana-program = { workspace = true, default-features = false } +solana-pubkey = { workspace = true, default-features = false, features = [ + "bytemuck", +] } [lib] crate-type = ["lib"] diff --git a/inline-spl/src/associated_token_account.rs b/inline-spl/src/associated_token_account.rs index 2048c5b743d222..289dc0f8555e47 100644 --- a/inline-spl/src/associated_token_account.rs +++ b/inline-spl/src/associated_token_account.rs @@ -1,6 +1,6 @@ // Partial SPL Associated Token Account declarations inlined to avoid an external dependency on the spl-associated-token-account crate -solana_program::declare_id!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"); +solana_pubkey::declare_id!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"); pub mod program_v1_1_0 { - solana_program::declare_id!("NatA1Zyo48dJ7yuwR7cGURwhskKA8ywUyxb9GvG7mTC"); + solana_pubkey::declare_id!("NatA1Zyo48dJ7yuwR7cGURwhskKA8ywUyxb9GvG7mTC"); } diff --git a/inline-spl/src/token.rs b/inline-spl/src/token.rs index 1a495d8ca3a241..af456c3b6242a7 100644 --- a/inline-spl/src/token.rs +++ b/inline-spl/src/token.rs @@ -1,10 +1,10 @@ /// Partial SPL Token declarations inlined to avoid an external dependency on the spl-token crate -use solana_program::pubkey::{Pubkey, PUBKEY_BYTES}; +use solana_pubkey::{Pubkey, PUBKEY_BYTES}; -solana_program::declare_id!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"); +solana_pubkey::declare_id!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"); pub mod program_v3_4_0 { - solana_program::declare_id!("NToK4t5AQzxPNpUA84DkxgfXaVDbDQQjpHKCqsbY46B"); + solana_pubkey::declare_id!("NToK4t5AQzxPNpUA84DkxgfXaVDbDQQjpHKCqsbY46B"); } /* @@ -72,7 +72,7 @@ impl GenericTokenAccount for Account { } pub mod native_mint { - solana_program::declare_id!("So11111111111111111111111111111111111111112"); + solana_pubkey::declare_id!("So11111111111111111111111111111111111111112"); /* Mint { diff --git a/inline-spl/src/token_2022.rs b/inline-spl/src/token_2022.rs index 4b0e0d1b3c05db..fafa2b4cfce68a 100644 --- a/inline-spl/src/token_2022.rs +++ b/inline-spl/src/token_2022.rs @@ -1,7 +1,7 @@ /// Partial SPL Token declarations inlined to avoid an external dependency on the spl-token-2022 crate use crate::token::{self, GenericTokenAccount}; -solana_program::declare_id!("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"); +solana_pubkey::declare_id!("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"); // `spl_token_program_2022::extension::AccountType::Account` ordinal value pub const ACCOUNTTYPE_ACCOUNT: u8 = 2; diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 78eca1fe59da24..8d7a199fc4fa6b 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5420,7 +5420,7 @@ name = "solana-inline-spl" version = "2.1.0" dependencies = [ "bytemuck", - "solana-program", + "solana-pubkey", ] [[package]]