|
5 | 5 | crate::{
|
6 | 6 | find_deposit_authority_program_address, find_stake_program_address,
|
7 | 7 | find_transient_stake_program_address, find_withdraw_authority_program_address,
|
8 |
| - stake_program, |
9 | 8 | state::{Fee, FeeType, StakePool, ValidatorList},
|
10 | 9 | MAX_VALIDATORS_TO_UPDATE,
|
11 | 10 | },
|
12 | 11 | borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
|
13 | 12 | solana_program::{
|
14 | 13 | instruction::{AccountMeta, Instruction},
|
15 | 14 | pubkey::Pubkey,
|
16 |
| - system_program, sysvar, |
| 15 | + stake, system_program, sysvar, |
17 | 16 | },
|
18 | 17 | };
|
19 | 18 |
|
@@ -443,9 +442,9 @@ pub fn add_validator_to_pool(
|
443 | 442 | AccountMeta::new_readonly(sysvar::rent::id(), false),
|
444 | 443 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
445 | 444 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
446 |
| - AccountMeta::new_readonly(stake_program::config_id(), false), |
| 445 | + AccountMeta::new_readonly(stake::config::id(), false), |
447 | 446 | AccountMeta::new_readonly(system_program::id(), false),
|
448 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 447 | + AccountMeta::new_readonly(stake::program::id(), false), |
449 | 448 | ];
|
450 | 449 | Instruction {
|
451 | 450 | program_id: *program_id,
|
@@ -478,7 +477,7 @@ pub fn remove_validator_from_pool(
|
478 | 477 | AccountMeta::new_readonly(*transient_stake_account, false),
|
479 | 478 | AccountMeta::new(*destination_stake_account, false),
|
480 | 479 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
481 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 480 | + AccountMeta::new_readonly(stake::program::id(), false), |
482 | 481 | ];
|
483 | 482 | Instruction {
|
484 | 483 | program_id: *program_id,
|
@@ -512,7 +511,7 @@ pub fn decrease_validator_stake(
|
512 | 511 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
513 | 512 | AccountMeta::new_readonly(sysvar::rent::id(), false),
|
514 | 513 | AccountMeta::new_readonly(system_program::id(), false),
|
515 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 514 | + AccountMeta::new_readonly(stake::program::id(), false), |
516 | 515 | ];
|
517 | 516 | Instruction {
|
518 | 517 | program_id: *program_id,
|
@@ -551,9 +550,9 @@ pub fn increase_validator_stake(
|
551 | 550 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
552 | 551 | AccountMeta::new_readonly(sysvar::rent::id(), false),
|
553 | 552 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
554 |
| - AccountMeta::new_readonly(stake_program::config_id(), false), |
| 553 | + AccountMeta::new_readonly(stake::config::id(), false), |
555 | 554 | AccountMeta::new_readonly(system_program::id(), false),
|
556 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 555 | + AccountMeta::new_readonly(stake::program::id(), false), |
557 | 556 | ];
|
558 | 557 | Instruction {
|
559 | 558 | program_id: *program_id,
|
@@ -736,7 +735,7 @@ pub fn update_validator_list_balance(
|
736 | 735 | AccountMeta::new(*reserve_stake, false),
|
737 | 736 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
738 | 737 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
739 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 738 | + AccountMeta::new_readonly(stake::program::id(), false), |
740 | 739 | ];
|
741 | 740 | accounts.append(
|
742 | 741 | &mut validator_vote_accounts
|
@@ -911,20 +910,22 @@ pub fn deposit_stake(
|
911 | 910 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
912 | 911 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
913 | 912 | AccountMeta::new_readonly(*token_program_id, false),
|
914 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 913 | + AccountMeta::new_readonly(stake::program::id(), false), |
915 | 914 | ];
|
916 | 915 | vec![
|
917 |
| - stake_program::authorize( |
| 916 | + stake::instruction::authorize( |
918 | 917 | deposit_stake_address,
|
919 | 918 | deposit_stake_withdraw_authority,
|
920 | 919 | &stake_pool_deposit_authority,
|
921 |
| - stake_program::StakeAuthorize::Staker, |
| 920 | + stake::state::StakeAuthorize::Staker, |
| 921 | + None, |
922 | 922 | ),
|
923 |
| - stake_program::authorize( |
| 923 | + stake::instruction::authorize( |
924 | 924 | deposit_stake_address,
|
925 | 925 | deposit_stake_withdraw_authority,
|
926 | 926 | &stake_pool_deposit_authority,
|
927 |
| - stake_program::StakeAuthorize::Withdrawer, |
| 927 | + stake::state::StakeAuthorize::Withdrawer, |
| 928 | + None, |
928 | 929 | ),
|
929 | 930 | Instruction {
|
930 | 931 | program_id: *program_id,
|
@@ -968,20 +969,22 @@ pub fn deposit_stake_with_authority(
|
968 | 969 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
969 | 970 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
970 | 971 | AccountMeta::new_readonly(*token_program_id, false),
|
971 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 972 | + AccountMeta::new_readonly(stake::program::id(), false), |
972 | 973 | ];
|
973 | 974 | vec![
|
974 |
| - stake_program::authorize( |
| 975 | + stake::instruction::authorize( |
975 | 976 | deposit_stake_address,
|
976 | 977 | deposit_stake_withdraw_authority,
|
977 | 978 | stake_pool_deposit_authority,
|
978 |
| - stake_program::StakeAuthorize::Staker, |
| 979 | + stake::state::StakeAuthorize::Staker, |
| 980 | + None, |
979 | 981 | ),
|
980 |
| - stake_program::authorize( |
| 982 | + stake::instruction::authorize( |
981 | 983 | deposit_stake_address,
|
982 | 984 | deposit_stake_withdraw_authority,
|
983 | 985 | stake_pool_deposit_authority,
|
984 |
| - stake_program::StakeAuthorize::Withdrawer, |
| 986 | + stake::state::StakeAuthorize::Withdrawer, |
| 987 | + None, |
985 | 988 | ),
|
986 | 989 | Instruction {
|
987 | 990 | program_id: *program_id,
|
@@ -1094,7 +1097,7 @@ pub fn withdraw_stake(
|
1094 | 1097 | AccountMeta::new(*pool_mint, false),
|
1095 | 1098 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
1096 | 1099 | AccountMeta::new_readonly(*token_program_id, false),
|
1097 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 1100 | + AccountMeta::new_readonly(stake::program::id(), false), |
1098 | 1101 | ];
|
1099 | 1102 | Instruction {
|
1100 | 1103 | program_id: *program_id,
|
@@ -1130,7 +1133,7 @@ pub fn withdraw_sol(
|
1130 | 1133 | AccountMeta::new(*pool_mint, false),
|
1131 | 1134 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
1132 | 1135 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
1133 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 1136 | + AccountMeta::new_readonly(stake::program::id(), false), |
1134 | 1137 | AccountMeta::new_readonly(*token_program_id, false),
|
1135 | 1138 | ];
|
1136 | 1139 | Instruction {
|
@@ -1170,7 +1173,7 @@ pub fn withdraw_sol_with_authority(
|
1170 | 1173 | AccountMeta::new(*pool_mint, false),
|
1171 | 1174 | AccountMeta::new_readonly(sysvar::clock::id(), false),
|
1172 | 1175 | AccountMeta::new_readonly(sysvar::stake_history::id(), false),
|
1173 |
| - AccountMeta::new_readonly(stake_program::id(), false), |
| 1176 | + AccountMeta::new_readonly(stake::program::id(), false), |
1174 | 1177 | AccountMeta::new_readonly(*token_program_id, false),
|
1175 | 1178 | AccountMeta::new_readonly(*sol_withdraw_authority, true),
|
1176 | 1179 | ];
|
|
0 commit comments