From 8436457e75241d762d59882a6961b251abae8e68 Mon Sep 17 00:00:00 2001 From: Jack May Date: Wed, 5 Feb 2020 12:48:30 -0800 Subject: [PATCH] Rename program_utils.rs (#8127) --- cli/src/cli.rs | 2 +- ledger-tool/src/main.rs | 4 ++-- ledger/src/blockstore.rs | 2 +- programs/bpf/Cargo.lock | 14 +++++++------- programs/bpf/rust/error_handling/src/lib.rs | 2 +- programs/bpf_loader/src/lib.rs | 2 +- programs/btc_spv/src/spv_processor.rs | 2 +- programs/budget/src/budget_instruction.rs | 2 +- programs/budget/src/budget_processor.rs | 2 +- programs/config/src/config_processor.rs | 2 +- programs/exchange/src/exchange_processor.rs | 2 +- programs/move_loader/src/processor.rs | 2 +- programs/ownable/src/ownable_instruction.rs | 2 +- programs/ownable/src/ownable_processor.rs | 2 +- programs/stake/src/stake_instruction.rs | 2 +- programs/storage/src/storage_processor.rs | 2 +- programs/vest/src/vest_instruction.rs | 2 +- programs/vest/src/vest_processor.rs | 2 +- programs/vote/src/vote_instruction.rs | 2 +- programs/vote/src/vote_state.rs | 2 +- runtime/src/nonce_utils.rs | 2 +- runtime/src/system_instruction_processor.rs | 2 +- sdk/src/lib.rs | 2 +- sdk/src/program_error.rs | 2 +- ...ruction_processor_utils.rs => program_utils.rs} | 0 sdk/src/system_instruction.rs | 2 +- 26 files changed, 32 insertions(+), 32 deletions(-) rename sdk/src/{instruction_processor_utils.rs => program_utils.rs} (100%) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 40f1431982..aec539c98b 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -27,10 +27,10 @@ use solana_sdk::{ fee_calculator::FeeCalculator, hash::Hash, instruction::InstructionError, - instruction_processor_utils::DecodeError, loader_instruction, message::Message, native_token::lamports_to_sol, + program_utils::DecodeError, pubkey::Pubkey, signature::{keypair_from_seed, Keypair, KeypairUtil, Signature}, system_instruction::{create_address_with_seed, SystemError, MAX_ADDRESS_SEED_LEN}, diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 9abdb889a4..60285fff3c 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -14,8 +14,8 @@ use solana_ledger::{ snapshot_utils, }; use solana_sdk::{ - clock::Slot, genesis_config::GenesisConfig, instruction_processor_utils::limited_deserialize, - native_token::lamports_to_sol, pubkey::Pubkey, + clock::Slot, genesis_config::GenesisConfig, native_token::lamports_to_sol, + program_utils::limited_deserialize, pubkey::Pubkey, }; use solana_vote_program::vote_state::VoteState; use std::{ diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index a2f1f9a26d..d36f3c30dc 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -33,7 +33,7 @@ use solana_sdk::{ clock::{Slot, UnixTimestamp, DEFAULT_TICKS_PER_SECOND, MS_PER_TICK}, genesis_config::GenesisConfig, hash::Hash, - instruction_processor_utils::limited_deserialize, + program_utils::limited_deserialize, pubkey::Pubkey, signature::{Keypair, KeypairUtil, Signature}, timing::timestamp, diff --git a/programs/bpf/Cargo.lock b/programs/bpf/Cargo.lock index 65170cce8e..cb2e591378 100644 --- a/programs/bpf/Cargo.lock +++ b/programs/bpf/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "publicsuffix 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1666,7 +1666,7 @@ dependencies = [ "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.44" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2184,7 +2184,7 @@ dependencies = [ "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "solana-bpf-loader-program 0.24.0", "solana-logger 0.24.0", "solana-measure 0.24.0", @@ -2222,7 +2222,7 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "solana-crate-features 0.24.0", "solana-logger 0.24.0", @@ -2857,7 +2857,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3251,7 +3251,7 @@ dependencies = [ "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" "checksum serde_bytes 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "45af0182ff64abaeea290235eb67da3825a576c5d53e642c4d5b652e12e6effc" "checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" -"checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" +"checksum serde_json 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "21b01d7f0288608a01dca632cf1df859df6fd6ffa885300fc275ce2ba6221953" "checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" "checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" diff --git a/programs/bpf/rust/error_handling/src/lib.rs b/programs/bpf/rust/error_handling/src/lib.rs index e356a0e587..ddf6889531 100644 --- a/programs/bpf/rust/error_handling/src/lib.rs +++ b/programs/bpf/rust/error_handling/src/lib.rs @@ -9,8 +9,8 @@ use solana_sdk::{ entrypoint, entrypoint::ProgramResult, info, - instruction_processor_utils::DecodeError, program_error::{PrintProgramError, ProgramError}, + program_utils::DecodeError, pubkey::Pubkey, }; use thiserror::Error; diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index 68a30df554..5a533773f9 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -10,8 +10,8 @@ use solana_sdk::{ account::KeyedAccount, entrypoint::SUCCESS, instruction::InstructionError, - instruction_processor_utils::{is_executable, limited_deserialize, next_keyed_account}, loader_instruction::LoaderInstruction, + program_utils::{is_executable, limited_deserialize, next_keyed_account}, pubkey::Pubkey, sysvar::rent, }; diff --git a/programs/btc_spv/src/spv_processor.rs b/programs/btc_spv/src/spv_processor.rs index 167f9de3c5..ea805a5420 100644 --- a/programs/btc_spv/src/spv_processor.rs +++ b/programs/btc_spv/src/spv_processor.rs @@ -8,7 +8,7 @@ use hex; use log::*; use solana_sdk::account::KeyedAccount; use solana_sdk::instruction::InstructionError; -use solana_sdk::instruction_processor_utils::limited_deserialize; +use solana_sdk::program_utils::limited_deserialize; use solana_sdk::pubkey::Pubkey; pub struct SpvProcessor {} diff --git a/programs/budget/src/budget_instruction.rs b/programs/budget/src/budget_instruction.rs index b4736536e6..3d782b579c 100644 --- a/programs/budget/src/budget_instruction.rs +++ b/programs/budget/src/budget_instruction.rs @@ -6,7 +6,7 @@ use serde_derive::{Deserialize, Serialize}; use solana_sdk::{ hash::Hash, instruction::{AccountMeta, Instruction}, - instruction_processor_utils::DecodeError, + program_utils::DecodeError, pubkey::Pubkey, system_instruction, }; diff --git a/programs/budget/src/budget_processor.rs b/programs/budget/src/budget_processor.rs index 79984b3d83..5f61321d8f 100644 --- a/programs/budget/src/budget_processor.rs +++ b/programs/budget/src/budget_processor.rs @@ -10,7 +10,7 @@ use solana_sdk::{ account::KeyedAccount, hash::hash, instruction::InstructionError, - instruction_processor_utils::{limited_deserialize, next_keyed_account}, + program_utils::{limited_deserialize, next_keyed_account}, pubkey::Pubkey, }; diff --git a/programs/config/src/config_processor.rs b/programs/config/src/config_processor.rs index 162b1a9f72..1a30d617bc 100644 --- a/programs/config/src/config_processor.rs +++ b/programs/config/src/config_processor.rs @@ -5,7 +5,7 @@ use bincode::deserialize; use log::*; use solana_sdk::account::KeyedAccount; use solana_sdk::instruction::InstructionError; -use solana_sdk::instruction_processor_utils::{limited_deserialize, next_keyed_account}; +use solana_sdk::program_utils::{limited_deserialize, next_keyed_account}; use solana_sdk::pubkey::Pubkey; pub fn process_instruction( diff --git a/programs/exchange/src/exchange_processor.rs b/programs/exchange/src/exchange_processor.rs index 6a7487cb49..cc08bd5650 100644 --- a/programs/exchange/src/exchange_processor.rs +++ b/programs/exchange/src/exchange_processor.rs @@ -7,7 +7,7 @@ use log::*; use solana_metrics::inc_new_counter_info; use solana_sdk::account::KeyedAccount; use solana_sdk::instruction::InstructionError; -use solana_sdk::instruction_processor_utils::limited_deserialize; +use solana_sdk::program_utils::limited_deserialize; use solana_sdk::pubkey::Pubkey; use std::cmp; diff --git a/programs/move_loader/src/processor.rs b/programs/move_loader/src/processor.rs index db0389277f..aa138b5f1d 100644 --- a/programs/move_loader/src/processor.rs +++ b/programs/move_loader/src/processor.rs @@ -8,8 +8,8 @@ use solana_sdk::{ account::KeyedAccount, account_utils::State, instruction::InstructionError, - instruction_processor_utils::{is_executable, limited_deserialize, next_keyed_account}, move_loader::id, + program_utils::{is_executable, limited_deserialize, next_keyed_account}, pubkey::Pubkey, sysvar::rent, }; diff --git a/programs/ownable/src/ownable_instruction.rs b/programs/ownable/src/ownable_instruction.rs index c567ea73c9..8a35d2c762 100644 --- a/programs/ownable/src/ownable_instruction.rs +++ b/programs/ownable/src/ownable_instruction.rs @@ -1,7 +1,7 @@ use num_derive::{FromPrimitive, ToPrimitive}; use solana_sdk::{ instruction::{AccountMeta, Instruction}, - instruction_processor_utils::DecodeError, + program_utils::DecodeError, pubkey::Pubkey, system_instruction, }; diff --git a/programs/ownable/src/ownable_processor.rs b/programs/ownable/src/ownable_processor.rs index 4273909930..98cf977dd1 100644 --- a/programs/ownable/src/ownable_processor.rs +++ b/programs/ownable/src/ownable_processor.rs @@ -5,7 +5,7 @@ use bincode::serialize_into; use solana_sdk::{ account::KeyedAccount, instruction::InstructionError, - instruction_processor_utils::{limited_deserialize, next_keyed_account}, + program_utils::{limited_deserialize, next_keyed_account}, pubkey::Pubkey, }; diff --git a/programs/stake/src/stake_instruction.rs b/programs/stake/src/stake_instruction.rs index 5105835957..13ebde7f05 100644 --- a/programs/stake/src/stake_instruction.rs +++ b/programs/stake/src/stake_instruction.rs @@ -8,7 +8,7 @@ use serde_derive::{Deserialize, Serialize}; use solana_sdk::{ account::{get_signers, KeyedAccount}, instruction::{AccountMeta, Instruction, InstructionError, WithSigner}, - instruction_processor_utils::{limited_deserialize, next_keyed_account, DecodeError}, + program_utils::{limited_deserialize, next_keyed_account, DecodeError}, pubkey::Pubkey, system_instruction, sysvar::{self, clock::Clock, rent::Rent, stake_history::StakeHistory, Sysvar}, diff --git a/programs/storage/src/storage_processor.rs b/programs/storage/src/storage_processor.rs index a85e1aa5dd..c0be6124eb 100644 --- a/programs/storage/src/storage_processor.rs +++ b/programs/storage/src/storage_processor.rs @@ -5,7 +5,7 @@ use crate::{storage_contract::StorageAccount, storage_instruction::StorageInstru use solana_sdk::{ account::KeyedAccount, instruction::InstructionError, - instruction_processor_utils::limited_deserialize, + program_utils::limited_deserialize, pubkey::Pubkey, sysvar::{clock::Clock, rewards::Rewards, Sysvar}, }; diff --git a/programs/vest/src/vest_instruction.rs b/programs/vest/src/vest_instruction.rs index 6323817607..a4ba674044 100644 --- a/programs/vest/src/vest_instruction.rs +++ b/programs/vest/src/vest_instruction.rs @@ -5,7 +5,7 @@ use num_derive::FromPrimitive; use serde_derive::{Deserialize, Serialize}; use solana_sdk::{ instruction::{AccountMeta, Instruction, InstructionError}, - instruction_processor_utils::DecodeError, + program_utils::DecodeError, pubkey::Pubkey, system_instruction, }; diff --git a/programs/vest/src/vest_processor.rs b/programs/vest/src/vest_processor.rs index c9de991a7b..89af1f1c06 100644 --- a/programs/vest/src/vest_processor.rs +++ b/programs/vest/src/vest_processor.rs @@ -9,7 +9,7 @@ use solana_config_program::get_config_data; use solana_sdk::{ account::{Account, KeyedAccount}, instruction::InstructionError, - instruction_processor_utils::{limited_deserialize, next_keyed_account}, + program_utils::{limited_deserialize, next_keyed_account}, pubkey::Pubkey, }; use std::cell::RefMut; diff --git a/programs/vote/src/vote_instruction.rs b/programs/vote/src/vote_instruction.rs index 7412ae9f50..fe18ba2648 100644 --- a/programs/vote/src/vote_instruction.rs +++ b/programs/vote/src/vote_instruction.rs @@ -12,7 +12,7 @@ use solana_metrics::datapoint_debug; use solana_sdk::{ account::{get_signers, KeyedAccount}, instruction::{AccountMeta, Instruction, InstructionError, WithSigner}, - instruction_processor_utils::{limited_deserialize, next_keyed_account, DecodeError}, + program_utils::{limited_deserialize, next_keyed_account, DecodeError}, pubkey::Pubkey, system_instruction, sysvar::{self, clock::Clock, slot_hashes::SlotHashes, Sysvar}, diff --git a/programs/vote/src/vote_state.rs b/programs/vote/src/vote_state.rs index 0ab66d38f2..323dfc05a5 100644 --- a/programs/vote/src/vote_state.rs +++ b/programs/vote/src/vote_state.rs @@ -583,7 +583,7 @@ mod tests { account::{get_signers, Account}, account_utils::StateMut, hash::hash, - instruction_processor_utils::next_keyed_account, + program_utils::next_keyed_account, }; use std::cell::RefCell; diff --git a/runtime/src/nonce_utils.rs b/runtime/src/nonce_utils.rs index aa7dc1a692..846afec84d 100644 --- a/runtime/src/nonce_utils.rs +++ b/runtime/src/nonce_utils.rs @@ -3,8 +3,8 @@ use solana_sdk::{ account_utils::StateMut, hash::Hash, instruction::CompiledInstruction, - instruction_processor_utils::limited_deserialize, nonce_state::NonceState, + program_utils::limited_deserialize, pubkey::Pubkey, system_instruction::SystemInstruction, system_program, diff --git a/runtime/src/system_instruction_processor.rs b/runtime/src/system_instruction_processor.rs index edfe92a703..61bad42969 100644 --- a/runtime/src/system_instruction_processor.rs +++ b/runtime/src/system_instruction_processor.rs @@ -3,8 +3,8 @@ use solana_sdk::{ account::{get_signers, Account, KeyedAccount}, account_utils::StateMut, instruction::InstructionError, - instruction_processor_utils::{limited_deserialize, next_keyed_account}, nonce_state::{NonceAccount, NonceState}, + program_utils::{limited_deserialize, next_keyed_account}, pubkey::Pubkey, system_instruction::{ create_address_with_seed, SystemError, SystemInstruction, MAX_PERMITTED_DATA_LENGTH, diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 47b33cc7ac..859254ab9f 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -12,7 +12,6 @@ pub mod fee_calculator; pub mod hash; pub mod inflation; pub mod instruction; -pub mod instruction_processor_utils; pub mod loader_instruction; pub mod message; pub mod move_loader; @@ -21,6 +20,7 @@ pub mod native_token; pub mod nonce_state; pub mod packet; pub mod poh_config; +pub mod program_utils; pub mod pubkey; pub mod rent; pub mod rpc_port; diff --git a/sdk/src/program_error.rs b/sdk/src/program_error.rs index 06b0281010..435f803d98 100644 --- a/sdk/src/program_error.rs +++ b/sdk/src/program_error.rs @@ -1,4 +1,4 @@ -use crate::{instruction::InstructionError, instruction_processor_utils::DecodeError}; +use crate::{instruction::InstructionError, program_utils::DecodeError}; use num_traits::{FromPrimitive, ToPrimitive}; use thiserror::Error; diff --git a/sdk/src/instruction_processor_utils.rs b/sdk/src/program_utils.rs similarity index 100% rename from sdk/src/instruction_processor_utils.rs rename to sdk/src/program_utils.rs diff --git a/sdk/src/system_instruction.rs b/sdk/src/system_instruction.rs index aa5daae3fd..74e08f5d65 100644 --- a/sdk/src/system_instruction.rs +++ b/sdk/src/system_instruction.rs @@ -1,8 +1,8 @@ use crate::{ hash::hashv, instruction::{AccountMeta, Instruction, WithSigner}, - instruction_processor_utils::DecodeError, nonce_state::NonceState, + program_utils::DecodeError, pubkey::Pubkey, system_program, sysvar::{recent_blockhashes, rent},