Skip to content

Commit 1133631

Browse files
committed
second pass on correctness, normalize style
1 parent bb4e9d5 commit 1133631

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

program/src/processor.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ impl Processor {
394394
if Clock::check_id(branch_account.key) {
395395
let _stake_history_info = next_account_info(account_info_iter)?;
396396
let _stake_config_info = next_account_info(account_info_iter)?;
397+
// let _stake_authority_info = next_account_info(account_info_iter);
397398
} else {
398399
let stake_authority_info = branch_account;
399400
if !stake_authority_info.is_signer {
@@ -752,7 +753,9 @@ impl Processor {
752753
// diverge
753754
{
754755
let branch_account = next_account_info(account_info_iter)?;
755-
if !Clock::check_id(branch_account.key) {
756+
if Clock::check_id(branch_account.key) {
757+
// let _stake_authority_info = next_account_info(account_info_iter);
758+
} else {
756759
let stake_authority_info = branch_account;
757760
if !stake_authority_info.is_signer {
758761
return Err(ProgramError::MissingRequiredSignature);
@@ -813,6 +816,7 @@ impl Processor {
813816
let branch_account = next_account_info(account_info_iter)?;
814817
if Clock::check_id(branch_account.key) {
815818
let _stake_history_info = next_account_info(account_info_iter)?;
819+
// let _stake_authority_info = next_account_info(account_info_iter);
816820
} else {
817821
let stake_authority_info = branch_account;
818822
if !stake_authority_info.is_signer {
@@ -957,18 +961,17 @@ impl Processor {
957961
let stake_account_info = next_account_info(account_info_iter)?;
958962

959963
// diverge
960-
let _old_stake_or_withdraw_authority_info = {
964+
{
961965
let branch_account = next_account_info(account_info_iter)?;
962966
if Clock::check_id(branch_account.key) {
963-
next_account_info(account_info_iter)?
967+
let _old_stake_or_withdraw_authority_info = next_account_info(account_info_iter)?;
964968
} else {
965969
let old_stake_or_withdraw_authority_info = branch_account;
966970
if !old_stake_or_withdraw_authority_info.is_signer {
967971
return Err(ProgramError::MissingRequiredSignature);
968972
}
969-
old_stake_or_withdraw_authority_info
970973
}
971-
};
974+
}
972975

973976
// converge
974977
let new_stake_or_withdraw_authority_info = next_account_info(account_info_iter)?;

program/tests/interface.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,8 @@ fn test_no_signer_bypass_new_interface() {
11641164
.accounts
11651165
.retain(|account| !is_stake_program_sysvar_or_config(account.pubkey));
11661166

1167+
let instruction = instruction;
1168+
11671169
for i in 0..instruction.accounts.len() {
11681170
if !instruction.accounts[i].is_signer {
11691171
continue;

0 commit comments

Comments
 (0)