Skip to content

Commit

Permalink
remove solana-sdk from cli-output (#4362)
Browse files Browse the repository at this point in the history
* remove solana-sdk from cli-output

* missing dev dep
  • Loading branch information
kevinheavey authored Jan 10, 2025
1 parent 67d5858 commit c853b2c
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 56 deletions.
21 changes: 20 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion cli-output/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,36 @@ pretty-hex = { workspace = true }
semver = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
solana-account = { workspace = true }
solana-account-decoder = { workspace = true }
solana-bincode = { workspace = true }
solana-clap-utils = { workspace = true }
solana-cli-config = { workspace = true }
solana-clock = { workspace = true }
solana-epoch-info = { workspace = true }
solana-hash = { workspace = true }
solana-message = { workspace = true }
solana-native-token = { workspace = true }
solana-packet = { workspace = true }
solana-program = { workspace = true }
solana-pubkey = { workspace = true }
solana-reserved-account-keys = { workspace = true }
solana-rpc-client-api = { workspace = true }
solana-sdk = { workspace = true }
solana-sdk-ids = { workspace = true }
solana-signature = { workspace = true }
solana-system-interface = { workspace = true }
solana-sysvar = { workspace = true }
solana-transaction = { workspace = true }
solana-transaction-error = { workspace = true }
solana-transaction-status = { workspace = true }
solana-vote-program = { workspace = true }
spl-memo = { workspace = true, features = ["no-entrypoint"] }

[dev-dependencies]
ed25519-dalek = { workspace = true }
solana-keypair = { workspace = true }
solana-signer = { workspace = true }
solana-transaction-context = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
39 changes: 19 additions & 20 deletions cli-output/src/cli_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,26 @@ use {
inflector::cases::titlecase::to_title_case,
serde::{Deserialize, Serialize},
serde_json::{Map, Value},
solana_account::ReadableAccount,
solana_account_decoder::{
encode_ui_account, parse_account_data::AccountAdditionalDataV2,
parse_token::UiTokenAccount, UiAccountEncoding, UiDataSliceConfig,
},
solana_clap_utils::keypair::SignOnly,
solana_clock::{Epoch, Slot, UnixTimestamp},
solana_epoch_info::EpochInfo,
solana_hash::Hash,
solana_native_token::lamports_to_sol,
solana_program::stake::state::{Authorized, Lockup},
solana_pubkey::Pubkey,
solana_rpc_client_api::response::{
RpcAccountBalance, RpcContactInfo, RpcInflationGovernor, RpcInflationRate, RpcKeyedAccount,
RpcSupply, RpcVoteAccountInfo,
},
solana_sdk::{
account::ReadableAccount,
clock::{Epoch, Slot, UnixTimestamp},
epoch_info::EpochInfo,
hash::Hash,
native_token::lamports_to_sol,
pubkey::Pubkey,
signature::Signature,
stake::state::{Authorized, Lockup},
stake_history::StakeHistoryEntry,
transaction::{Transaction, TransactionError, VersionedTransaction},
},
solana_signature::Signature,
solana_sysvar::stake_history::StakeHistoryEntry,
solana_transaction::{versioned::VersionedTransaction, Transaction},
solana_transaction_error::TransactionError,
solana_transaction_status::{
EncodedConfirmedBlock, EncodedTransaction, TransactionConfirmationStatus,
UiTransactionStatusMeta,
Expand Down Expand Up @@ -3280,13 +3279,13 @@ mod tests {
use {
super::*,
clap::{App, Arg},
solana_sdk::{
message::Message,
pubkey::Pubkey,
signature::{keypair_from_seed, NullSigner, Signature, Signer, SignerError},
system_instruction,
transaction::Transaction,
},
solana_keypair::keypair_from_seed,
solana_message::Message,
solana_pubkey::Pubkey,
solana_signature::Signature,
solana_signer::{null_signer::NullSigner, Signer, SignerError},
solana_system_interface::instruction::transfer,
solana_transaction::Transaction,
};

#[test]
Expand Down Expand Up @@ -3324,7 +3323,7 @@ mod tests {
let fee_payer = absent.pubkey();
let nonce_auth = bad.pubkey();
let mut tx = Transaction::new_unsigned(Message::new_with_nonce(
vec![system_instruction::transfer(&from, &to, 42)],
vec![transfer(&from, &to, 42)],
Some(&fee_payer),
&nonce,
&nonce_auth,
Expand Down
66 changes: 34 additions & 32 deletions cli-output/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ use {
chrono::{DateTime, Local, SecondsFormat, TimeZone, Utc},
console::style,
indicatif::{ProgressBar, ProgressStyle},
solana_bincode::limited_deserialize,
solana_cli_config::SettingType,
solana_sdk::{
clock::UnixTimestamp,
hash::Hash,
instruction::CompiledInstruction,
message::v0::MessageAddressTableLookup,
native_token::lamports_to_sol,
program_utils::limited_deserialize,
pubkey::Pubkey,
reserved_account_keys::ReservedAccountKeys,
signature::Signature,
stake,
transaction::{TransactionError, TransactionVersion, VersionedTransaction},
},
solana_clock::UnixTimestamp,
solana_hash::Hash,
solana_message::{compiled_instruction::CompiledInstruction, v0::MessageAddressTableLookup},
solana_native_token::lamports_to_sol,
solana_program::stake,
solana_pubkey::Pubkey,
solana_reserved_account_keys::ReservedAccountKeys,
solana_signature::Signature,
solana_transaction::versioned::{TransactionVersion, VersionedTransaction},
solana_transaction_error::TransactionError,
solana_transaction_status::{
Rewards, UiReturnDataEncoding, UiTransactionReturnData, UiTransactionStatusMeta,
},
Expand Down Expand Up @@ -440,24 +438,29 @@ fn write_instruction<'a, W: io::Write>(
let mut raw = true;
if let AccountKeyType::Known(program_pubkey) = program_pubkey {
if program_pubkey == &solana_vote_program::id() {
if let Ok(vote_instruction) = limited_deserialize::<
solana_vote_program::vote_instruction::VoteInstruction,
>(&instruction.data)
if let Ok(vote_instruction) =
limited_deserialize::<solana_vote_program::vote_instruction::VoteInstruction>(
&instruction.data,
solana_packet::PACKET_DATA_SIZE as u64,
)
{
writeln!(w, "{prefix} {vote_instruction:?}")?;
raw = false;
}
} else if program_pubkey == &stake::program::id() {
if let Ok(stake_instruction) =
limited_deserialize::<stake::instruction::StakeInstruction>(&instruction.data)
{
if let Ok(stake_instruction) = limited_deserialize::<stake::instruction::StakeInstruction>(
&instruction.data,
solana_packet::PACKET_DATA_SIZE as u64,
) {
writeln!(w, "{prefix} {stake_instruction:?}")?;
raw = false;
}
} else if program_pubkey == &solana_sdk::system_program::id() {
if let Ok(system_instruction) = limited_deserialize::<
solana_sdk::system_instruction::SystemInstruction,
>(&instruction.data)
} else if program_pubkey == &solana_sdk_ids::system_program::id() {
if let Ok(system_instruction) =
limited_deserialize::<solana_system_interface::instruction::SystemInstruction>(
&instruction.data,
solana_packet::PACKET_DATA_SIZE as u64,
)
{
writeln!(w, "{prefix} {system_instruction:?}")?;
raw = false;
Expand Down Expand Up @@ -723,16 +726,15 @@ pub fn unix_timestamp_to_string(unix_timestamp: UnixTimestamp) -> String {
mod test {
use {
super::*,
solana_sdk::{
message::{
v0::{self, LoadedAddresses},
Message as LegacyMessage, MessageHeader, VersionedMessage,
},
pubkey::Pubkey,
signature::{Keypair, Signer},
transaction::Transaction,
transaction_context::TransactionReturnData,
solana_keypair::Keypair,
solana_message::{
v0::{self, LoadedAddresses},
Message as LegacyMessage, MessageHeader, VersionedMessage,
},
solana_pubkey::Pubkey,
solana_signer::Signer,
solana_transaction::Transaction,
solana_transaction_context::TransactionReturnData,
solana_transaction_status::{Reward, RewardType, TransactionStatusMeta},
std::io::BufWriter,
};
Expand Down
18 changes: 17 additions & 1 deletion programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion svm/examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c853b2c

Please sign in to comment.