From 9df7afbaba1702db9a267ae4744953a8bd6751c2 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Mon, 9 Dec 2024 21:18:58 +0400 Subject: [PATCH] remove solana-sdk from transaction-metrics-tracker dev deps (#3991) * remove solana-sdk from transaction-metrics-tracker dev deps * fmt --- Cargo.lock | 5 ++++- transaction-metrics-tracker/Cargo.toml | 5 ++++- transaction-metrics-tracker/src/lib.rs | 14 +++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dd4dcb7689234..c2ad7bcf6dfe94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9583,11 +9583,14 @@ dependencies = [ "lazy_static", "log", "rand 0.8.5", + "solana-hash", + "solana-keypair", "solana-packet", "solana-perf", - "solana-sdk", + "solana-pubkey", "solana-short-vec", "solana-signature", + "solana-system-transaction", ] [[package]] diff --git a/transaction-metrics-tracker/Cargo.toml b/transaction-metrics-tracker/Cargo.toml index 3d6c28396a245c..cdebb328609964 100644 --- a/transaction-metrics-tracker/Cargo.toml +++ b/transaction-metrics-tracker/Cargo.toml @@ -22,7 +22,10 @@ solana-short-vec = { workspace = true } solana-signature = { workspace = true } [dev-dependencies] -solana-sdk = { workspace = true } +solana-hash = { workspace = true } +solana-keypair = { workspace = true } +solana-pubkey = { workspace = true, features = ["rand"] } +solana-system-transaction = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/transaction-metrics-tracker/src/lib.rs b/transaction-metrics-tracker/src/lib.rs index 4b72b22ddf9c74..8426b159f79133 100644 --- a/transaction-metrics-tracker/src/lib.rs +++ b/transaction-metrics-tracker/src/lib.rs @@ -54,12 +54,8 @@ pub fn get_signature_from_packet(packet: &Packet) -> Result<&[u8; SIGNATURE_BYTE #[cfg(test)] mod tests { use { - super::*, - solana_sdk::{ - hash::Hash, - signature::{Keypair, Signature}, - system_transaction, - }, + super::*, solana_hash::Hash, solana_keypair::Keypair, solana_signature::Signature, + solana_system_transaction as system_transaction, }; #[test] @@ -72,7 +68,7 @@ mod tests { // Use a valid transaction, it should succeed let tx = system_transaction::transfer( &Keypair::new(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, Hash::new_unique(), ); @@ -116,7 +112,7 @@ mod tests { // Use a valid transaction which is not matched let tx = system_transaction::transfer( &Keypair::new(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, Hash::new_unique(), ); @@ -127,7 +123,7 @@ mod tests { // Now simulate a txn matching the signature mask let mut tx = system_transaction::transfer( &Keypair::new(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, Hash::new_unique(), );