create_genesis_block() now returns a struct (#4403)

This commit is contained in:
Michael Vines
2019-05-22 20:39:00 -07:00
committed by GitHub
parent 7ada8510c4
commit 2ed77b040a
27 changed files with 308 additions and 132 deletions

View File

@@ -9,11 +9,17 @@ use solana_vote_api::vote_state;
// The default stake placed with the bootstrap leader
pub const BOOTSTRAP_LEADER_LAMPORTS: u64 = 42;
pub struct GenesisBlockInfo {
pub genesis_block: GenesisBlock,
pub mint_keypair: Keypair,
pub voting_keypair: Keypair,
}
pub fn create_genesis_block_with_leader(
mint_lamports: u64,
bootstrap_leader_id: &Pubkey,
bootstrap_leader_stake_lamports: u64,
) -> (GenesisBlock, Keypair, Keypair) {
) -> GenesisBlockInfo {
let mint_keypair = Keypair::new();
let voting_keypair = Keypair::new();
let staking_keypair = Keypair::new();
@@ -56,5 +62,9 @@ pub fn create_genesis_block_with_leader(
&[solana_vote_program!(), solana_stake_program!()],
);
(genesis_block, mint_keypair, voting_keypair)
GenesisBlockInfo {
genesis_block,
mint_keypair,
voting_keypair,
}
}