From 6719b90a32b745bd897861d4921a85795e266d53 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Wed, 29 Jan 2025 15:15:20 +0000 Subject: [PATCH] cli: demote solana-sdk to dev deps (#4681) * cli: demote solana-sdk to dev deps * missing dev dep * switch to normal test assertion --- cli/Cargo.toml | 2 +- cli/src/cluster_query.rs | 11 ++++++++++- cli/src/feature.rs | 9 ++++----- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 6d98962d2272d1..f7ddaeea9af303 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -69,7 +69,6 @@ solana-rpc-client = { workspace = true, features = ["default"] } solana-rpc-client-api = { workspace = true } solana-rpc-client-nonce-utils = { workspace = true, features = ["clap"] } solana-sbpf = { workspace = true } -solana-sdk = { workspace = true } solana-sdk-ids = { workspace = true } solana-signature = { workspace = true } solana-signer = { workspace = true } @@ -95,6 +94,7 @@ solana-faucet = { workspace = true } solana-nonce-account = { workspace = true } solana-presigner = { workspace = true } solana-rpc = { workspace = true } +solana-sdk = { workspace = true } solana-sha256-hasher = { workspace = true } solana-streamer = { workspace = true } solana-test-validator = { workspace = true } diff --git a/cli/src/cluster_query.rs b/cli/src/cluster_query.rs index 4b807ff456518a..9498229adb2970 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -50,7 +50,6 @@ use { request::DELINQUENT_VALIDATOR_SLOT_DISTANCE, response::{RpcPerfSample, RpcPrioritizationFee, SlotInfo}, }, - solana_sdk::rpc_port::DEFAULT_RPC_PORT_STR, solana_sdk_ids::sysvar::{self, stake_history}, solana_signature::Signature, solana_slot_history::{self as slot_history, SlotHistory}, @@ -77,6 +76,8 @@ use { thiserror::Error, }; +const DEFAULT_RPC_PORT_STR: &str = "8899"; + pub trait ClusterQuerySubCommands { fn cluster_query_subcommands(self) -> Self; } @@ -2434,4 +2435,12 @@ mod tests { } ); } + + #[test] + fn check_default_rpc_port_inline() { + assert_eq!( + DEFAULT_RPC_PORT_STR, + solana_sdk::rpc_port::DEFAULT_RPC_PORT_STR + ) + } } diff --git a/cli/src/feature.rs b/cli/src/feature.rs index 7742dd8b912c5b..aa98500fce83d6 100644 --- a/cli/src/feature.rs +++ b/cli/src/feature.rs @@ -21,7 +21,7 @@ use { solana_feature_gate_client::{ errors::SolanaFeatureGateError, instructions::RevokePendingActivation, }, - solana_feature_gate_interface::Feature, + solana_feature_gate_interface::{activate_with_lamports, from_account, Feature}, solana_feature_set::FEATURE_NAMES, solana_message::Message, solana_pubkey::Pubkey, @@ -31,7 +31,6 @@ use { client_error::Error as ClientError, request::MAX_MULTIPLE_ACCOUNTS, response::RpcVoteAccountInfo, }, - solana_sdk::feature, solana_sdk_ids::{incinerator, system_program}, solana_system_interface::error::SystemError, solana_transaction::Transaction, @@ -878,7 +877,7 @@ fn feature_activation_allowed( } pub(super) fn status_from_account(account: Account) -> Option { - feature::from_account(&account).map(|feature| match feature.activated_at { + from_account(&account).map(|feature| match feature.activated_at { None => CliFeatureStatus::Pending, Some(activation_slot) => CliFeatureStatus::Active(activation_slot), }) @@ -1000,7 +999,7 @@ fn process_activate( .unwrap(); if let Some(account) = account { - if feature::from_account(&account).is_some() { + if from_account(&account).is_some() { return Err(format!("{feature_id} has already been activated").into()); } } @@ -1033,7 +1032,7 @@ fn process_activate( ComputeUnitLimit::Default, |lamports| { Message::new( - &feature::activate_with_lamports(&feature_id, &fee_payer.pubkey(), lamports), + &activate_with_lamports(&feature_id, &fee_payer.pubkey(), lamports), Some(&fee_payer.pubkey()), ) },