From 63f185f9bf6678fa030e962008c5679692e904c9 Mon Sep 17 00:00:00 2001 From: Rob Walker Date: Thu, 2 Jan 2020 13:15:31 -0800 Subject: [PATCH] Delete unused type (#7653) --- programs/stake/src/stake_state.rs | 7 ++++++- runtime/src/bank.rs | 4 ++-- runtime/src/stakes.rs | 12 ------------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/programs/stake/src/stake_state.rs b/programs/stake/src/stake_state.rs index f346c5980..fd5b25fb0 100644 --- a/programs/stake/src/stake_state.rs +++ b/programs/stake/src/stake_state.rs @@ -843,7 +843,12 @@ pub fn create_lockup_stake_account( let mut stake_account = Account::new(lamports, std::mem::size_of::(), &id()); let rent_exempt_reserve = rent.minimum_balance(stake_account.data.len()); - assert!(lamports >= rent_exempt_reserve); + assert!( + lamports >= rent_exempt_reserve, + "lamports: {} is less than rent_exempt_reserve {}", + lamports, + rent_exempt_reserve + ); stake_account .set_state(&StakeState::Initialized(Meta { diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 1263866b1..41c660804 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -4470,13 +4470,13 @@ mod tests { &Authorized::auto(&pubkey), &Lockup::default(), &Rent::default(), - 42, + 50_000_000, ), ); }); } solana_logger::setup(); - let (mut genesis_config, _) = create_genesis_config(100_000_000); + let (mut genesis_config, _) = create_genesis_config(100_000_000_000_000); add_lotsa_stake_accounts(&mut genesis_config); let mut bank = std::sync::Arc::new(Bank::new(&genesis_config)); let mut num_banks = 0; diff --git a/runtime/src/stakes.rs b/runtime/src/stakes.rs index 03d7d9cba..6f33c7f31 100644 --- a/runtime/src/stakes.rs +++ b/runtime/src/stakes.rs @@ -8,18 +8,6 @@ use solana_stake_program::stake_state::{new_stake_history_entry, Delegation, Sta use solana_vote_program::vote_state::VoteState; use std::collections::HashMap; -#[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize)] -pub struct StakeDelegation { - /// to whom the stake is delegated - pub voter_pubkey: Pubkey, - /// activated stake amount, set at delegate_stake() time - pub stake: u64, - /// epoch at which this stake was activated, std::Epoch::MAX if is a bootstrap stake - pub activation_epoch: Epoch, - /// epoch the stake was deactivated, std::Epoch::MAX if not deactivated - pub deactivation_epoch: Epoch, -} - #[derive(Default, Clone, PartialEq, Debug, Deserialize, Serialize)] pub struct Stakes { /// vote accounts