Skip to content

Commit

Permalink
use solana-pubkey instead of solana-sdk in stake-program (#4327)
Browse files Browse the repository at this point in the history
* use solana-pubkey instead of solana-sdk in stake-program

* remove redundant dep from dev deps (already in main deps)
  • Loading branch information
kevinheavey authored Jan 9, 2025
1 parent 2cacced commit 5588b66
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 117 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

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

1 change: 1 addition & 0 deletions programs/stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ solana-config-program = { workspace = true }
solana-feature-set = { workspace = true }
solana-log-collector = { workspace = true }
solana-program-runtime = { workspace = true }
solana-pubkey = { workspace = true }
solana-sdk = { workspace = true }
solana-type-overrides = { workspace = true }
solana-vote-program = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions programs/stake/benches/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use {
criterion::{black_box, criterion_group, criterion_main, Criterion},
solana_feature_set::FeatureSet,
solana_program_runtime::invoke_context::mock_process_instruction,
solana_pubkey::Pubkey,
solana_sdk::{
account::{create_account_shared_data_for_test, AccountSharedData, WritableAccount},
clock::{Clock, Epoch},
instruction::AccountMeta,
pubkey::Pubkey,
stake::{
instruction::{
self, AuthorizeCheckedWithSeedArgs, AuthorizeWithSeedArgs, LockupArgs,
Expand Down Expand Up @@ -48,7 +48,7 @@ impl TestSetup {
StakeStateV2::size_of(),
&solana_stake_program::id(),
);
let stake_address = solana_sdk::pubkey::Pubkey::new_unique();
let stake_address = solana_pubkey::Pubkey::new_unique();
Self {
// some stake instructions are behind feature gate, enable all
// feature gates to bench all instructions
Expand Down
2 changes: 1 addition & 1 deletion programs/stake/src/points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
//! Used by `solana-runtime`.
use {
solana_pubkey::Pubkey,
solana_sdk::{
clock::Epoch,
instruction::InstructionError,
pubkey::Pubkey,
stake::state::{Delegation, Stake, StakeStateV2},
stake_history::StakeHistory,
},
Expand Down
3 changes: 2 additions & 1 deletion programs/stake/src/rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ mod tests {
use {
super::*,
crate::{points::null_tracer, stake_state::new_stake},
solana_sdk::{native_token, pubkey::Pubkey},
solana_pubkey::Pubkey,
solana_sdk::native_token,
test_case::test_case,
};

Expand Down
212 changes: 106 additions & 106 deletions programs/stake/src/stake_instruction.rs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions programs/stake/src/stake_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use {
solana_feature_set::FeatureSet,
solana_log_collector::ic_msg,
solana_program_runtime::invoke_context::InvokeContext,
solana_pubkey::Pubkey,
solana_sdk::{
account::{AccountSharedData, ReadableAccount},
account_utils::StateMut,
clock::{Clock, Epoch},
instruction::{checked_add, InstructionError},
pubkey::Pubkey,
rent::Rent,
stake::{
instruction::{LockupArgs, StakeError},
Expand Down Expand Up @@ -1448,10 +1448,10 @@ mod tests {
super::*,
proptest::prelude::*,
solana_program_runtime::with_mock_invoke_context,
solana_pubkey::Pubkey,
solana_sdk::{
account::{create_account_shared_data_for_test, AccountSharedData},
epoch_schedule::EpochSchedule,
pubkey::Pubkey,
stake::state::warmup_cooldown_rate,
sysvar::{epoch_schedule, SysvarId},
},
Expand All @@ -1460,7 +1460,7 @@ mod tests {

#[test]
fn test_authorized_authorize() {
let staker = solana_sdk::pubkey::new_rand();
let staker = solana_pubkey::new_rand();
let mut authorized = Authorized::auto(&staker);
let mut signers = HashSet::new();
assert_eq!(
Expand All @@ -1476,9 +1476,9 @@ mod tests {

#[test]
fn test_authorized_authorize_with_custodian() {
let staker = solana_sdk::pubkey::new_rand();
let custodian = solana_sdk::pubkey::new_rand();
let invalid_custodian = solana_sdk::pubkey::new_rand();
let staker = solana_pubkey::new_rand();
let custodian = solana_pubkey::new_rand();
let invalid_custodian = solana_pubkey::new_rand();
let mut authorized = Authorized::auto(&staker);
let mut signers = HashSet::new();
signers.insert(staker);
Expand Down Expand Up @@ -2174,7 +2174,7 @@ mod tests {

#[test]
fn test_lockup_is_expired() {
let custodian = solana_sdk::pubkey::new_rand();
let custodian = solana_pubkey::new_rand();
let lockup = Lockup {
epoch: 1,
unix_timestamp: 1,
Expand Down
1 change: 1 addition & 0 deletions svm/examples/Cargo.lock

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

0 comments on commit 5588b66

Please sign in to comment.