From 0c39575dbeeb79b3e6d88db00f4d2beec3ff598f Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Thu, 20 Feb 2020 14:28:55 -0700 Subject: [PATCH] Rename KeypairUtil to Signer (#8360) automerge (cherry picked from commit ab361a807312f742174ebe78546bab995b568738) --- archiver-lib/src/archiver.rs | 2 +- archiver/src/main.rs | 2 +- bench-exchange/src/bench.rs | 2 +- bench-exchange/src/main.rs | 2 +- bench-exchange/tests/bench_exchange.rs | 2 +- bench-tps/src/bench.rs | 2 +- bench-tps/src/main.rs | 2 +- bench-tps/tests/bench_tps.rs | 2 +- book/src/proposals/cluster-test-framework.md | 2 +- chacha/src/chacha.rs | 2 +- clap-utils/src/input_parsers.rs | 2 +- clap-utils/src/keypair.rs | 3 +- cli/src/cli.rs | 4 +- cli/src/cluster_query.rs | 2 +- cli/src/nonce.rs | 2 +- cli/src/stake.rs | 4 +- cli/src/storage.rs | 2 +- cli/src/validator_info.rs | 2 +- cli/src/vote.rs | 2 +- cli/tests/nonce.rs | 2 +- cli/tests/pay.rs | 2 +- cli/tests/request_airdrop.rs | 2 +- cli/tests/stake.rs | 2 +- cli/tests/transfer.rs | 2 +- client/src/thin_client.rs | 2 +- core/benches/banking_stage.rs | 2 +- core/benches/poh_verify.rs | 2 +- core/benches/shredder.rs | 2 +- core/benches/sigverify_stage.rs | 2 +- core/src/banking_stage.rs | 2 +- core/src/blockstream.rs | 2 +- core/src/blockstream_service.rs | 2 +- core/src/broadcast_stage.rs | 2 +- .../broadcast_stage/standard_broadcast_run.rs | 2 +- core/src/cluster_info.rs | 2 +- core/src/cluster_info_vote_listener.rs | 2 +- core/src/contact_info.rs | 2 +- core/src/crds_value.rs | 2 +- core/src/gen_keys.rs | 2 +- core/src/gossip_service.rs | 2 +- core/src/replay_stage.rs | 4 +- core/src/rpc.rs | 2 +- core/src/rpc_pubsub.rs | 2 +- core/src/rpc_service.rs | 2 +- core/src/rpc_subscriptions.rs | 2 +- core/src/serve_repair.rs | 2 +- core/src/sigverify_shreds.rs | 2 +- core/src/storage_stage.rs | 4 +- core/src/tvu.rs | 2 +- core/src/validator.rs | 2 +- core/src/window_service.rs | 2 +- core/tests/bank_forks.rs | 2 +- core/tests/client.rs | 15 ++++---- core/tests/gossip.rs | 2 +- core/tests/storage_stage.rs | 2 +- faucet/src/faucet.rs | 2 +- faucet/tests/local-faucet.rs | 2 +- genesis/src/main.rs | 2 +- install/src/command.rs | 2 +- keygen/src/keygen.rs | 4 +- ledger/benches/sigverify_shreds.rs | 2 +- ledger/src/blockstore.rs | 2 +- ledger/src/blockstore_processor.rs | 2 +- ledger/src/entry.rs | 2 +- ledger/src/shred.rs | 2 +- ledger/src/sigverify_shreds.rs | 4 +- ledger/src/staking_utils.rs | 2 +- ledger/tests/shred.rs | 2 +- local-cluster/src/cluster_tests.rs | 2 +- local-cluster/src/local_cluster.rs | 2 +- local-cluster/tests/archiver.rs | 2 +- local-cluster/tests/local_cluster.rs | 2 +- perf/src/packet.rs | 2 +- perf/src/test_tx.rs | 2 +- programs/bpf/tests/programs.rs | 38 ++++++++++--------- programs/budget/src/budget_processor.rs | 2 +- programs/config/src/config_processor.rs | 2 +- programs/exchange/src/exchange_processor.rs | 2 +- programs/failure/tests/failure.rs | 2 +- programs/librapay/src/lib.rs | 2 +- programs/librapay/src/librapay_transaction.rs | 4 +- programs/ownable/src/ownable_processor.rs | 2 +- programs/vest/src/vest_processor.rs | 2 +- remote-wallet/src/remote_keypair.rs | 4 +- runtime/benches/bank.rs | 27 ++++++------- runtime/src/accounts.rs | 32 +++++++++------- runtime/src/accounts_db.rs | 2 +- runtime/src/accounts_index.rs | 2 +- runtime/src/bank.rs | 6 +-- runtime/src/bank_client.rs | 2 +- runtime/src/genesis_utils.rs | 2 +- runtime/src/loader_utils.rs | 16 ++++---- runtime/src/nonce_utils.rs | 2 +- runtime/src/storage_utils.rs | 10 +++-- runtime/src/system_instruction_processor.rs | 2 +- runtime/tests/noop.rs | 13 +++---- runtime/tests/stake.rs | 2 +- runtime/tests/storage.rs | 2 +- sdk-c/src/lib.rs | 4 +- sdk/src/genesis_config.rs | 4 +- sdk/src/message.rs | 6 ++- sdk/src/signature.rs | 14 +++---- sdk/src/signers.rs | 26 ++++++------- sdk/src/system_transaction.rs | 2 +- sdk/src/transaction.rs | 10 +++-- validator/src/main.rs | 2 +- vote-signer/src/rpc.rs | 4 +- 107 files changed, 218 insertions(+), 208 deletions(-) diff --git a/archiver-lib/src/archiver.rs b/archiver-lib/src/archiver.rs index 0053a9e8653a4f..ac352604592a66 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 ed6ba4bb8bbe48..2b8178aad79f34 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 d84274bee4607e..a20c21aeebe0d3 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 8d640b394fd856..640133501d7aaa 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 b0de6b7b9bdd9f..f5dd1c80beef78 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 ac0008cb1e9d7c..699b7bed3c22dd 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 708313c23e53ce..8544ab79bf3fc9 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 7d826cc05bdd02..a7060e7fe32772 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 82409f2c554e29..076ea45976afae 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 d6ab1ddf2a0605..b0f331702072ae 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 a0aeefba3e9135..a2b2c333c39df3 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 4792dd6e23f8f2..d8be15ae17840b 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 331967ab8de04d..ce23edaa5ece30 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -36,7 +36,7 @@ use solana_sdk::{ message::Message, native_token::lamports_to_sol, 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}, @@ -1969,7 +1969,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 d69bec8486957f..bbccf784c8a27a 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -17,7 +17,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 4a2c2e0c358572..2b95cb304789df 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 2cae556a07ea11..6efd74ec5f2903 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 e0c6301b1f34cd..dba719dee1aaff 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 41c295fa04c16d..54777d6c18e021 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 cd74016757ce8d..167477117f8a20 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 ce7856bac84d52..f5f89487f17550 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 eda6a073aeda54..9386c38c1c372d 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 0f3e2282cbe209..931054bf07e3fd 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 890a97a01a9163..bb75922442d3db 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 ecf21aada8fb9c..487ae679cc0b69 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 fd1327c5e5fb6a..ae5ba7534a97f1 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 6e887dfb15be1a..03850085d1d82f 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 688fd3254fe198..ba8ab239cc930f 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 4bfc009a6986ae..ec157bf98bcc16 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 fe4392a385f4ba..252179dc35f542 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 627b81789cee4c..16e01f3a4882ee 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -1029,7 +1029,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 25e72b229e45ed..a59e4c67b9920c 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 7632cb3784a80c..76ef0a2a4a9194 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 2fad2740e79b52..26eee541945efa 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 ebe6643bab3a5e..87407ce56d520f 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 db0923a0582817..ea84460315d695 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -1888,7 +1888,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 5b93c40cc55e5a..ce9882718b7d99 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/contact_info.rs b/core/src/contact_info.rs index cf0f437b5768eb..bf22fdce2a293b 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 97e0b1fc2817c2..098db8729cb400 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 89c2d92a13e796..4f8f4d86d9c155 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 ac9fa3a80cf713..cb8b00b4fb2cb8 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 2f32326c33d9d6..2737ecd147a87a 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, }; @@ -1039,7 +1039,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 f69ecbca79307d..16d33d56045b74 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -1121,7 +1121,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 f040e90b472f6f..3be260b7283d8a 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 2ebd8ccae328c9..5ddecebb341b7a 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 edd543971c90ea..9c880fd0c4469d 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 535ab554ff9c47..1a8798e4a6b466 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 a26f09d1bb7626..78cc8827ee00ac 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 81f86871ff81fc..bf88c6575c6ee9 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 c04de4051b37fd..d4a1ec17b5cb03 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 7b8e95caf4aeb7..b8e1240dd5e660 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 18fef0c988837c..3fa88f91ad2a5f 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 da209e2f22de5c..1cdeabb2e415d0 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 9b6b63147dd492..0a150c3c58a20e 100644 --- a/core/tests/client.rs +++ b/core/tests/client.rs @@ -1,12 +1,13 @@ use solana_client::rpc_client::RpcClient; use solana_core::validator::new_validator_for_tests; -use solana_sdk::commitment_config::CommitmentConfig; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::KeypairUtil; -use solana_sdk::system_transaction; -use std::fs::remove_dir_all; -use std::thread::sleep; -use std::time::{Duration, Instant}; +use solana_sdk::{ + commitment_config::CommitmentConfig, pubkey::Pubkey, signature::Signer, system_transaction, +}; +use std::{ + fs::remove_dir_all, + thread::sleep, + time::{Duration, Instant}, +}; #[test] fn test_rpc_client() { diff --git a/core/tests/gossip.rs b/core/tests/gossip.rs index 4a650cd184dc06..33edff165a3b69 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 ca3ae9f662f85c..57223b337be5c4 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 3d03c15aee60bb..9f8dca94a0794f 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 a916d50b3adda4..f0ebfabc033c03 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 a9241cf1596afb..41b1d0e38ee76e 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 e88393f26e95cb..5c59440c22f5fc 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 1c471dbcbbef5e..cd9c1ccb3a27d2 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 729e24b6b9de94..400e71aed0157d 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 20de86ce4ea525..a1fb9c2033f9a8 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -35,7 +35,7 @@ use solana_sdk::{ hash::Hash, instruction_processor_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 0ae9ed70539f31..9d8571bf110636 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 2aa85f6bc57cb4..6fba1e425d248a 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 aaede3434f293b..68e6fc8bf73932 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 69781a4a9d4518..7753054fe74b6a 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 b96f5c87f403f9..c55e5d1b35c395 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 05d6b27036341b..4168fda76f141e 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 82eaa1bf68c422..b40157c2898870 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 1e11d7871b7e46..81f5bcb1113b56 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 f4b641d1eccae7..55e4ed88e8bbab 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 54df4cdbe1ca7b..a2c551b36bf2bb 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 eb4f8347758f44..2ea1c2e683b927 100644 --- a/perf/src/packet.rs +++ b/perf/src/packet.rs @@ -105,7 +105,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 539432bfd47d1a..6664f684f9b335 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 84edcd35d93f72..3a9f9d5d6d4490 100644 --- a/programs/bpf/tests/programs.rs +++ b/programs/bpf/tests/programs.rs @@ -27,14 +27,15 @@ mod bpf { mod bpf_c { use super::*; use solana_runtime::loader_utils::create_invoke_instruction; - use solana_sdk::account::Account; - use solana_sdk::bpf_loader; - use solana_sdk::client::SyncClient; - use solana_sdk::instruction::{AccountMeta, Instruction}; - use solana_sdk::signature::KeypairUtil; - use std::io::Read; - use std::sync::Arc; - use solana_sdk::pubkey::Pubkey; + use solana_sdk::{ + account::Account, + bpf_loader, + client::SyncClient, + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + signature::Signer, + }; + use std::{io::Read, sync::Arc}; #[test] fn test_program_bpf_c() { @@ -156,16 +157,17 @@ mod bpf { #[cfg(feature = "bpf_rust")] mod bpf_rust { use super::*; - use solana_sdk::account::Account; - use solana_sdk::bpf_loader; - use solana_sdk::client::SyncClient; - use solana_sdk::clock::DEFAULT_SLOTS_PER_EPOCH; - use solana_sdk::instruction::{AccountMeta, Instruction}; - use solana_sdk::pubkey::Pubkey; - use solana_sdk::signature::{Keypair, KeypairUtil}; - use solana_sdk::sysvar::{clock, fees, rent, rewards, slot_hashes, stake_history}; - use std::io::Read; - use std::sync::Arc; + use solana_sdk::{ + account::Account, + bpf_loader, + client::SyncClient, + clock::DEFAULT_SLOTS_PER_EPOCH, + instruction::{AccountMeta, Instruction}, + pubkey::Pubkey, + signature::{Keypair, Signer}, + sysvar::{clock, fees, rent, rewards, slot_hashes, stake_history}, + }; + use std::{io::Read, sync::Arc}; #[test] fn test_program_bpf_rust() { diff --git a/programs/budget/src/budget_processor.rs b/programs/budget/src/budget_processor.rs index 79984b3d835846..fe0afe57c99f04 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 162b1a9f72ea7d..f39ab0f7601a66 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 6a7487cb4989e3..474b2e5dfba3d6 100644 --- a/programs/exchange/src/exchange_processor.rs +++ b/programs/exchange/src/exchange_processor.rs @@ -469,7 +469,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 2def1df5f49172..312d12a3a5c2de 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 2ba12a014a12ab..fd831a9590cd3d 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 9c8d6a5a64575e..dd7910ec5cc7b7 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 44d9bc367eb0c7..8255f417220d15 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 00076fccbd6475..662859881bf392 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 6c71df18dee356..2b499b9f561dce 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 17244efbae611a..88bd7f702003f2 100644 --- a/runtime/benches/bank.rs +++ b/runtime/benches/bank.rs @@ -3,21 +3,18 @@ extern crate test; use log::*; -use solana_runtime::bank::*; -use solana_runtime::bank_client::BankClient; -use solana_runtime::loader_utils::create_invoke_instruction; -use solana_sdk::account::KeyedAccount; -use solana_sdk::client::AsyncClient; -use solana_sdk::client::SyncClient; -use solana_sdk::clock::MAX_RECENT_BLOCKHASHES; -use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::instruction::InstructionError; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::{Keypair, KeypairUtil}; -use solana_sdk::transaction::Transaction; -use std::sync::Arc; -use std::thread::sleep; -use std::time::Duration; +use solana_runtime::{bank::*, bank_client::BankClient, loader_utils::create_invoke_instruction}; +use solana_sdk::{ + account::KeyedAccount, + client::{AsyncClient, SyncClient}, + clock::MAX_RECENT_BLOCKHASHES, + genesis_config::create_genesis_config, + instruction::InstructionError, + pubkey::Pubkey, + signature::{Keypair, Signer}, + transaction::Transaction, +}; +use std::{sync::Arc, thread::sleep, time::Duration}; use test::Bencher; const BUILTIN_PROGRAM_ID: [u8; 32] = [ diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index c0252403761ff6..f6544bd7f8f48c 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -662,20 +662,24 @@ mod tests { use crate::rent_collector::RentCollector; use bincode::serialize_into; use rand::{thread_rng, Rng}; - use solana_sdk::account::Account; - use solana_sdk::epoch_schedule::EpochSchedule; - use solana_sdk::fee_calculator::FeeCalculator; - use solana_sdk::hash::Hash; - use solana_sdk::instruction::CompiledInstruction; - use solana_sdk::message::Message; - use solana_sdk::nonce_state; - use solana_sdk::rent::Rent; - use solana_sdk::signature::{Keypair, KeypairUtil}; - use solana_sdk::system_program; - use solana_sdk::transaction::Transaction; - use std::io::Cursor; - use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; - use std::{thread, time}; + use solana_sdk::{ + account::Account, + epoch_schedule::EpochSchedule, + fee_calculator::FeeCalculator, + hash::Hash, + instruction::CompiledInstruction, + message::Message, + nonce_state, + rent::Rent, + signature::{Keypair, Signer}, + system_program, + transaction::Transaction, + }; + use std::{ + io::Cursor, + sync::atomic::{AtomicBool, AtomicU64, Ordering}, + {thread, time}, + }; use tempfile::TempDir; fn load_accounts_with_fee_and_rent( diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 1c0be98d0f950b..a0a369faca3787 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -2458,7 +2458,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 4477eb364315d2..7466411e8e28d7 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -179,7 +179,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 31207e5c43f1d0..d048c46d3d71b6 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -2106,7 +2106,6 @@ mod tests { }; use bincode::{serialize_into, serialized_size}; use solana_sdk::instruction::AccountMeta; - use solana_sdk::system_program::solana_system_program; use solana_sdk::{ account::KeyedAccount, account_utils::StateMut, @@ -2118,8 +2117,9 @@ mod tests { nonce_state, poh_config::PohConfig, rent::Rent, - signature::{Keypair, KeypairUtil}, - system_instruction, system_program, + signature::{Keypair, Signer}, + system_instruction, + system_program::{self, solana_system_program}, sysvar::{fees::Fees, rewards::Rewards}, timing::duration_as_s, }; diff --git a/runtime/src/bank_client.rs b/runtime/src/bank_client.rs index d147f30eaff0d0..2ecdc86013c96f 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 e361fda9fb86b9..11bfd33412cd46 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 85d226a85c6a4d..7a4f51d854041c 100644 --- a/runtime/src/loader_utils.rs +++ b/runtime/src/loader_utils.rs @@ -1,11 +1,13 @@ use serde::Serialize; -use solana_sdk::client::Client; -use solana_sdk::instruction::{AccountMeta, Instruction}; -use solana_sdk::loader_instruction; -use solana_sdk::message::Message; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::{Keypair, KeypairUtil}; -use solana_sdk::system_instruction; +use solana_sdk::{ + client::Client, + instruction::{AccountMeta, Instruction}, + loader_instruction, + message::Message, + pubkey::Pubkey, + signature::{Keypair, Signer}, + system_instruction, +}; pub fn load_program( bank_client: &T, diff --git a/runtime/src/nonce_utils.rs b/runtime/src/nonce_utils.rs index aa7dc1a6922b29..491ab051132605 100644 --- a/runtime/src/nonce_utils.rs +++ b/runtime/src/nonce_utils.rs @@ -80,7 +80,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 2cacf7257f63d5..aeefbb82940c54 100644 --- a/runtime/src/storage_utils.rs +++ b/runtime/src/storage_utils.rs @@ -82,10 +82,12 @@ pub fn archiver_accounts(bank: &Bank) -> HashMap { pub(crate) mod tests { use super::*; use crate::bank_client::BankClient; - 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::{ + client::SyncClient, + genesis_config::create_genesis_config, + message::Message, + signature::{Keypair, Signer}, + }; use solana_storage_program::{ storage_contract::{StorageAccount, STORAGE_ACCOUNT_SPACE}, storage_instruction::{self, StorageAccountType}, diff --git a/runtime/src/system_instruction_processor.rs b/runtime/src/system_instruction_processor.rs index d99435997631f8..2886246dacfdd6 100644 --- a/runtime/src/system_instruction_processor.rs +++ b/runtime/src/system_instruction_processor.rs @@ -331,7 +331,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 4d8e8f6bbb9c9a..eae9c0704d14e2 100644 --- a/runtime/tests/noop.rs +++ b/runtime/tests/noop.rs @@ -1,10 +1,9 @@ -use solana_runtime::bank::Bank; -use solana_runtime::bank_client::BankClient; -use solana_runtime::loader_utils::create_invoke_instruction; -use solana_sdk::client::SyncClient; -use solana_sdk::genesis_config::create_genesis_config; -use solana_sdk::pubkey::Pubkey; -use solana_sdk::signature::KeypairUtil; +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::Signer, +}; #[test] fn test_program_native_noop() { diff --git a/runtime/tests/stake.rs b/runtime/tests/stake.rs index a293ba3dd4d11e..f8ddd5def93766 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 a3c433fef6fc97..a49b04ad108d61 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 c491db9fc94f62..f87a679b5963a8 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 434fc365c2757a..e0b4d55b351d5d 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 a7e85b1eb15a38..c6b29d454de929 100644 --- a/sdk/src/message.rs +++ b/sdk/src/message.rs @@ -249,8 +249,10 @@ impl Message { #[cfg(test)] mod tests { use super::*; - use crate::instruction::AccountMeta; - use crate::signature::{Keypair, KeypairUtil}; + use crate::{ + instruction::AccountMeta, + signature::{Keypair, Signer}, + }; #[test] fn test_message_unique_program_ids() { diff --git a/sdk/src/signature.rs b/sdk/src/signature.rs index c3856f8760873e..6ee92da76aa021 100644 --- a/sdk/src/signature.rs +++ b/sdk/src/signature.rs @@ -131,7 +131,7 @@ impl FromStr for Signature { } } -pub trait KeypairUtil { +pub trait Signer { fn pubkey(&self) -> Pubkey { self.try_pubkey().unwrap_or_default() } @@ -142,7 +142,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()) @@ -163,7 +163,7 @@ impl KeypairUtil for Keypair { impl PartialEq for Keypair where - T: KeypairUtil, + T: Signer, { fn eq(&self, other: &T) -> bool { self.pubkey() == other.pubkey() @@ -192,7 +192,7 @@ enum PresignerError { VerificationFailure, } -impl KeypairUtil for Presigner { +impl Signer for Presigner { fn try_pubkey(&self) -> Result> { Ok(self.pubkey) } @@ -208,7 +208,7 @@ impl KeypairUtil for Presigner { impl PartialEq for Presigner where - T: KeypairUtil, + T: Signer, { fn eq(&self, other: &T) -> bool { self.pubkey() == other.pubkey() @@ -430,7 +430,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); @@ -448,7 +448,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 b8c09e083eacb2..d62baddf98c64f 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 e5b112d62f0029..f6a2dd681cb27d 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 fc9f0a43246183..daec9afe7e3251 100644 --- a/sdk/src/transaction.rs +++ b/sdk/src/transaction.rs @@ -331,10 +331,12 @@ impl Transaction { #[cfg(test)] mod tests { use super::*; - use crate::hash::hash; - use crate::instruction::AccountMeta; - use crate::signature::{Keypair, KeypairUtil}; - use crate::system_instruction; + use crate::{ + hash::hash, + instruction::AccountMeta, + signature::{Keypair, Signer}, + system_instruction, + }; use bincode::{deserialize, serialize, serialized_size}; use std::mem::size_of; diff --git a/validator/src/main.rs b/validator/src/main.rs index a49ffd60b9a1be..649ff168f72fc4 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 0509cea1c06bc0..0450b2cc00ae6b 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) {