diff --git a/archiver-lib/src/archiver.rs b/archiver-lib/src/archiver.rs index 0053a9e865..ac35260459 100644 --- a/archiver-lib/src/archiver.rs +++ b/archiver-lib/src/archiver.rs @@ -36,7 +36,7 @@ use solana_sdk::{ commitment_config::CommitmentConfig, hash::Hash, message::Message, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, timing::timestamp, transaction::Transaction, transport::TransportError, diff --git a/archiver/src/main.rs b/archiver/src/main.rs index ed6ba4bb8b..2b8178aad7 100644 --- a/archiver/src/main.rs +++ b/archiver/src/main.rs @@ -12,7 +12,7 @@ use solana_core::{ cluster_info::{Node, VALIDATOR_PORT_RANGE}, contact_info::ContactInfo, }; -use solana_sdk::{commitment_config::CommitmentConfig, signature::KeypairUtil}; +use solana_sdk::{commitment_config::CommitmentConfig, signature::Signer}; use std::{net::SocketAddr, path::PathBuf, process::exit, sync::Arc}; fn main() { diff --git a/bench-exchange/src/bench.rs b/bench-exchange/src/bench.rs index d84274bee4..a20c21aeeb 100644 --- a/bench-exchange/src/bench.rs +++ b/bench-exchange/src/bench.rs @@ -15,7 +15,7 @@ use solana_sdk::{ client::{Client, SyncClient}, commitment_config::CommitmentConfig, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, timing::{duration_as_ms, duration_as_s}, transaction::Transaction, {system_instruction, system_program}, diff --git a/bench-exchange/src/main.rs b/bench-exchange/src/main.rs index 8d640b394f..640133501d 100644 --- a/bench-exchange/src/main.rs +++ b/bench-exchange/src/main.rs @@ -5,7 +5,7 @@ pub mod order_book; use crate::bench::{airdrop_lamports, create_client_accounts_file, do_bench_exchange, Config}; use log::*; use solana_core::gossip_service::{discover_cluster, get_multi_client}; -use solana_sdk::signature::KeypairUtil; +use solana_sdk::signature::Signer; fn main() { solana_logger::setup(); diff --git a/bench-exchange/tests/bench_exchange.rs b/bench-exchange/tests/bench_exchange.rs index b0de6b7b9b..f5dd1c80be 100644 --- a/bench-exchange/tests/bench_exchange.rs +++ b/bench-exchange/tests/bench_exchange.rs @@ -10,7 +10,7 @@ use solana_local_cluster::local_cluster::{ClusterConfig, LocalCluster}; use solana_runtime::bank::Bank; use solana_runtime::bank_client::BankClient; use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use std::process::exit; use std::sync::mpsc::channel; use std::time::Duration; diff --git a/bench-tps/src/bench.rs b/bench-tps/src/bench.rs index ac0008cb1e..699b7bed3c 100644 --- a/bench-tps/src/bench.rs +++ b/bench-tps/src/bench.rs @@ -15,7 +15,7 @@ use solana_sdk::{ fee_calculator::FeeCalculator, hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, system_transaction, timing::{duration_as_ms, duration_as_s, duration_as_us, timestamp}, transaction::Transaction, diff --git a/bench-tps/src/main.rs b/bench-tps/src/main.rs index 708313c23e..8544ab79bf 100644 --- a/bench-tps/src/main.rs +++ b/bench-tps/src/main.rs @@ -4,7 +4,7 @@ use solana_bench_tps::cli; use solana_core::gossip_service::{discover_cluster, get_client, get_multi_client}; use solana_genesis::Base64Account; use solana_sdk::fee_calculator::FeeCalculator; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_program; use std::{collections::HashMap, fs::File, io::prelude::*, path::Path, process::exit, sync::Arc}; diff --git a/bench-tps/tests/bench_tps.rs b/bench-tps/tests/bench_tps.rs index 7d826cc05b..a7060e7fe3 100644 --- a/bench-tps/tests/bench_tps.rs +++ b/bench-tps/tests/bench_tps.rs @@ -8,7 +8,7 @@ use solana_faucet::faucet::run_local_faucet; use solana_local_cluster::local_cluster::{ClusterConfig, LocalCluster}; #[cfg(feature = "move")] use solana_sdk::move_loader::solana_move_loader_program; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use std::sync::{mpsc::channel, Arc}; use std::time::Duration; diff --git a/book/src/proposals/cluster-test-framework.md b/book/src/proposals/cluster-test-framework.md index 82409f2c55..076ea45976 100644 --- a/book/src/proposals/cluster-test-framework.md +++ b/book/src/proposals/cluster-test-framework.md @@ -22,7 +22,7 @@ Each CTF test starts with an opaque entry point and a funded keypair. The test s ```text use crate::contact_info::ContactInfo; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; pub fn test_this_behavior( entry_point_info: &ContactInfo, funding_keypair: &Keypair, diff --git a/chacha/src/chacha.rs b/chacha/src/chacha.rs index d6ab1ddf2a..b0f3317020 100644 --- a/chacha/src/chacha.rs +++ b/chacha/src/chacha.rs @@ -81,7 +81,7 @@ mod tests { use solana_ledger::get_tmp_ledger_path; use solana_sdk::hash::{hash, Hash, Hasher}; use solana_sdk::pubkey::Pubkey; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_transaction; use std::fs::remove_file; use std::fs::File; diff --git a/clap-utils/src/input_parsers.rs b/clap-utils/src/input_parsers.rs index a0aeefba3e..a2b2c333c3 100644 --- a/clap-utils/src/input_parsers.rs +++ b/clap-utils/src/input_parsers.rs @@ -6,7 +6,7 @@ use solana_sdk::{ clock::UnixTimestamp, native_token::sol_to_lamports, pubkey::Pubkey, - signature::{read_keypair_file, Keypair, KeypairUtil, Signature}, + signature::{read_keypair_file, Keypair, Signature, Signer}, }; use std::str::FromStr; diff --git a/clap-utils/src/keypair.rs b/clap-utils/src/keypair.rs index 4792dd6e23..d8be15ae17 100644 --- a/clap-utils/src/keypair.rs +++ b/clap-utils/src/keypair.rs @@ -3,8 +3,7 @@ use bip39::{Language, Mnemonic, Seed}; use clap::values_t; use rpassword::prompt_password_stderr; use solana_sdk::signature::{ - keypair_from_seed, keypair_from_seed_phrase_and_passphrase, read_keypair_file, Keypair, - KeypairUtil, + keypair_from_seed, keypair_from_seed_phrase_and_passphrase, read_keypair_file, Keypair, Signer, }; use std::{ error, diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 1c1bca18dd..aaea31b661 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -36,7 +36,7 @@ use solana_sdk::{ native_token::lamports_to_sol, program_utils::DecodeError, pubkey::Pubkey, - signature::{keypair_from_seed, Keypair, KeypairUtil, Signature}, + signature::{keypair_from_seed, Keypair, Signature, Signer}, system_instruction::{self, create_address_with_seed, SystemError, MAX_ADDRESS_SEED_LEN}, system_transaction, transaction::{Transaction, TransactionError}, @@ -1974,7 +1974,7 @@ impl FaucetKeypair { } } -impl KeypairUtil for FaucetKeypair { +impl Signer for FaucetKeypair { /// Return the public key of the keypair used to sign votes fn pubkey(&self) -> Pubkey { self.transaction.message().account_keys[0] diff --git a/cli/src/cluster_query.rs b/cli/src/cluster_query.rs index 703879f9e6..71fc4cfe16 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -21,7 +21,7 @@ use solana_sdk::{ epoch_schedule::Epoch, hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, }; use std::{ diff --git a/cli/src/nonce.rs b/cli/src/nonce.rs index 4a2c2e0c35..2b95cb3047 100644 --- a/cli/src/nonce.rs +++ b/cli/src/nonce.rs @@ -13,7 +13,7 @@ use solana_sdk::{ hash::Hash, nonce_state::{Meta, NonceState}, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction::{ advance_nonce_account, authorize_nonce_account, create_address_with_seed, create_nonce_account, create_nonce_account_with_seed, withdraw_nonce_account, NonceError, diff --git a/cli/src/stake.rs b/cli/src/stake.rs index 2cae556a07..6efd74ec5f 100644 --- a/cli/src/stake.rs +++ b/cli/src/stake.rs @@ -16,7 +16,7 @@ use solana_sdk::signature::{Keypair, Signature}; use solana_sdk::{ account_utils::StateMut, pubkey::Pubkey, - signature::KeypairUtil, + signature::Signer, system_instruction::{create_address_with_seed, SystemError}, sysvar::{ stake_history::{self, StakeHistory}, @@ -1499,7 +1499,7 @@ mod tests { use solana_sdk::{ fee_calculator::FeeCalculator, hash::Hash, - signature::{keypair_from_seed, read_keypair_file, write_keypair, KeypairUtil}, + signature::{keypair_from_seed, read_keypair_file, write_keypair, Signer}, }; use tempfile::NamedTempFile; diff --git a/cli/src/storage.rs b/cli/src/storage.rs index e0c6301b1f..dba719dee1 100644 --- a/cli/src/storage.rs +++ b/cli/src/storage.rs @@ -7,7 +7,7 @@ use solana_clap_utils::{input_parsers::*, input_validators::*}; use solana_client::rpc_client::RpcClient; use solana_sdk::signature::Keypair; use solana_sdk::{ - account_utils::StateMut, message::Message, pubkey::Pubkey, signature::KeypairUtil, + account_utils::StateMut, message::Message, pubkey::Pubkey, signature::Signer, system_instruction::SystemError, transaction::Transaction, }; use solana_storage_program::storage_instruction::{self, StorageAccountType}; diff --git a/cli/src/validator_info.rs b/cli/src/validator_info.rs index 41c295fa04..54777d6c18 100644 --- a/cli/src/validator_info.rs +++ b/cli/src/validator_info.rs @@ -19,7 +19,7 @@ use solana_sdk::{ commitment_config::CommitmentConfig, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, transaction::Transaction, }; use std::error; diff --git a/cli/src/vote.rs b/cli/src/vote.rs index cd74016757..167477117f 100644 --- a/cli/src/vote.rs +++ b/cli/src/vote.rs @@ -9,7 +9,7 @@ use solana_sdk::{ account::Account, pubkey::Pubkey, signature::Keypair, - signature::KeypairUtil, + signature::Signer, system_instruction::{create_address_with_seed, SystemError}, transaction::Transaction, }; diff --git a/cli/tests/nonce.rs b/cli/tests/nonce.rs index ce7856bac8..f5f89487f1 100644 --- a/cli/tests/nonce.rs +++ b/cli/tests/nonce.rs @@ -6,7 +6,7 @@ use solana_faucet::faucet::run_local_faucet; use solana_sdk::{ hash::Hash, pubkey::Pubkey, - signature::{read_keypair_file, write_keypair, Keypair, KeypairUtil}, + signature::{read_keypair_file, write_keypair, Keypair, Signer}, system_instruction::create_address_with_seed, system_program, }; diff --git a/cli/tests/pay.rs b/cli/tests/pay.rs index eda6a073ae..9386c38c1c 100644 --- a/cli/tests/pay.rs +++ b/cli/tests/pay.rs @@ -11,7 +11,7 @@ use solana_sdk::{ fee_calculator::FeeCalculator, nonce_state::NonceState, pubkey::Pubkey, - signature::{read_keypair_file, write_keypair, Keypair, KeypairUtil}, + signature::{read_keypair_file, write_keypair, Keypair, Signer}, }; use std::fs::remove_dir_all; use std::sync::mpsc::channel; diff --git a/cli/tests/request_airdrop.rs b/cli/tests/request_airdrop.rs index 0f3e2282cb..931054bf07 100644 --- a/cli/tests/request_airdrop.rs +++ b/cli/tests/request_airdrop.rs @@ -2,7 +2,7 @@ use solana_cli::cli::{process_command, CliCommand, CliConfig}; use solana_client::rpc_client::RpcClient; use solana_core::validator::new_validator_for_tests; use solana_faucet::faucet::run_local_faucet; -use solana_sdk::signature::KeypairUtil; +use solana_sdk::signature::Signer; use std::fs::remove_dir_all; use std::sync::mpsc::channel; diff --git a/cli/tests/stake.rs b/cli/tests/stake.rs index 890a97a01a..bb75922442 100644 --- a/cli/tests/stake.rs +++ b/cli/tests/stake.rs @@ -9,7 +9,7 @@ use solana_sdk::{ fee_calculator::FeeCalculator, nonce_state::NonceState, pubkey::Pubkey, - signature::{keypair_from_seed, read_keypair_file, write_keypair, Keypair, KeypairUtil}, + signature::{keypair_from_seed, read_keypair_file, write_keypair, Keypair, Signer}, system_instruction::create_address_with_seed, }; use solana_stake_program::stake_state::{Lockup, StakeAuthorize, StakeState}; diff --git a/cli/tests/transfer.rs b/cli/tests/transfer.rs index ecf21aada8..487ae679cc 100644 --- a/cli/tests/transfer.rs +++ b/cli/tests/transfer.rs @@ -9,7 +9,7 @@ use solana_sdk::{ fee_calculator::FeeCalculator, nonce_state::NonceState, pubkey::Pubkey, - signature::{keypair_from_seed, read_keypair_file, write_keypair, KeypairUtil}, + signature::{keypair_from_seed, read_keypair_file, write_keypair, Signer}, }; use std::fs::remove_dir_all; use std::sync::mpsc::channel; diff --git a/client/src/thin_client.rs b/client/src/thin_client.rs index fd1327c5e5..ae5ba7534a 100644 --- a/client/src/thin_client.rs +++ b/client/src/thin_client.rs @@ -17,7 +17,7 @@ use solana_sdk::{ message::Message, packet::PACKET_DATA_SIZE, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, signers::Signers, system_instruction, timing::duration_as_ms, diff --git a/core/benches/banking_stage.rs b/core/benches/banking_stage.rs index 6e887dfb15..03850085d1 100644 --- a/core/benches/banking_stage.rs +++ b/core/benches/banking_stage.rs @@ -21,8 +21,8 @@ use solana_sdk::genesis_config::GenesisConfig; use solana_sdk::hash::Hash; use solana_sdk::pubkey::Pubkey; use solana_sdk::signature::Keypair; -use solana_sdk::signature::KeypairUtil; use solana_sdk::signature::Signature; +use solana_sdk::signature::Signer; use solana_sdk::system_instruction; use solana_sdk::system_transaction; use solana_sdk::timing::{duration_as_us, timestamp}; diff --git a/core/benches/poh_verify.rs b/core/benches/poh_verify.rs index 688fd3254f..ba8ab239cc 100644 --- a/core/benches/poh_verify.rs +++ b/core/benches/poh_verify.rs @@ -3,7 +3,7 @@ extern crate test; use solana_ledger::entry::{next_entry_mut, Entry, EntrySlice}; use solana_sdk::hash::{hash, Hash}; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_transaction; use test::Bencher; diff --git a/core/benches/shredder.rs b/core/benches/shredder.rs index 4bfc009a69..ec157bf98b 100644 --- a/core/benches/shredder.rs +++ b/core/benches/shredder.rs @@ -9,7 +9,7 @@ use solana_ledger::shred::{ }; use solana_perf::test_tx; use solana_sdk::hash::Hash; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use std::sync::Arc; use test::Bencher; diff --git a/core/benches/sigverify_stage.rs b/core/benches/sigverify_stage.rs index fe4392a385..252179dc35 100644 --- a/core/benches/sigverify_stage.rs +++ b/core/benches/sigverify_stage.rs @@ -11,7 +11,7 @@ use solana_core::sigverify::TransactionSigVerifier; use solana_core::sigverify_stage::SigVerifyStage; use solana_perf::test_tx::test_tx; use solana_sdk::hash::Hash; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_transaction; use solana_sdk::timing::duration_as_ms; use std::sync::mpsc::channel; diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 66f57d61ba..a16de62a4f 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -1026,7 +1026,7 @@ mod tests { use solana_runtime::bank::HashAgeKind; use solana_sdk::{ instruction::InstructionError, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, transaction::TransactionError, }; diff --git a/core/src/blockstream.rs b/core/src/blockstream.rs index 25e72b229e..a59e4c67b9 100644 --- a/core/src/blockstream.rs +++ b/core/src/blockstream.rs @@ -180,7 +180,7 @@ mod test { use chrono::{DateTime, FixedOffset}; use serde_json::Value; use solana_sdk::hash::Hash; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_transaction; use std::collections::HashSet; use std::path::PathBuf; diff --git a/core/src/blockstream_service.rs b/core/src/blockstream_service.rs index 7632cb3784..76ef0a2a4a 100644 --- a/core/src/blockstream_service.rs +++ b/core/src/blockstream_service.rs @@ -107,7 +107,7 @@ mod test { use solana_ledger::create_new_tmp_ledger; use solana_ledger::entry::{create_ticks, Entry}; use solana_sdk::hash::Hash; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_transaction; use std::path::PathBuf; use std::sync::mpsc::channel; diff --git a/core/src/broadcast_stage.rs b/core/src/broadcast_stage.rs index 2fad2740e7..26eee54194 100644 --- a/core/src/broadcast_stage.rs +++ b/core/src/broadcast_stage.rs @@ -259,7 +259,7 @@ mod test { use solana_runtime::bank::Bank; use solana_sdk::hash::Hash; use solana_sdk::pubkey::Pubkey; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use std::path::Path; use std::sync::atomic::AtomicBool; use std::sync::mpsc::channel; diff --git a/core/src/broadcast_stage/standard_broadcast_run.rs b/core/src/broadcast_stage/standard_broadcast_run.rs index ebe6643bab..87407ce56d 100644 --- a/core/src/broadcast_stage/standard_broadcast_run.rs +++ b/core/src/broadcast_stage/standard_broadcast_run.rs @@ -362,7 +362,7 @@ mod test { use solana_sdk::{ clock::Slot, genesis_config::GenesisConfig, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use std::sync::{Arc, RwLock}; use std::time::Duration; diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index 2868d5ccee..57d3dfc425 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -1891,7 +1891,7 @@ mod tests { use crate::crds_value::CrdsValueLabel; use rayon::prelude::*; use solana_perf::test_tx::test_tx; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use std::collections::HashSet; use std::net::{IpAddr, Ipv4Addr}; use std::sync::{Arc, RwLock}; diff --git a/core/src/cluster_info_vote_listener.rs b/core/src/cluster_info_vote_listener.rs index 5b93c40cc5..ce9882718b 100644 --- a/core/src/cluster_info_vote_listener.rs +++ b/core/src/cluster_info_vote_listener.rs @@ -84,7 +84,7 @@ impl ClusterInfoVoteListener { mod tests { use crate::packet; use solana_sdk::hash::Hash; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::transaction::Transaction; use solana_vote_program::vote_instruction; use solana_vote_program::vote_state::Vote; diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 7782ed3fa5..344af0f337 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -481,7 +481,7 @@ pub mod test { clock::Slot, hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, transaction::Transaction, }; use solana_vote_program::{vote_instruction, vote_state::Vote}; diff --git a/core/src/contact_info.rs b/core/src/contact_info.rs index 8659965d65..44fa9dd793 100644 --- a/core/src/contact_info.rs +++ b/core/src/contact_info.rs @@ -2,7 +2,7 @@ use solana_sdk::pubkey::Pubkey; #[cfg(test)] use solana_sdk::rpc_port; #[cfg(test)] -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::timing::timestamp; use std::cmp::{Ord, Ordering, PartialEq, PartialOrd}; use std::net::{IpAddr, SocketAddr}; diff --git a/core/src/crds_value.rs b/core/src/crds_value.rs index 97e0b1fc28..098db8729c 100644 --- a/core/src/crds_value.rs +++ b/core/src/crds_value.rs @@ -305,7 +305,7 @@ mod test { use crate::contact_info::ContactInfo; use bincode::deserialize; use solana_perf::test_tx::test_tx; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::timing::timestamp; #[test] diff --git a/core/src/gen_keys.rs b/core/src/gen_keys.rs index 89c2d92a13..4f8f4d86d9 100644 --- a/core/src/gen_keys.rs +++ b/core/src/gen_keys.rs @@ -41,7 +41,7 @@ impl GenKeys { mod tests { use super::*; pub use solana_sdk::pubkey::Pubkey; - use solana_sdk::signature::KeypairUtil; + use solana_sdk::signature::Signer; use std::collections::HashSet; #[test] diff --git a/core/src/gossip_service.rs b/core/src/gossip_service.rs index 624f5b0859..5470dd742e 100644 --- a/core/src/gossip_service.rs +++ b/core/src/gossip_service.rs @@ -8,7 +8,7 @@ use solana_client::thin_client::{create_client, ThinClient}; use solana_ledger::bank_forks::BankForks; use solana_perf::recycler::Recycler; use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use std::net::{SocketAddr, TcpListener, UdpSocket}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::channel; diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index d316cb171f..d5ffe8108e 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -27,7 +27,7 @@ use solana_sdk::{ clock::Slot, hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, timing::{self, duration_as_ms}, transaction::Transaction, }; @@ -1082,7 +1082,7 @@ pub(crate) mod tests { instruction::InstructionError, packet::PACKET_DATA_SIZE, rent::Rent, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, system_transaction, transaction::TransactionError, }; diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 7c73b9a018..3be6d18a42 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -1115,7 +1115,7 @@ pub mod tests { hash::{hash, Hash}, instruction::InstructionError, rpc_port, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, transaction::TransactionError, }; diff --git a/core/src/rpc_pubsub.rs b/core/src/rpc_pubsub.rs index f040e90b47..3be260b728 100644 --- a/core/src/rpc_pubsub.rs +++ b/core/src/rpc_pubsub.rs @@ -288,7 +288,7 @@ mod tests { use solana_runtime::bank::Bank; use solana_sdk::{ pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_program, system_transaction, transaction::{self, Transaction}, }; diff --git a/core/src/rpc_service.rs b/core/src/rpc_service.rs index 2ebd8ccae3..5ddecebb34 100644 --- a/core/src/rpc_service.rs +++ b/core/src/rpc_service.rs @@ -181,7 +181,7 @@ mod tests { }; use solana_ledger::get_tmp_ledger_path; use solana_runtime::bank::Bank; - use solana_sdk::signature::KeypairUtil; + use solana_sdk::signature::Signer; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::atomic::AtomicBool; diff --git a/core/src/rpc_subscriptions.rs b/core/src/rpc_subscriptions.rs index edd543971c..9c880fd0c4 100644 --- a/core/src/rpc_subscriptions.rs +++ b/core/src/rpc_subscriptions.rs @@ -506,7 +506,7 @@ pub(crate) mod tests { use jsonrpc_pubsub::typed::Subscriber; use solana_budget_program; use solana_sdk::{ - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, }; use tokio::prelude::{Async, Stream}; diff --git a/core/src/serve_repair.rs b/core/src/serve_repair.rs index 623ec622be..87c9ca7edf 100644 --- a/core/src/serve_repair.rs +++ b/core/src/serve_repair.rs @@ -14,7 +14,7 @@ use solana_metrics::{datapoint_debug, inc_new_counter_debug}; use solana_perf::packet::{Packets, PacketsRecycler}; use solana_sdk::{ clock::Slot, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, timing::duration_as_ms, }; use std::{ diff --git a/core/src/sigverify_shreds.rs b/core/src/sigverify_shreds.rs index a26f09d1bb..78cc8827ee 100644 --- a/core/src/sigverify_shreds.rs +++ b/core/src/sigverify_shreds.rs @@ -76,7 +76,7 @@ pub mod tests { use crate::packet::Packet; use solana_ledger::shred::{Shred, Shredder}; use solana_runtime::bank::Bank; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; #[test] fn test_sigverify_shreds_read_slots() { diff --git a/core/src/storage_stage.rs b/core/src/storage_stage.rs index 81f86871ff..bf88c6575c 100644 --- a/core/src/storage_stage.rs +++ b/core/src/storage_stage.rs @@ -20,7 +20,7 @@ use solana_sdk::{ instruction::Instruction, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, transaction::Transaction, }; use solana_storage_program::{ @@ -649,7 +649,7 @@ mod tests { use rayon::prelude::*; use solana_runtime::bank::Bank; use solana_sdk::hash::Hasher; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use std::cmp::{max, min}; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::mpsc::channel; diff --git a/core/src/tvu.rs b/core/src/tvu.rs index c04de4051b..d4a1ec17b5 100644 --- a/core/src/tvu.rs +++ b/core/src/tvu.rs @@ -26,7 +26,7 @@ use solana_ledger::{ }; use solana_sdk::{ pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use std::{ net::UdpSocket, diff --git a/core/src/validator.rs b/core/src/validator.rs index 7b8e95caf4..b8e1240dd5 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -40,7 +40,7 @@ use solana_sdk::{ hash::Hash, poh_config::PohConfig, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, timing::timestamp, }; use std::{ diff --git a/core/src/window_service.rs b/core/src/window_service.rs index 18fef0c988..3fa88f91ad 100644 --- a/core/src/window_service.rs +++ b/core/src/window_service.rs @@ -494,7 +494,7 @@ mod test { clock::Slot, epoch_schedule::MINIMUM_SLOTS_PER_EPOCH, hash::Hash, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use std::{ net::UdpSocket, diff --git a/core/tests/bank_forks.rs b/core/tests/bank_forks.rs index da209e2f22..1cdeabb2e4 100644 --- a/core/tests/bank_forks.rs +++ b/core/tests/bank_forks.rs @@ -23,7 +23,7 @@ mod tests { clock::Slot, hash::hashv, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, }; use std::sync::RwLock; diff --git a/core/tests/client.rs b/core/tests/client.rs index 69182a220a..4ecfdd1d44 100644 --- a/core/tests/client.rs +++ b/core/tests/client.rs @@ -7,7 +7,7 @@ use solana_core::{ validator::new_validator_for_tests, }; use solana_sdk::{ - commitment_config::CommitmentConfig, pubkey::Pubkey, rpc_port, signature::KeypairUtil, + commitment_config::CommitmentConfig, pubkey::Pubkey, rpc_port, signature::Signer, system_transaction, }; use std::{ diff --git a/core/tests/gossip.rs b/core/tests/gossip.rs index 4a650cd184..33edff165a 100644 --- a/core/tests/gossip.rs +++ b/core/tests/gossip.rs @@ -6,7 +6,7 @@ use solana_core::cluster_info::{ClusterInfo, Node}; use solana_core::gossip_service::GossipService; use solana_core::packet::Packet; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::timing::timestamp; use std::net::UdpSocket; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/core/tests/storage_stage.rs b/core/tests/storage_stage.rs index ca3ae9f662..57223b337b 100644 --- a/core/tests/storage_stage.rs +++ b/core/tests/storage_stage.rs @@ -15,7 +15,7 @@ mod tests { use solana_sdk::hash::Hash; use solana_sdk::message::Message; use solana_sdk::pubkey::Pubkey; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::transaction::Transaction; use solana_storage_program::storage_instruction; use solana_storage_program::storage_instruction::StorageAccountType; diff --git a/faucet/src/faucet.rs b/faucet/src/faucet.rs index 3d03c15aee..9f8dca94a0 100644 --- a/faucet/src/faucet.rs +++ b/faucet/src/faucet.rs @@ -15,7 +15,7 @@ use solana_sdk::{ message::Message, packet::PACKET_DATA_SIZE, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, transaction::Transaction, }; diff --git a/faucet/tests/local-faucet.rs b/faucet/tests/local-faucet.rs index a916d50b3a..f0ebfabc03 100644 --- a/faucet/tests/local-faucet.rs +++ b/faucet/tests/local-faucet.rs @@ -3,7 +3,7 @@ use solana_sdk::{ hash::Hash, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, transaction::Transaction, }; diff --git a/genesis/src/main.rs b/genesis/src/main.rs index a9241cf159..41b1d0e38e 100644 --- a/genesis/src/main.rs +++ b/genesis/src/main.rs @@ -22,7 +22,7 @@ use solana_sdk::{ poh_config::PohConfig, pubkey::Pubkey, rent::Rent, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_program, timing, }; use solana_stake_program::stake_state::{self, StakeState}; diff --git a/install/src/command.rs b/install/src/command.rs index e88393f26e..5c59440c22 100644 --- a/install/src/command.rs +++ b/install/src/command.rs @@ -13,7 +13,7 @@ use solana_sdk::{ hash::{Hash, Hasher}, message::Message, pubkey::Pubkey, - signature::{read_keypair_file, Keypair, KeypairUtil, Signable}, + signature::{read_keypair_file, Keypair, Signable, Signer}, transaction::Transaction, }; use std::{ diff --git a/keygen/src/keygen.rs b/keygen/src/keygen.rs index 1c471dbcbb..cd9c1ccb3a 100644 --- a/keygen/src/keygen.rs +++ b/keygen/src/keygen.rs @@ -19,7 +19,7 @@ use solana_sdk::{ pubkey::write_pubkey_file, signature::{ keypair_from_seed, read_keypair, read_keypair_file, write_keypair, write_keypair_file, - Keypair, KeypairUtil, + Keypair, Signer, }, }; use std::{ @@ -54,7 +54,7 @@ fn check_for_overwrite(outfile: &str, matches: &ArgMatches) { fn get_keypair_from_matches( matches: &ArgMatches, config: Config, -) -> Result, Box> { +) -> Result, Box> { let mut path = dirs::home_dir().expect("home directory"); let path = if matches.is_present("keypair") { matches.value_of("keypair").unwrap() diff --git a/ledger/benches/sigverify_shreds.rs b/ledger/benches/sigverify_shreds.rs index 729e24b6b9..400e71aed0 100644 --- a/ledger/benches/sigverify_shreds.rs +++ b/ledger/benches/sigverify_shreds.rs @@ -8,7 +8,7 @@ use solana_ledger::sigverify_shreds::{ }; use solana_perf::packet::{Packet, Packets}; use solana_perf::recycler_cache::RecyclerCache; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use std::sync::Arc; use test::Bencher; diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index ddde3479a3..c40b3758b5 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -35,7 +35,7 @@ use solana_sdk::{ hash::Hash, program_utils::limited_deserialize, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, timing::timestamp, transaction::Transaction, }; diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index 0ae9ed7053..9d8571bf11 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -866,7 +866,7 @@ pub mod tests { hash::Hash, instruction::InstructionError, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, transaction::{Transaction, TransactionError}, }; diff --git a/ledger/src/entry.rs b/ledger/src/entry.rs index 2aa85f6bc5..6fba1e425d 100644 --- a/ledger/src/entry.rs +++ b/ledger/src/entry.rs @@ -457,7 +457,7 @@ mod tests { use solana_sdk::{ hash::{hash, Hash}, message::Message, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, transaction::Transaction, }; diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index 05335bc39a..48fe9f56d9 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -18,7 +18,7 @@ use solana_sdk::{ hash::Hash, packet::PACKET_DATA_SIZE, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, }; use std::mem::size_of; use std::{sync::Arc, time::Instant}; diff --git a/ledger/src/sigverify_shreds.rs b/ledger/src/sigverify_shreds.rs index 69781a4a9d..7753054fe7 100644 --- a/ledger/src/sigverify_shreds.rs +++ b/ledger/src/sigverify_shreds.rs @@ -18,7 +18,7 @@ use solana_perf::{ use solana_rayon_threadlimit::get_thread_count; use solana_sdk::pubkey::Pubkey; use solana_sdk::signature::Signature; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use std::sync::Arc; use std::{collections::HashMap, mem::size_of}; @@ -447,7 +447,7 @@ pub mod tests { use super::*; use crate::shred::SIZE_OF_DATA_SHRED_PAYLOAD; use crate::shred::{Shred, Shredder}; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; #[test] fn test_sigverify_shred_cpu() { solana_logger::setup(); diff --git a/ledger/src/staking_utils.rs b/ledger/src/staking_utils.rs index b96f5c87f4..c55e5d1b35 100644 --- a/ledger/src/staking_utils.rs +++ b/ledger/src/staking_utils.rs @@ -107,7 +107,7 @@ pub(crate) mod tests { clock::Clock, instruction::Instruction, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, signers::Signers, sysvar::{ stake_history::{self, StakeHistory}, diff --git a/ledger/tests/shred.rs b/ledger/tests/shred.rs index 05d6b27036..4168fda76f 100644 --- a/ledger/tests/shred.rs +++ b/ledger/tests/shred.rs @@ -2,7 +2,7 @@ use solana_ledger::entry::Entry; use solana_ledger::shred::{ max_entries_per_n_shred, verify_test_data_shred, Shred, Shredder, MAX_DATA_SHREDS_PER_FEC_BLOCK, }; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::{hash::Hash, system_transaction}; use std::convert::TryInto; use std::sync::Arc; diff --git a/local-cluster/src/cluster_tests.rs b/local-cluster/src/cluster_tests.rs index 82eaa1bf68..b40157c289 100644 --- a/local-cluster/src/cluster_tests.rs +++ b/local-cluster/src/cluster_tests.rs @@ -24,7 +24,7 @@ use solana_sdk::{ hash::Hash, poh_config::PohConfig, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, system_transaction, timing::duration_as_ms, transport::TransportError, diff --git a/local-cluster/src/local_cluster.rs b/local-cluster/src/local_cluster.rs index 1e11d7871b..81f5bcb111 100644 --- a/local-cluster/src/local_cluster.rs +++ b/local-cluster/src/local_cluster.rs @@ -20,7 +20,7 @@ use solana_sdk::{ message::Message, poh_config::PohConfig, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_transaction, transaction::Transaction, }; diff --git a/local-cluster/tests/archiver.rs b/local-cluster/tests/archiver.rs index f4b641d1ec..55e4ed88e8 100644 --- a/local-cluster/tests/archiver.rs +++ b/local-cluster/tests/archiver.rs @@ -15,7 +15,7 @@ use solana_local_cluster::local_cluster::{ClusterConfig, LocalCluster}; use solana_sdk::{ commitment_config::CommitmentConfig, genesis_config::create_genesis_config, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use std::{ fs::remove_dir_all, diff --git a/local-cluster/tests/local_cluster.rs b/local-cluster/tests/local_cluster.rs index 54df4cdbe1..a2c551b36b 100644 --- a/local-cluster/tests/local_cluster.rs +++ b/local-cluster/tests/local_cluster.rs @@ -23,7 +23,7 @@ use solana_sdk::{ epoch_schedule::{EpochSchedule, MINIMUM_SLOTS_PER_EPOCH}, genesis_config::OperatingMode, poh_config::PohConfig, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use std::sync::atomic::{AtomicBool, Ordering}; use std::{ diff --git a/perf/src/packet.rs b/perf/src/packet.rs index a8debe5046..92f63c09cf 100644 --- a/perf/src/packet.rs +++ b/perf/src/packet.rs @@ -109,7 +109,7 @@ where mod tests { use super::*; use solana_sdk::hash::Hash; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_transaction; #[test] diff --git a/perf/src/test_tx.rs b/perf/src/test_tx.rs index 539432bfd4..6664f684f9 100644 --- a/perf/src/test_tx.rs +++ b/perf/src/test_tx.rs @@ -1,6 +1,6 @@ use solana_sdk::hash::Hash; use solana_sdk::instruction::CompiledInstruction; -use solana_sdk::signature::{Keypair, KeypairUtil}; +use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_instruction::SystemInstruction; use solana_sdk::system_program; use solana_sdk::system_transaction; diff --git a/programs/bpf/tests/programs.rs b/programs/bpf/tests/programs.rs index 3ea22119a1..ebf8b7af3b 100644 --- a/programs/bpf/tests/programs.rs +++ b/programs/bpf/tests/programs.rs @@ -33,7 +33,7 @@ mod bpf { client::SyncClient, instruction::{AccountMeta, Instruction, InstructionError}, pubkey::Pubkey, - signature::KeypairUtil, + signature::Signer, transaction::TransactionError, }; use std::{io::Read, sync::Arc}; @@ -225,7 +225,7 @@ mod bpf { clock::DEFAULT_SLOTS_PER_EPOCH, instruction::{AccountMeta, Instruction, InstructionError}, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, sysvar::{clock, fees, rent, rewards, slot_hashes, stake_history}, transaction::TransactionError, }; diff --git a/programs/budget/src/budget_processor.rs b/programs/budget/src/budget_processor.rs index 5f61321d8f..a2facf404c 100644 --- a/programs/budget/src/budget_processor.rs +++ b/programs/budget/src/budget_processor.rs @@ -232,7 +232,7 @@ mod tests { use solana_sdk::hash::hash; use solana_sdk::instruction::InstructionError; use solana_sdk::message::Message; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::transaction::TransactionError; fn create_bank(lamports: u64) -> (Bank, Keypair) { diff --git a/programs/config/src/config_processor.rs b/programs/config/src/config_processor.rs index e18db222db..b3f409cffe 100644 --- a/programs/config/src/config_processor.rs +++ b/programs/config/src/config_processor.rs @@ -108,7 +108,7 @@ mod tests { use serde_derive::{Deserialize, Serialize}; use solana_sdk::{ account::{create_keyed_is_signer_accounts, Account}, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction::SystemInstruction, }; use std::cell::RefCell; diff --git a/programs/exchange/src/exchange_processor.rs b/programs/exchange/src/exchange_processor.rs index 38b9fc6fb6..647a8e3f8f 100644 --- a/programs/exchange/src/exchange_processor.rs +++ b/programs/exchange/src/exchange_processor.rs @@ -493,7 +493,7 @@ mod test { use solana_sdk::client::SyncClient; use solana_sdk::genesis_config::create_genesis_config; use solana_sdk::message::Message; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use solana_sdk::system_instruction; use std::mem; diff --git a/programs/failure/tests/failure.rs b/programs/failure/tests/failure.rs index 34ebfa0542..5cb93cfb2b 100644 --- a/programs/failure/tests/failure.rs +++ b/programs/failure/tests/failure.rs @@ -5,7 +5,7 @@ use solana_sdk::client::SyncClient; use solana_sdk::genesis_config::create_genesis_config; use solana_sdk::instruction::InstructionError; use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::KeypairUtil; +use solana_sdk::signature::Signer; use solana_sdk::transaction::TransactionError; #[test] diff --git a/programs/librapay/src/lib.rs b/programs/librapay/src/lib.rs index 2ba12a014a..fd831a9590 100644 --- a/programs/librapay/src/lib.rs +++ b/programs/librapay/src/lib.rs @@ -13,7 +13,7 @@ use solana_sdk::{ instruction::InstructionError, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, }; diff --git a/programs/librapay/src/librapay_transaction.rs b/programs/librapay/src/librapay_transaction.rs index 9c8d6a5a64..dd7910ec5c 100644 --- a/programs/librapay/src/librapay_transaction.rs +++ b/programs/librapay/src/librapay_transaction.rs @@ -9,7 +9,7 @@ use solana_sdk::{ commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, transaction::Transaction, }; @@ -155,7 +155,7 @@ mod tests { use solana_runtime::bank::Bank; use solana_runtime::bank_client::BankClient; use solana_sdk::genesis_config::create_genesis_config; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use std::sync::Arc; fn create_bank(lamports: u64) -> (Arc, Keypair, Keypair, Pubkey, Pubkey) { diff --git a/programs/ownable/src/ownable_processor.rs b/programs/ownable/src/ownable_processor.rs index f63a03393c..5d3dfe3b62 100644 --- a/programs/ownable/src/ownable_processor.rs +++ b/programs/ownable/src/ownable_processor.rs @@ -63,7 +63,7 @@ mod tests { client::SyncClient, genesis_config::create_genesis_config, message::Message, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, system_program, transport::Result, }; diff --git a/programs/vest/src/vest_processor.rs b/programs/vest/src/vest_processor.rs index 25e71b257e..d7a0a6ef63 100644 --- a/programs/vest/src/vest_processor.rs +++ b/programs/vest/src/vest_processor.rs @@ -153,7 +153,7 @@ mod tests { use solana_sdk::genesis_config::create_genesis_config; use solana_sdk::hash::hash; use solana_sdk::message::Message; - use solana_sdk::signature::{Keypair, KeypairUtil, Signature}; + use solana_sdk::signature::{Keypair, Signature, Signer}; use solana_sdk::transaction::TransactionError; use solana_sdk::transport::Result; use std::sync::Arc; diff --git a/remote-wallet/src/remote_keypair.rs b/remote-wallet/src/remote_keypair.rs index 6c71df18de..2b499b9f56 100644 --- a/remote-wallet/src/remote_keypair.rs +++ b/remote-wallet/src/remote_keypair.rs @@ -6,7 +6,7 @@ use crate::{ }; use solana_sdk::{ pubkey::Pubkey, - signature::{KeypairUtil, Signature}, + signature::{Signature, Signer}, }; use std::error; @@ -24,7 +24,7 @@ impl RemoteKeypair { } } -impl KeypairUtil for RemoteKeypair { +impl Signer for RemoteKeypair { fn try_pubkey(&self) -> Result> { match &self.wallet_type { RemoteWalletType::Ledger(wallet) => wallet diff --git a/runtime/benches/bank.rs b/runtime/benches/bank.rs index 9a3c83935e..1c5f82879b 100644 --- a/runtime/benches/bank.rs +++ b/runtime/benches/bank.rs @@ -12,7 +12,7 @@ use solana_sdk::{ genesis_config::create_genesis_config, instruction::InstructionError, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, transaction::Transaction, }; use std::{sync::Arc, thread::sleep, time::Duration}; diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 41af27a0ac..e6ccfc7bb3 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -681,7 +681,7 @@ mod tests { message::Message, nonce_state, rent::Rent, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_program, transaction::Transaction, }; diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 17f2ea6874..94134b7f39 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -2455,7 +2455,7 @@ pub mod tests { #[test] fn test_bad_bank_hash() { - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; let db = AccountsDB::new(Vec::new()); let some_slot: Slot = 0; diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 6138573536..c611706ab0 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -166,7 +166,7 @@ impl AccountsIndex { #[cfg(test)] mod tests { use super::*; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; #[test] fn test_get_empty() { diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index d03465bd26..03342cb0fd 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -2134,7 +2134,7 @@ mod tests { nonce_state, poh_config::PohConfig, rent::Rent, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, system_program::{self, solana_system_program}, sysvar::{fees::Fees, rewards::Rewards}, diff --git a/runtime/src/bank_client.rs b/runtime/src/bank_client.rs index 0399bd23f3..1ac3a68ad2 100644 --- a/runtime/src/bank_client.rs +++ b/runtime/src/bank_client.rs @@ -8,7 +8,7 @@ use solana_sdk::{ instruction::Instruction, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, signers::Signers, system_instruction, transaction::{self, Transaction}, diff --git a/runtime/src/genesis_utils.rs b/runtime/src/genesis_utils.rs index e361fda9fb..11bfd33412 100644 --- a/runtime/src/genesis_utils.rs +++ b/runtime/src/genesis_utils.rs @@ -4,7 +4,7 @@ use solana_sdk::{ genesis_config::GenesisConfig, pubkey::Pubkey, rent::Rent, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_program::{self, solana_system_program}, }; use solana_stake_program::stake_state; diff --git a/runtime/src/loader_utils.rs b/runtime/src/loader_utils.rs index 4bee94d3cb..7a4f51d854 100644 --- a/runtime/src/loader_utils.rs +++ b/runtime/src/loader_utils.rs @@ -5,7 +5,7 @@ use solana_sdk::{ loader_instruction, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, }; diff --git a/runtime/src/nonce_utils.rs b/runtime/src/nonce_utils.rs index e3745d71e1..2514ab6979 100644 --- a/runtime/src/nonce_utils.rs +++ b/runtime/src/nonce_utils.rs @@ -79,7 +79,7 @@ mod tests { instruction::InstructionError, nonce_state::{with_test_keyed_account, Meta, NonceAccount}, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, sysvar::{recent_blockhashes::create_test_recent_blockhashes, rent::Rent}, }; diff --git a/runtime/src/storage_utils.rs b/runtime/src/storage_utils.rs index 5220856194..e9b40df9aa 100644 --- a/runtime/src/storage_utils.rs +++ b/runtime/src/storage_utils.rs @@ -84,7 +84,7 @@ pub(crate) mod tests { client::SyncClient, genesis_config::create_genesis_config, message::Message, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use solana_storage_program::{ storage_contract::{StorageAccount, STORAGE_ACCOUNT_SPACE}, diff --git a/runtime/src/system_instruction_processor.rs b/runtime/src/system_instruction_processor.rs index 61bad42969..dfb6aeb533 100644 --- a/runtime/src/system_instruction_processor.rs +++ b/runtime/src/system_instruction_processor.rs @@ -329,7 +329,7 @@ mod tests { instruction::{AccountMeta, Instruction, InstructionError}, message::Message, nonce_state, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, system_program, sysvar, transaction::TransactionError, }; diff --git a/runtime/tests/noop.rs b/runtime/tests/noop.rs index 49fdda0df3..eae9c0704d 100644 --- a/runtime/tests/noop.rs +++ b/runtime/tests/noop.rs @@ -2,8 +2,7 @@ use solana_runtime::{ bank::Bank, bank_client::BankClient, loader_utils::create_invoke_instruction, }; use solana_sdk::{ - client::SyncClient, genesis_config::create_genesis_config, pubkey::Pubkey, - signature::KeypairUtil, + client::SyncClient, genesis_config::create_genesis_config, pubkey::Pubkey, signature::Signer, }; #[test] diff --git a/runtime/tests/stake.rs b/runtime/tests/stake.rs index a293ba3dd4..f8ddd5def9 100644 --- a/runtime/tests/stake.rs +++ b/runtime/tests/stake.rs @@ -8,7 +8,7 @@ use solana_sdk::{ client::SyncClient, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction::create_address_with_seed, sysvar::{self, stake_history::StakeHistory, Sysvar}, }; diff --git a/runtime/tests/storage.rs b/runtime/tests/storage.rs index 152a4a2507..8c7c2bbf80 100644 --- a/runtime/tests/storage.rs +++ b/runtime/tests/storage.rs @@ -13,7 +13,7 @@ use solana_sdk::{ hash::{hash, Hash}, message::Message, pubkey::Pubkey, - signature::{Keypair, KeypairUtil, Signature}, + signature::{Keypair, Signature, Signer}, system_instruction, sysvar::{ rewards::{self, Rewards}, diff --git a/sdk-c/src/lib.rs b/sdk-c/src/lib.rs index c491db9fc9..f87a679b59 100644 --- a/sdk-c/src/lib.rs +++ b/sdk-c/src/lib.rs @@ -8,7 +8,7 @@ use solana_sdk::{ instruction::CompiledInstruction as CompiledInstructionNative, message::{Message as MessageNative, MessageHeader as MessageHeaderNative}, pubkey::Pubkey, - signature::{Keypair as KeypairNative, KeypairUtil, Signature as SignatureNative}, + signature::{Keypair as KeypairNative, Signature as SignatureNative, Signer}, transaction::Transaction as TransactionNative, }; use std::{ @@ -501,7 +501,7 @@ mod tests { use bincode::serialize; use rand_chacha::ChaChaRng; use rand_core::SeedableRng; - use solana_sdk::signature::{Keypair as KeypairNative, KeypairUtil}; + use solana_sdk::signature::{Keypair as KeypairNative, Signer}; use solana_sdk::system_transaction; #[test] diff --git a/sdk/src/genesis_config.rs b/sdk/src/genesis_config.rs index 434fc365c2..e0b4d55b35 100644 --- a/sdk/src/genesis_config.rs +++ b/sdk/src/genesis_config.rs @@ -10,7 +10,7 @@ use crate::{ poh_config::PohConfig, pubkey::Pubkey, rent::Rent, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_program::{self, solana_system_program}, }; use bincode::{deserialize, serialize}; @@ -176,7 +176,7 @@ impl GenesisConfig { #[cfg(test)] mod tests { use super::*; - use crate::signature::{Keypair, KeypairUtil}; + use crate::signature::{Keypair, Signer}; use std::path::PathBuf; fn make_tmp_path(name: &str) -> PathBuf { diff --git a/sdk/src/message.rs b/sdk/src/message.rs index 82260220ee..8fe4c56c8d 100644 --- a/sdk/src/message.rs +++ b/sdk/src/message.rs @@ -253,7 +253,7 @@ mod tests { use super::*; use crate::{ instruction::AccountMeta, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; #[test] diff --git a/sdk/src/signature.rs b/sdk/src/signature.rs index 465f861b3d..3dd79145ab 100644 --- a/sdk/src/signature.rs +++ b/sdk/src/signature.rs @@ -128,7 +128,7 @@ impl FromStr for Signature { } } -pub trait KeypairUtil { +pub trait Signer { fn pubkey(&self) -> Pubkey { self.try_pubkey().unwrap_or_default() } @@ -139,7 +139,7 @@ pub trait KeypairUtil { fn try_sign_message(&self, message: &[u8]) -> Result>; } -impl KeypairUtil for Keypair { +impl Signer for Keypair { /// Return the public key for the given keypair fn pubkey(&self) -> Pubkey { Pubkey::new(self.0.public.as_ref()) @@ -160,7 +160,7 @@ impl KeypairUtil for Keypair { impl PartialEq for Keypair where - T: KeypairUtil, + T: Signer, { fn eq(&self, other: &T) -> bool { self.pubkey() == other.pubkey() @@ -189,7 +189,7 @@ enum PresignerError { VerificationFailure, } -impl KeypairUtil for Presigner { +impl Signer for Presigner { fn try_pubkey(&self) -> Result> { Ok(self.pubkey) } @@ -205,7 +205,7 @@ impl KeypairUtil for Presigner { impl PartialEq for Presigner where - T: KeypairUtil, + T: Signer, { fn eq(&self, other: &T) -> bool { self.pubkey() == other.pubkey() @@ -427,7 +427,7 @@ mod tests { let data = [1u8]; let sig = keypair.sign_message(&data); - // KeypairUtil + // Signer assert_eq!(keypair.try_pubkey().unwrap(), pubkey); assert_eq!(keypair.pubkey(), pubkey); assert_eq!(keypair.try_sign_message(&data).unwrap(), sig); @@ -445,7 +445,7 @@ mod tests { let data = [1u8]; let sig = keypair.sign_message(&data); - // KeypairUtil + // Signer let presigner = Presigner::new(&pubkey, &sig); assert_eq!(presigner.try_pubkey().unwrap(), pubkey); assert_eq!(presigner.pubkey(), pubkey); diff --git a/sdk/src/signers.rs b/sdk/src/signers.rs index b8c09e083e..d62baddf98 100644 --- a/sdk/src/signers.rs +++ b/sdk/src/signers.rs @@ -1,6 +1,6 @@ use crate::{ pubkey::Pubkey, - signature::{KeypairUtil, Signature}, + signature::{Signature, Signer}, }; pub trait Signers { @@ -22,35 +22,35 @@ macro_rules! default_keypairs_impl { ); } -impl Signers for [&T] { +impl Signers for [&T] { default_keypairs_impl!(); } -impl Signers for [Box] { +impl Signers for [Box] { default_keypairs_impl!(); } -impl Signers for [&T; 0] { +impl Signers for [&T; 0] { default_keypairs_impl!(); } -impl Signers for [&T; 1] { +impl Signers for [&T; 1] { default_keypairs_impl!(); } -impl Signers for [&T; 2] { +impl Signers for [&T; 2] { default_keypairs_impl!(); } -impl Signers for [&T; 3] { +impl Signers for [&T; 3] { default_keypairs_impl!(); } -impl Signers for [&T; 4] { +impl Signers for [&T; 4] { default_keypairs_impl!(); } -impl Signers for Vec<&T> { +impl Signers for Vec<&T> { default_keypairs_impl!(); } @@ -60,7 +60,7 @@ mod tests { use std::error; struct Foo; - impl KeypairUtil for Foo { + impl Signer for Foo { fn try_pubkey(&self) -> Result> { Ok(Pubkey::default()) } @@ -70,7 +70,7 @@ mod tests { } struct Bar; - impl KeypairUtil for Bar { + impl Signer for Bar { fn try_pubkey(&self) -> Result> { Ok(Pubkey::default()) } @@ -81,14 +81,14 @@ mod tests { #[test] fn test_dyn_keypairs_compile() { - let xs: Vec> = vec![Box::new(Foo {}), Box::new(Bar {})]; + let xs: Vec> = vec![Box::new(Foo {}), Box::new(Bar {})]; assert_eq!( xs.sign_message(b""), vec![Signature::default(), Signature::default()], ); // Same as above, but less compiler magic. - let xs_ref: &[Box] = &xs; + let xs_ref: &[Box] = &xs; assert_eq!( Signers::sign_message(xs_ref, b""), vec![Signature::default(), Signature::default()], diff --git a/sdk/src/system_transaction.rs b/sdk/src/system_transaction.rs index e5b112d62f..f6a2dd681c 100644 --- a/sdk/src/system_transaction.rs +++ b/sdk/src/system_transaction.rs @@ -3,7 +3,7 @@ use crate::{ hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, transaction::Transaction, }; diff --git a/sdk/src/transaction.rs b/sdk/src/transaction.rs index df8d4c49ba..c552bc3599 100644 --- a/sdk/src/transaction.rs +++ b/sdk/src/transaction.rs @@ -334,7 +334,7 @@ mod tests { use crate::{ hash::hash, instruction::AccountMeta, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, system_instruction, }; use bincode::{deserialize, serialize, serialized_size}; diff --git a/validator/src/main.rs b/validator/src/main.rs index a49ffd60b9..649ff168f7 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -29,7 +29,7 @@ use solana_sdk::{ clock::Slot, hash::Hash, pubkey::Pubkey, - signature::{Keypair, KeypairUtil}, + signature::{Keypair, Signer}, }; use std::{ fs::{self, File}, diff --git a/vote-signer/src/rpc.rs b/vote-signer/src/rpc.rs index 0509cea1c0..0450b2cc00 100644 --- a/vote-signer/src/rpc.rs +++ b/vote-signer/src/rpc.rs @@ -4,7 +4,7 @@ use jsonrpc_core::{Error, MetaIoHandler, Metadata, Result}; use jsonrpc_derive::rpc; use jsonrpc_http_server::{hyper, AccessControlAllowOrigin, DomainsValidation, ServerBuilder}; use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::{Keypair, KeypairUtil, Signature}; +use solana_sdk::signature::{Keypair, Signature, Signer}; use std::collections::HashMap; use std::net::SocketAddr; use std::sync::atomic::{AtomicBool, Ordering}; @@ -169,7 +169,7 @@ impl Default for LocalVoteSigner { mod tests { use super::*; use jsonrpc_core::{types::*, Response}; - use solana_sdk::signature::{Keypair, KeypairUtil}; + use solana_sdk::signature::{Keypair, Signer}; use std::mem; fn start_rpc_handler() -> (MetaIoHandler, Meta) {