Add unix_timestap to stake lockups (#7569)

This commit is contained in:
Rob Walker
2019-12-19 14:37:47 -08:00
committed by GitHub
parent 0245847ea8
commit 3f405d8908
12 changed files with 1038 additions and 373 deletions

View File

@@ -1,8 +1,10 @@
//! A command-line executable for generating the chain's genesis config.
use chrono::DateTime;
use clap::{crate_description, crate_name, value_t, value_t_or_exit, App, Arg, ArgMatches};
use solana_clap_utils::{input_parsers::pubkey_of, input_validators::is_valid_percentage};
use solana_clap_utils::{
input_parsers::{pubkey_of, unix_timestamp_of},
input_validators::is_valid_percentage,
};
use solana_genesis::{genesis_accounts::add_genesis_accounts, Base64Account};
use solana_ledger::{blocktree::create_new_ledger, poh::compute_hashes_per_tick};
use solana_sdk::{
@@ -484,8 +486,8 @@ fn main() -> Result<(), Box<dyn error::Error>> {
..GenesisConfig::default()
};
if let Some(creation_time) = matches.value_of("creation_time") {
genesis_config.creation_time = DateTime::parse_from_rfc3339(creation_time)?.timestamp();
if let Some(creation_time) = unix_timestamp_of(&matches, "creation_time") {
genesis_config.creation_time = creation_time;
}
if let Some(faucet_pubkey) = faucet_pubkey {