From bb2772d0680d68330c69e20fc12f4d20d03b0bd7 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Thu, 19 Nov 2020 13:34:45 -0700 Subject: [PATCH] stake: Cosmetic - rename variable --- programs/stake/src/stake_state.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/programs/stake/src/stake_state.rs b/programs/stake/src/stake_state.rs index a8a208a14..c5b2a3d35 100644 --- a/programs/stake/src/stake_state.rs +++ b/programs/stake/src/stake_state.rs @@ -1046,12 +1046,12 @@ impl<'a> StakeAccount for KeyedAccount<'a> { fn merge( &self, - source_stake: &KeyedAccount, + source_account: &KeyedAccount, clock: &Clock, stake_history: &StakeHistory, signers: &HashSet, ) -> Result<(), InstructionError> { - if source_stake.owner()? != id() { + if source_account.owner()? != id() { return Err(InstructionError::IncorrectProgramId); } @@ -1060,7 +1060,7 @@ impl<'a> StakeAccount for KeyedAccount<'a> { // Authorized staker is allowed to split/merge accounts meta.authorized.check(signers, StakeAuthorize::Staker)?; - let source_meta = get_info_if_mergable(source_stake, clock, stake_history)?; + let source_meta = get_info_if_mergable(source_account, clock, stake_history)?; // Meta must match for both accounts if meta != source_meta { @@ -1068,8 +1068,8 @@ impl<'a> StakeAccount for KeyedAccount<'a> { } // Drain the source stake account - let lamports = source_stake.lamports()?; - source_stake.try_account_ref_mut()?.lamports -= lamports; + let lamports = source_account.lamports()?; + source_account.try_account_ref_mut()?.lamports -= lamports; self.try_account_ref_mut()?.lamports += lamports; Ok(()) }