DRY up GenesisBlock

This commit is contained in:
Greg Fitzgerald 2019-02-19 21:08:15 -07:00 committed by Grimes
parent a17903a89f
commit 94f9ac0332
1 changed files with 1 additions and 13 deletions

View File

@ -27,19 +27,7 @@ impl GenesisBlock {
let tokens = tokens
.checked_add(BOOTSTRAP_LEADER_TOKENS)
.unwrap_or(tokens);
let mint_keypair = Keypair::new();
let bootstrap_leader_keypair = Keypair::new();
let bootstrap_leader_vote_account_keypair = Keypair::new();
(
Self {
bootstrap_leader_id: bootstrap_leader_keypair.pubkey(),
bootstrap_leader_tokens: BOOTSTRAP_LEADER_TOKENS,
bootstrap_leader_vote_account_id: bootstrap_leader_vote_account_keypair.pubkey(),
mint_id: mint_keypair.pubkey(),
tokens,
},
mint_keypair,
)
Self::new_with_leader(tokens, Keypair::new().pubkey(), BOOTSTRAP_LEADER_TOKENS)
}
pub fn new_with_leader(