Revert "Revert "add genesis stake placeholders (#6969)" (#7109)" (#7124)

This reverts commit 702f7cc51d.
This commit is contained in:
Rob Walker
2019-11-25 15:11:55 -08:00
committed by GitHub
parent acbe89a159
commit ef64f00cbb
18 changed files with 1322 additions and 105 deletions

View File

@ -1878,7 +1878,10 @@ mod tests {
stake_account: bob_keypair.into(),
staker: None,
withdrawer: None,
lockup: Lockup { slot: 0, custodian },
lockup: Lockup {
epoch: 0,
custodian,
},
lamports: 1234,
};
let signature = process_command(&config);

View File

@ -271,7 +271,7 @@ impl StakeSubCommands for App<'_, '_> {
pub fn parse_stake_create_account(matches: &ArgMatches<'_>) -> Result<CliCommandInfo, CliError> {
let stake_account = keypair_of(matches, "stake_account").unwrap();
let slot = value_of(&matches, "lockup").unwrap_or(0);
let epoch = value_of(&matches, "lockup").unwrap_or(0);
let custodian = pubkey_of(matches, "custodian").unwrap_or_default();
let staker = pubkey_of(matches, "authorized_staker");
let withdrawer = pubkey_of(matches, "authorized_withdrawer");
@ -282,7 +282,7 @@ pub fn parse_stake_create_account(matches: &ArgMatches<'_>) -> Result<CliCommand
stake_account: stake_account.into(),
staker,
withdrawer,
lockup: Lockup { custodian, slot },
lockup: Lockup { custodian, epoch },
lamports,
},
require_keypair: true,
@ -547,7 +547,7 @@ pub fn process_show_stake_account(
println!("authorized withdrawer: {}", authorized.staker);
}
fn show_lockup(lockup: &Lockup) {
println!("lockup slot: {}", lockup.slot);
println!("lockup epoch: {}", lockup.epoch);
println!("lockup custodian: {}", lockup.custodian);
}
match stake_account.state() {
@ -793,7 +793,7 @@ mod tests {
staker: Some(authorized),
withdrawer: Some(authorized),
lockup: Lockup {
slot: 43,
epoch: 43,
custodian,
},
lamports: 50
@ -823,10 +823,7 @@ mod tests {
stake_account: stake_account_keypair.into(),
staker: None,
withdrawer: None,
lockup: Lockup {
slot: 0,
custodian: Pubkey::default(),
},
lockup: Lockup::default(),
lamports: 50
},
require_keypair: true