Skip to content

Commit

Permalink
cli: demote solana-sdk to dev deps (#4681)
Browse files Browse the repository at this point in the history
* cli: demote solana-sdk to dev deps

* missing dev dep

* switch to normal test assertion
  • Loading branch information
kevinheavey authored Jan 29, 2025
1 parent 99f9c7c commit 6719b90
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down
11 changes: 10 additions & 1 deletion cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -77,6 +76,8 @@ use {
thiserror::Error,
};

const DEFAULT_RPC_PORT_STR: &str = "8899";

pub trait ClusterQuerySubCommands {
fn cluster_query_subcommands(self) -> Self;
}
Expand Down Expand Up @@ -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
)
}
}
9 changes: 4 additions & 5 deletions cli/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -878,7 +877,7 @@ fn feature_activation_allowed(
}

pub(super) fn status_from_account(account: Account) -> Option<CliFeatureStatus> {
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),
})
Expand Down Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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()),
)
},
Expand Down

0 comments on commit 6719b90

Please sign in to comment.