genesis validators (#7235)

* genesis validators

* slp1 nodes get 500SOL

* no commission
This commit is contained in:
Rob Walker
2019-12-03 20:44:02 -08:00
committed by GitHub
parent e1b7f40c2b
commit 369f37a0a4
7 changed files with 250 additions and 15 deletions

View File

@ -36,6 +36,10 @@ impl Default for StakeState {
}
impl StakeState {
pub fn get_rent_exempt_reserve(rent: &Rent) -> u64 {
rent.minimum_balance(std::mem::size_of::<StakeState>())
}
// utility function, used by Stakes, tests
pub fn from(account: &Account) -> Option<StakeState> {
account.state().ok()
@ -801,10 +805,6 @@ where
}
}
pub fn get_stake_rent_exempt_reserve(rent: &Rent) -> u64 {
rent.minimum_balance(std::mem::size_of::<StakeState>())
}
// genesis investor accounts
pub fn create_lockup_stake_account(
authorized: &Authorized,

View File

@ -12,6 +12,7 @@ use solana_sdk::{
hash::Hash,
instruction::InstructionError,
pubkey::Pubkey,
rent::Rent,
slot_hashes::SlotHash,
sysvar::clock::Clock,
};
@ -121,6 +122,10 @@ impl VoteState {
}
}
pub fn get_rent_exempt_reserve(rent: &Rent) -> u64 {
rent.minimum_balance(VoteState::size_of())
}
pub fn size_of() -> usize {
// Upper limit on the size of the Vote State. Equal to
// size_of(VoteState) when votes.len() is MAX_LOCKOUT_HISTORY